Changeset 3287 in orxonox.OLD for orxonox/branches/updater/src
- Timestamp:
- Dec 26, 2004, 3:07:19 AM (20 years ago)
- Location:
- orxonox/branches/updater/src/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/updater/src/gui/orxonox_gui_banner.cc
r3165 r3287 32 32 { 33 33 // Banner Itself // 34 bannerEventBox = new EventBox 35 bannerImage = new Image 34 bannerEventBox = new EventBox("BannerEventBox"); 35 bannerImage = new Image("banner.xpm"); 36 36 bannerEventBox->fill(bannerImage); 37 37 -
orxonox/branches/updater/src/gui/orxonox_gui_flags.cc
r3158 r3287 64 64 strcat (flagText, "orxonox"); 65 65 FlagsText (widget); 66 flagsLabel->setT ext(flagText);66 flagsLabel->setTitle(flagText); 67 67 } 68 68 -
orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc
r3275 r3287 612 612 } 613 613 #endif /* HAVE_GTK2 */ 614 615 614 } 616 615 … … 640 639 } 641 640 642 /* IMAGE */ 643 644 /** 645 \brief Creates a new Image 646 \param imagename the location of the Image on the Hard Disc 647 */ 648 Image::Image (char* imagename) 649 { 650 this->init(); 641 /** 642 \brief Sets the Title of a Box. 643 \title the new Title to set. 644 */ 645 void Box::setTitle(char* title) 646 { 651 647 if (label) 652 648 delete []label; 653 label = new char[strlen(imagename)+1]; 654 strcpy(label, imagename); 655 656 #ifdef HAVE_GTK2 657 widget = gtk_image_new_from_file (imagename); 658 #endif /* HAVE_GTK2 */ 659 } 660 661 /** 662 \brief Initializes a new Image 663 */ 664 void Image::init() 665 { 666 isOption = 0; 667 668 static_cast<Widget*>(this)->init(); 669 } 670 649 label = new char[strlen(title)+1]; 650 strcpy(label, title); 651 } 671 652 672 653 /* OPTION */ … … 1108 1089 { 1109 1090 this->init(); 1110 this->setT ext(text);1091 this->setTitle(text); 1111 1092 } 1112 1093 … … 1130 1111 \param text The text to be inserted into the Label. 1131 1112 */ 1132 void Label::setT ext(char* text)1113 void Label::setTitle(char* text) 1133 1114 { 1134 1115 if (label) … … 1165 1146 { 1166 1147 this->init(); 1167 // this->setLabel(label);1148 this->setTitle (label); 1168 1149 } 1169 1150 … … 1192 1173 1193 1174 /** 1175 \brief Sets a ned Title to the ProgressBar. 1176 \param title The now title of the ProgressBar. 1177 */ 1178 void ProgressBar::setTitle(char* title) 1179 { 1180 if (label) 1181 delete []label; 1182 label = new char [strlen(title)+1]; 1183 strcpy(label, title); 1184 } 1185 1186 /** 1194 1187 \brief Sets the Total size of the Bar. (ex. The maximum one can download) 1195 1188 */ … … 1213 1206 #endif /* HAVE_GTK2 */ 1214 1207 PRINTF(3)("Progress: %f\n", progress*100.0/totalSize); 1215 1216 1208 } 1217 1209 … … 1223 1215 return this->progress; 1224 1216 } 1217 1218 /* IMAGE */ 1219 1220 /** 1221 \brief Creates a new Image 1222 \param imagename the location of the Image on the Hard Disc 1223 */ 1224 Image::Image (char* imagename) 1225 { 1226 this->init(); 1227 if (label) 1228 delete []label; 1229 label = new char[strlen(imagename)+1]; 1230 strcpy(label, imagename); 1231 1232 #ifdef HAVE_GTK2 1233 widget = gtk_image_new_from_file (imagename); 1234 #endif /* HAVE_GTK2 */ 1235 } 1236 1237 /** 1238 \brief Initializes a new Image 1239 */ 1240 void Image::init() 1241 { 1242 isOption = 0; 1243 1244 static_cast<Widget*>(this)->init(); 1245 } 1246 1247 /** 1248 \brief Sets a ned Title to the Image. 1249 \param title The now title of the OptionLabel. 1250 */ 1251 void Image::setTitle(char* title) 1252 { 1253 if (label) 1254 delete []label; 1255 label = new char [strlen(title)+1]; 1256 strcpy(label, title); 1257 } -
orxonox/branches/updater/src/gui/orxonox_gui_gtk.h
r3281 r3287 3 3 \brief Contains all th different Widgets. 4 4 */ 5 6 5 #ifndef _ORXONOX_GUI_GTK_H 7 6 #define _ORXONOX_GUI_GTK_H … … 35 34 36 35 #ifdef HAVE_GTK2 37 bool initGTK(int argc, char *argv[]);36 bool initGTK(int argc, char* argv[]); 38 37 bool mainloopGTK(void); 39 38 #endif /* HAVE_GTK2 */ … … 59 58 char* label; //!< The name of the Widget. Some do display it, Options need it to save; 60 59 #ifdef HAVE_GTK2 61 gulong connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *));62 gulong connectSignal (char* event, gint (*signal)(GtkWidget*, Widget *));63 gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *));64 gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void *));60 gulong connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void* )); 61 gulong connectSignal (char* event, gint (*signal)(GtkWidget*, Widget* )); 62 gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void* )); 63 gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void* )); 65 64 void disconnectSignal (gulong signalID); 66 65 #endif /* HAVE_GTK2 */ … … 68 67 void hide (); 69 68 void setSize(int width, int height); 69 virtual void setTitle(char* title) = 0; 70 70 71 71 void walkThrough (void (*function)(Widget*)); … … 74 74 75 75 #ifdef HAVE_GTK2 76 static gint doNothingSignal (GtkWidget *widget, GdkEvent* event, void* nothing);76 static gint doNothingSignal (GtkWidget* widget, GdkEvent* event, void* nothing); 77 77 #endif /* HAVE_GTK2 */ 78 78 }; … … 88 88 void setGroupName (char* name); 89 89 char* getGroupName (void); 90 91 virtual void fill (Widget* lowerWidget) = 0; 90 92 }; 91 93 … … 106 108 // void setBorderWidth (int borderwidth); 107 109 // virtual void setTitle (char* title) = 0; 108 void fill (Widget *lowerWidget);110 void fill (Widget* lowerWidget); 109 111 }; 110 112 … … 122 124 static void addWindow(Window* windowToAdd); 123 125 124 Window 125 Window 126 void init 127 128 void setTitle 129 void showall ();130 void open( );131 void close( );132 133 #ifdef HAVE_GTK2 134 static gint windowOpen (GtkWidget *widget, GdkEvent* event, void* window);135 static gint windowClose (GtkWidget *widget, GdkEvent* event, void* window);136 static gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data);126 Window(void); 127 Window(char* windowName); 128 void init(); 129 130 void setTitle(char* title); 131 void showall(void); 132 void open(void); 133 void close(void); 134 135 #ifdef HAVE_GTK2 136 static gint windowOpen(GtkWidget* widget, GdkEvent* event, void* window); 137 static gint windowClose(GtkWidget* widget, GdkEvent* event, void* window); 138 static gint orxonox_gui_quit(GtkWidget* widget, GdkEvent* event, gpointer data); 137 139 #endif /* HAVE_GTK2 */ 138 140 }; … … 150 152 void init(void); 151 153 152 void setTitle 154 void setTitle(char* title); 153 155 }; 154 156 … … 164 166 void init(void); 165 167 166 void setTitle 168 void setTitle(char* title); 167 169 }; 168 170 … … 179 181 Box (char boxtype); 180 182 void init(char boxtype); 181 183 182 184 void fill (Widget* lowerWidget); 183 185 184 }; 185 186 //! Image is the keeper of one Image 187 /** 188 * Images are mighty cool. 189 * Images can help you lighten up the Programming process, and will give everyone a better impression of the Software. 190 */ 191 class Image : public Widget 192 { 193 public: 194 Image (char* imgaename); 195 void init(void); 186 void setTitle(char* title); 196 187 }; 197 188 … … 203 194 { 204 195 public: 205 //virtual gint OptionChange (GtkWidget *widget, GdkEvent *event, gpointer data);196 //virtual gint OptionChange (GtkWidget* widget, GdkEvent* event, gpointer data); 206 197 void init(void); 207 198 … … 314 305 void init(void); 315 306 316 void setT ext(char* text);307 void setTitle(char* text); 317 308 char* getText (); 318 309 }; … … 326 317 ~ProgressBar (); 327 318 void init (void); 328 319 320 void setTitle(char* title); 321 329 322 void setProgress (double progress); 330 323 void setTotalSize (double totalSize); … … 339 332 }; 340 333 341 //gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data); 334 //! Image is the keeper of one Image 335 /** 336 * Images are mighty cool. 337 * Images can help you lighten up the Programming process, and will give everyone a better impression of the Software. 338 */ 339 class Image : public Widget 340 { 341 public: 342 Image (char* imgaename); 343 void init(void); 344 345 void setTitle(char* title); 346 }; 347 348 //gint orxonox_gui_quit (GtkWidget* widget, GdkEvent* event, gpointer data); 342 349 343 350 #endif /* _ORXONOX_GUI_GTK_H */
Note: See TracChangeset
for help on using the changeset viewer.