Changeset 3304 in orxonox.OLD for orxonox/branches/updater/src/gui
- Timestamp:
- Dec 28, 2004, 9:46:54 PM (20 years ago)
- Location:
- orxonox/branches/updater/src/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc
r3300 r3304 955 955 } 956 956 957 #ifdef HAVE_GTK2 958 /** 959 \brief Signal OptionChange writes the Value from the Slider to its Object-Database. 960 \param widget The widget(Slider) that has a changed Value 961 \param slider the Slider-Object that should receive the change. 962 */ 963 gint Option::OptionChange (GtkWidget *widget, Widget* option) 964 { 965 static_cast<Option*>(option)->changeOption(); 966 flags->setTextFromFlags(orxonoxGUI); //// must be different !!! 967 } 968 #endif /* HAVE_GTK2 */ 969 970 957 971 /* BUTTON */ 958 972 … … 1021 1035 not implemented yet 1022 1036 */ 1023 void Button::redraw () 1024 { 1037 void Button::redraw (void) 1038 { 1039 } 1040 1041 /** 1042 \brief Button can not be changed, optionChange is empty) 1043 */ 1044 void Button::changeOption(void) 1045 { 1046 1025 1047 } 1026 1048 … … 1098 1120 } 1099 1121 1100 #ifdef HAVE_GTK2 1101 /** 1102 \brief Signal OptionChange writes the Value from the CheckButton to its Object-Database. 1103 \param widget The widget(CheckButton) that has a changed Value 1104 \param checkbutton the CheckButton-Object that should receive the change. 1105 */ 1106 gint CheckButton::OptionChange (GtkWidget *widget, Widget* checkbutton) 1107 { 1108 static_cast<CheckButton*>(checkbutton)->value = (int)gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ((CheckButton*)checkbutton->widget)); 1109 flags->setTextFromFlags(orxonoxGUI); ////// must be different!!! 1110 cout << static_cast<CheckButton*>(checkbutton)->title << " set to: " << static_cast<CheckButton*>(checkbutton)->value << endl; 1111 } 1112 #endif /* HAVE_GTK2 */ 1122 /** 1123 \brief Changed the Option, call this Function 1124 */ 1125 void CheckButton::changeOption() 1126 { 1127 #ifdef HAVE_GTK2 1128 this->value = (int)gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (this->widget)); 1129 #endif /* HAVE_GTK2 */ 1130 cout << this->title << " set to: " << this->value << endl; 1131 } 1132 1113 1133 1114 1134 /** … … 1210 1230 } 1211 1231 1212 #ifdef HAVE_GTK2 1213 /** 1214 \brief Signal OptionChange writes the Value from the Slider to its Object-Database. 1215 \param widget The widget(Slider) that has a changed Value 1216 \param slider the Slider-Object that should receive the change. 1217 */ 1218 gint Slider::OptionChange (GtkWidget *widget, Widget* slider) 1219 { 1220 static_cast<Slider*>(slider)->value = (int)gtk_range_get_value (GTK_RANGE ((Slider*)slider->widget)); 1221 flags->setTextFromFlags(orxonoxGUI); //// must be different !!! 1222 cout << static_cast<Slider*>(slider)->title << " set to: "<< static_cast<Slider*>(slider)->value << endl; 1223 } 1224 #endif /* HAVE_GTK2 */ 1225 1232 /** 1233 \brief Changed the Option, call this Function 1234 */ 1235 void Slider::changeOption() 1236 { 1237 #ifdef HAVE_GTK2 1238 this->value = (int)gtk_range_get_value(GTK_RANGE(this->widget)); 1239 #endif /* HAVE_GTK2 */ 1240 cout << this->title << " set to: " << this->value << endl; 1241 } 1226 1242 1227 1243 /* MENU */ … … 1329 1345 } 1330 1346 1331 #ifdef HAVE_GTK2 1332 /** 1333 \brief Signal OptionChange writes the Value from the Menu to its Object-Database. 1334 \param widget The widget(Menu) that has a changed Value 1335 \param menu the Menu-Object that should receive the change. 1336 */ 1337 gint Menu::OptionChange (GtkWidget *widget, Widget* menu) 1338 { 1339 static_cast<Menu*>(menu)->value = (int)gtk_option_menu_get_history (GTK_OPTION_MENU (menu->widget)); 1340 flags->setTextFromFlags(orxonoxGUI); //// must be different !!! 1341 cout << static_cast<Menu*>(menu)->title << " changed to : " << static_cast<Menu*>(menu)->value << endl; 1342 } 1343 #endif /* HAVE_GTK2 */ 1347 /** 1348 \brief Changed the Option, call this Function 1349 */ 1350 void Menu::changeOption() 1351 { 1352 #ifdef HAVE_GTK2 1353 this->value = (int)gtk_option_menu_get_history (GTK_OPTION_MENU (this->widget)); 1354 #endif /* HAVE_GTK2 */ 1355 cout << this->title << " set to: " << this->value << endl; 1356 } 1344 1357 1345 1358 /* OPTION LABEL */ … … 1421 1434 strcpy(this->title, title); 1422 1435 #ifdef HAVE_GTK2 1423 gtk_label_set_text (GTK_LABEL 1436 gtk_label_set_text (GTK_LABEL(widget), title); 1424 1437 #endif /* HAVE_GTK2 */ 1425 1438 } … … 1432 1445 1433 1446 } 1447 1448 /** 1449 \brief Changed the Option, call this Function 1450 */ 1451 void OptionLabel::changeOption() 1452 { 1453 #ifdef HAVE_GTK2 1454 this->cValue = (char*)gtk_label_get_text (GTK_LABEL(this->widget)); 1455 #endif /* HAVE_GTK2 */ 1456 cout << this->title << " set to: " << this->cValue << endl; 1457 } 1458 1434 1459 1435 1460 /** -
orxonox/branches/updater/src/gui/orxonox_gui_gtk.h
r3300 r3304 216 216 217 217 public: 218 //virtual gint OptionChange (GtkWidget* widget, GdkEvent* event, gpointer data);219 218 void init(void); 220 219 void destroy(void); … … 230 229 void setFlagName (char* flagname, int defaultvalue); 231 230 void setFlagName (char* flagname, char* flagnameshort, int defaultvalue); 232 virtual void redraw () = 0; //!< A Option must be able to redraw itself. 231 virtual void redraw (void) = 0; //!< A Option must be able to redraw itself. 232 virtual void changeOption(void) = 0; //!< What to do, if an Option is Changed. eacht option decides for itself. 233 #ifdef HAVE_GTK2 234 // Signals 235 static gint OptionChange (GtkWidget* widget, Widget* option); //!< Signal for Options that change. 236 #endif /* HAVE_GTK2 */ 233 237 }; 234 238 … … 247 251 void setTitle(char* title); 248 252 void redraw(); 253 void changeOption(void); 249 254 }; 250 255 … … 263 268 bool isActive(); //!< a Bool value to see, if this CheckButton is active. 264 269 void redraw (); 265 266 #ifdef HAVE_GTK2 267 // Signals 268 static gint OptionChange (GtkWidget* widget, Widget* checkbutton); 269 #endif /* HAVE_GTK2 */ 270 void changeOption(void); 270 271 }; 271 272 … … 284 285 void setTitle(char* title); 285 286 void setValue(int value); 286 void redraw(); 287 288 #ifdef HAVE_GTK2 289 // Signals 290 static gint OptionChange (GtkWidget* widget, Widget* slider); 291 #endif /* HAVE_GTK2 */ 287 void redraw(void); 288 void changeOption(void); 292 289 }; 293 290 … … 310 307 void setTitle(char* title); 311 308 void addItem(char* itemName); 312 #ifdef HAVE_GTK2 313 static gint OptionChange (GtkWidget* widget, Widget* menu); 314 #endif /* HAVE_GTK2 */ 315 void redraw(); 309 void redraw(void); 310 void changeOption(void); 316 311 }; 317 312 … … 331 326 void setTitle(char* title); 332 327 void redraw(); 328 void changeOption(); 333 329 334 330 char* cValue; //!< The Value the Label will have. \todo make private
Note: See TracChangeset
for help on using the changeset viewer.