Changeset 3299 in orxonox.OLD for orxonox/branches/updater/src/gui/orxonox_gui_flags.cc
- Timestamp:
- Dec 27, 2004, 2:02:11 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/updater/src/gui/orxonox_gui_flags.cc
r3287 r3299 32 32 OrxonoxGuiFlags::OrxonoxGuiFlags (Widget* widget) 33 33 { 34 flagText = (char*) malloc (1024); 34 this->flagsFrame = new Frame ("Orxonox-Startup-Flags:"); 35 this->flagsBox = new Box ('v'); 35 36 36 flagsFrame = new Frame ("Orxonox-Startup-Flags:"); 37 flagsBox = new Box ('v'); 37 this->flagsLabel = new Label (); 38 this->flagsLabel->setSize (260,60); 39 this->flagsBox->fill (flagsLabel); 40 this->shortFlags = new CheckButton ("shortFlags"); 41 this->flagsBox->fill (shortFlags); 38 42 39 flagsLabel = new Label (); 40 flagsLabel->setSize (260,60); 41 flagsBox->fill (flagsLabel); 42 shortFlags = new CheckButton ("shortFlags"); 43 flagsBox->fill (shortFlags); 44 45 flagsFrame->fill (flagsBox); 43 this->flagsFrame->fill (flagsBox); 46 44 } 47 45 … … 52 50 Widget* OrxonoxGuiFlags::getWidget () 53 51 { 54 return flagsFrame;52 return this->flagsFrame; 55 53 } 56 54 … … 61 59 void OrxonoxGuiFlags::setTextFromFlags (Widget* widget) 62 60 { 63 sprintf (flagText, ""); 64 strcat (flagText, "orxonox"); 65 FlagsText (widget); 66 flagsLabel->setTitle(flagText); 61 FlagInfo flagInfo; 62 flagInfo.shortFlags = this->shortFlags; 63 flagInfo.flagsLabel = this->flagsLabel; 64 65 this->flagsLabel->ereaseText(); 66 this->flagsLabel->appendText("orxonox"); 67 widget->walkThrough(OrxonoxGuiFlags::flagsText, &flagInfo, 0); 68 // flagsLabel->setTitle(flagText); 67 69 } 68 70 … … 71 73 \param widget like OrxonoxGuiFlags::setTextFromFlags(widget) 72 74 */ 73 void OrxonoxGuiFlags:: FlagsText(Widget* widget)75 void OrxonoxGuiFlags::flagsText(Widget* widget, void* flagInfo) 74 76 { 77 FlagInfo* info = (FlagInfo*)flagInfo; 75 78 if (widget->isOption >= 1) 76 if (static_cast<Option*>(widget)->value != static_cast<Option*>(widget)->defaultValue && (static_cast<Option*>(widget)->flagName || static_cast<Option*>(widget)->flagNameShort ))79 if (static_cast<Option*>(widget)->value != static_cast<Option*>(widget)->defaultValue ) 77 80 { 78 if ( shortFlags->isActive())81 if (info->shortFlags->isActive() && static_cast<Option*>(widget)->flagNameShort) 79 82 { 80 strcat (flagText," -");81 strcat (flagText,static_cast<Option*>(widget)->flagNameShort);83 info->flagsLabel->appendText(" -"); 84 info->flagsLabel->appendText(static_cast<Option*>(widget)->flagNameShort); 82 85 } 83 else 86 else if (!info->shortFlags->isActive() && static_cast<Option*>(widget)->flagName) 84 87 { 85 strcat (flagText," --");86 strcat (flagText,static_cast<Option*>(widget)->flagName);88 info->flagsLabel->appendText(" --"); 89 info->flagsLabel->appendText(static_cast<Option*>(widget)->flagName); 87 90 } 91 88 92 if (static_cast<Option*>(widget)->isOption == 2) 89 93 { 90 sprintf (flagText, "%s=%i", flagText, static_cast<Option*>(widget)->value); 94 info->flagsLabel->appendText("="); 95 info->flagsLabel->appendInt(static_cast<Option*>(widget)->value); 91 96 } 92 97 } 93 switch (widget->isOption)94 {95 case -1:96 FlagsText (static_cast<Container*>(widget)->down);97 break;98 case -2:99 FlagsText (static_cast<Box*>(widget)->down);100 break;101 }102 103 if (widget->next != NULL)104 FlagsText (widget->next);105 98 }
Note: See TracChangeset
for help on using the changeset viewer.