- Timestamp:
- May 5, 2005, 11:30:32 PM (20 years ago)
- Location:
- orxonox/trunk/src/lib/gui/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/gui/gui/gui_exec.cc
r4068 r4071 177 177 { 178 178 int counter = 0; 179 while(counter < depth &&((widget-> isOption>0179 while(counter < depth &&((widget->optionType > GUI_NOTHING 180 180 &&(static_cast<Option*>(widget)->isSaveable())) 181 ||(widget-> isOption<0181 ||(widget->optionType < GUI_NOTHING 182 182 && static_cast<Packer*>(widget)->getGroupName()))) 183 183 { … … 187 187 188 188 // check if it is a Packer, and if it is, check if it has a name and if there is something in it. 189 if(widget-> isOption <0)189 if(widget->optionType < GUI_NOTHING) 190 190 { 191 191 if(static_cast<Packer*>(widget)->getGroupName()) … … 200 200 } 201 201 } 202 // if(widget->isOption == 0) 203 // printf("%s\n",widget->title); 204 if(widget->isOption >= 1) 202 203 if(widget->optionType > GUI_NOTHING) 205 204 if (static_cast<Option*>(widget)->isSaveable()) 206 205 { … … 280 279 { 281 280 PRINT(5)("Located Option %s.\n", widget->title); 282 if(widget-> isOption >= 1)281 if(widget->optionType > GUI_NOTHING) 283 282 static_cast<Option*>(widget)->load(info->variableValue); 284 283 } … … 305 304 } 306 305 307 if(widget-> isOption < 0)306 if(widget->optionType < GUI_NOTHING) 308 307 { 309 308 if(static_cast<Packer*>(widget)->getGroupName() && -
orxonox/trunk/src/lib/gui/gui/gui_flags.cc
r4056 r4071 76 76 { 77 77 FlagInfo* info =(FlagInfo*)flagInfo; 78 if(widget-> isOption >= 1)78 if(widget->optionType > GUI_NOTHING) 79 79 if (static_cast<Option*>(widget)->value != static_cast<Option*>(widget)->defaultValue ) 80 80 { … … 90 90 } 91 91 92 if(static_cast<Option*>(widget)-> isOption == 2)92 if(static_cast<Option*>(widget)->optionType > GUI_BOOL) 93 93 { 94 94 info->flagsLabel->appendText("="); -
orxonox/trunk/src/lib/gui/gui/gui_gtk.cc
r4069 r4071 222 222 return this; 223 223 224 if (this-> isOption < 0&& static_cast<Packer*>(this)->down)224 if (this->optionType < GUI_NOTHING && static_cast<Packer*>(this)->down) 225 225 { 226 226 Widget* tmp = static_cast<Packer*>(this)->down->findWidgetByName(name, depth+1); … … 243 243 { 244 244 function(this); 245 if (this-> isOption < 0)245 if (this->optionType < GUI_NOTHING) 246 246 { 247 247 static_cast<Packer*>(this)->down->walkThrough(function, depth+1); … … 261 261 { 262 262 function(this, data); 263 if (this-> isOption < 0)263 if (this->optionType < GUI_NOTHING) 264 264 { 265 265 static_cast<Packer*>(this)->down->walkThrough(function, data, depth+1); … … 275 275 void Widget::listOptionsAndGroups(Widget* widget) 276 276 { 277 if (widget-> isOption < 0&& static_cast<Packer*>(widget)->groupName)277 if (widget->optionType < GUI_NOTHING && static_cast<Packer*>(widget)->groupName) 278 278 PRINT(0)("[%s]\n", static_cast<Packer*>(widget)->groupName); 279 if (widget-> isOption >= 1)279 if (widget->optionType > GUI_NOTHING) 280 280 { 281 281 Widget::listOptions(widget); … … 289 289 void Widget::listOptions(Widget* widget) 290 290 { 291 if(widget-> isOption >= 1)291 if(widget->optionType > GUI_NOTHING) 292 292 PRINT(0)(" %s is %s\n", static_cast<Option*>(widget)->title, static_cast<Option*>(widget)->save()); 293 293 } … … 301 301 { 302 302 303 if (widget-> isOption >= 1)303 if (widget->optionType > GUI_NOTHING) 304 304 { 305 305 int* count =(int*)data; … … 320 320 Widget* Widget::findOptionByNumber(int* number, unsigned int depth) 321 321 { 322 if ( isOption > 0)322 if (optionType > GUI_NOTHING) 323 323 { 324 324 --*number; … … 328 328 } 329 329 } 330 if (this-> isOption < 0&& static_cast<Packer*>(this)->down)330 if (this->optionType < GUI_NOTHING && static_cast<Packer*>(this)->down) 331 331 { 332 332 Widget* tmp = static_cast<Packer*>(this)->down->findOptionByNumber(number, depth+1); … … 346 346 void Widget::listGroups(Widget* widget) 347 347 { 348 if (widget-> isOption < 0&& static_cast<Packer*>(widget)->groupName)348 if (widget->optionType < GUI_NOTHING && static_cast<Packer*>(widget)->groupName) 349 349 PRINT(0)("[%s]\n", static_cast<Packer*>(widget)->groupName); 350 350 } … … 358 358 { 359 359 int* count = (int*)data; 360 if (widget-> isOption < 0&& static_cast<Packer*>(widget)->groupName)360 if (widget->optionType < GUI_NOTHING && static_cast<Packer*>(widget)->groupName) 361 361 PRINT(0)("%d: [%s]\n", ++*count, static_cast<Packer*>(widget)->groupName); 362 362 } … … 369 369 Widget* Widget::findGroupByNumber(int* number, unsigned int depth) 370 370 { 371 if ( isOption < 0&& static_cast<Packer*>(this)->groupName)371 if (optionType < GUI_NOTHING && static_cast<Packer*>(this)->groupName) 372 372 { 373 373 --*number; … … 377 377 } 378 378 } 379 if (this-> isOption < 0&& static_cast<Packer*>(this)->down)379 if (this->optionType < GUI_NOTHING && static_cast<Packer*>(this)->down) 380 380 { 381 381 Widget* tmp = static_cast<Packer*>(this)->down->findGroupByNumber(number, depth+1); … … 395 395 void Widget::setOptions(Widget* widget) 396 396 { 397 if (widget-> isOption >= 1)397 if (widget->optionType > GUI_NOTHING) 398 398 static_cast<Option*>(widget)->redraw(); 399 399 } … … 406 406 void Widget::redrawOptions(Widget* widget) 407 407 { 408 if (widget-> isOption >= 1)408 if (widget->optionType > GUI_NOTHING) 409 409 static_cast<Option*>(widget)->redraw(); 410 410 } … … 415 415 void Widget::flagCheck(Widget* widget, void* flagName) 416 416 { 417 if (widget-> isOption>=1)417 if (widget->optionType > GUI_NOTHING) 418 418 { 419 419 Option* option =(Option*)widget; … … 567 567 Container::Container(void) 568 568 { 569 this-> isOption = -1;569 this->optionType = GUI_CONTAINER; 570 570 } 571 571 … … 814 814 EventBox::EventBox(const char* eventBoxName) 815 815 { 816 this->isOption = -1;817 818 816 #ifdef HAVE_GTK2 819 817 this->widget = gtk_event_box_new(); … … 842 840 Box::Box(char boxtype) 843 841 { 844 this-> isOption = -2;842 this->optionType = GUI_BOX; 845 843 846 844 #ifdef HAVE_GTK2 … … 1055 1053 Button::Button(char* buttonName) 1056 1054 { 1057 isOption = 0;1055 this->optionType = GUI_NOTHING; 1058 1056 1059 1057 #ifdef HAVE_GTK2 … … 1115 1113 CheckButton::CheckButton(const char* buttonName) 1116 1114 { 1117 this-> isOption = 1;1115 this->optionType = GUI_BOOL; 1118 1116 1119 1117 #ifdef HAVE_GTK2 … … 1205 1203 Slider::Slider(const char* slidername, int start, int end) 1206 1204 { 1207 this-> isOption = 2;1205 this->optionType = GUI_INT; 1208 1206 1209 1207 this->start = start; … … 1329 1327 void Menu::init(void) 1330 1328 { 1331 this-> isOption = 2;1329 this->optionType = GUI_INT; 1332 1330 this->firstItem = NULL; 1333 1331 … … 1443 1441 OptionLabel::OptionLabel(const char* label, const char* value) 1444 1442 { 1445 this-> isOption = 5;1443 this->optionType = GUI_CHAR_ARRAY; 1446 1444 cValue = NULL; 1447 1445 … … 1533 1531 Label:: Label(const char* text) 1534 1532 { 1535 this-> isOption = 0;1533 this->optionType = GUI_NOTHING; 1536 1534 1537 1535 #ifdef HAVE_GTK2 … … 1629 1627 ProgressBar::ProgressBar(const char* label) 1630 1628 { 1631 this-> isOption = 0;1629 this->optionType = GUI_NOTHING; 1632 1630 this->progress = 0.0; 1633 1631 this->totalSize = 0.0; … … 1728 1726 void Image::init(const char* name) 1729 1727 { 1730 isOption = 0;1728 optionType = GUI_NOTHING; 1731 1729 1732 1730 if (this->title) … … 1746 1744 FileDialog::FileDialog(const char* fileDialogName) 1747 1745 { 1748 this-> isOption = 0;1746 this->optionType = GUI_NOTHING; 1749 1747 this->isOpen = false; 1750 1748 this->changeOption = NULL; -
orxonox/trunk/src/lib/gui/gui/gui_gtk.h
r4068 r4071 32 32 33 33 // enumerator for different GuiOption-Types 34 enum GUI_OPTION {GUI_ CONTAINER= -2,35 GUI_ BOX= -1,34 enum GUI_OPTION {GUI_BOX = -2, 35 GUI_CONTAINER = -1, 36 36 GUI_NOTHING = 0, 37 37 GUI_BOOL = 1, … … 64 64 void walkThrough(void(*function)(Widget*), unsigned int depth); 65 65 void walkThrough(void(*function)(Widget*, void*), void* data, unsigned int depth); 66 static void listOptionsAndGroups(Widget* widget);67 static void listOptions(Widget* widget);68 static void listOptions(Widget* widget, void* data);69 Widget* findOptionByNumber(int* number, unsigned int depth);70 static void listGroups(Widget* widget);71 static void listGroups(Widget* widget, void* data);72 Widget* findGroupByNumber(int* number, unsigned int depth);73 static void setOptions(Widget* widget);74 static void redrawOptions(Widget* widget);75 static void flagCheck(Widget* widget, void* flagName);66 static void listOptionsAndGroups(Widget* widget); 67 static void listOptions(Widget* widget); 68 static void listOptions(Widget* widget, void* data); 69 Widget* findOptionByNumber(int* number, unsigned int depth); 70 static void listGroups(Widget* widget); 71 static void listGroups(Widget* widget, void* data); 72 Widget* findGroupByNumber(int* number, unsigned int depth); 73 static void setOptions(Widget* widget); 74 static void redrawOptions(Widget* widget); 75 static void flagCheck(Widget* widget, void* flagName); 76 76 77 77 #ifdef HAVE_GTK2 … … 104 104 #endif /* HAVE_GTK2 */ 105 105 106 int isOption; //!< with this Paramenter one can set the option-type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option, 3: float option, 4:char option, 5: char* option 107 106 GUI_OPTION optionType; //!< The Type of the Widget. 108 107 char* title; //!< The name of the Widget. Some do display it, Options need it to save; 109 108 }; … … 142 141 Container(void); 143 142 virtual ~Container(void); 143 144 144 void setBorderWidth(int borderwidth); 145 145 void fill(Widget* lowerWidget);
Note: See TracChangeset
for help on using the changeset viewer.