Changeset 3295 in orxonox.OLD for orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc
- Timestamp:
- Dec 26, 2004, 8:06:06 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc
r3294 r3295 207 207 if (widget->isOption >= 1) 208 208 static_cast<Option*>(widget)->redraw(); 209 } 210 211 /** 212 \brief Walks through all the Flags given at startuptime. 213 */ 214 void Widget::flagCheck(Widget* widget, void* flagName) 215 { 216 if (widget->isOption>=1) 217 { 218 Option* option = (Option*)widget; 219 char* name = (char*)flagName; 220 char* value = NULL; 221 bool found = false; 222 // check if long flag matches 223 if ((option->flagName && strlen(name)>2 && !strncmp(name+2, option->flagName, strlen(option->flagName)) && (name[strlen(option->flagName)+2] == '\0' || name[strlen(option->flagName)+2] == '=') )) 224 { 225 found = true; 226 if (name[strlen(option->flagName)+2] == '=') 227 { 228 value = name+strlen(option->flagName)+3; 229 } 230 } 231 else if (option->flagNameShort && strlen(name)>1 && !strncmp(name+1, option->flagNameShort, strlen(option->flagNameShort))&& (name[strlen(option->flagNameShort)+1] == '\0' || name[strlen(option->flagNameShort)+1] == '=')) // check if short flag matches 232 { 233 found = true; 234 if (name[strlen(option->flagNameShort)+1] == '=') 235 { 236 value = name+strlen(option->flagNameShort)+2; 237 } 238 } 239 240 if (found) 241 { 242 PRINT(3)("found matching Flag %s\n", name); 243 if (value) 244 { 245 PRINT(3)("with Value %s\n", value); 246 option->value = atoi(value); 247 } 248 else 249 { 250 option->value = !option->defaultValue; 251 } 252 option->redraw(); 253 } 254 255 } 209 256 } 210 257
Note: See TracChangeset
for help on using the changeset viewer.