| 314 | //----------------------------------------------------------------------------- |
| 315 | |
| 316 | bool GuiControl::processArguments(S32 argc, ConsoleValueRef *argv) |
| 317 | { |
| 318 | // argv[0] - The GuiGroup to add this control to when it's created. |
| 319 | // this is an optional parameter that may be specified at |
| 320 | // object creation time to organize a gui control into a |
| 321 | // subgroup of GuiControls and is useful in helping the |
| 322 | // gui editor group and sort the existent gui's in the Sim. |
| 323 | |
| 324 | // Specified group? |
| 325 | if( argc == 1 ) |
| 326 | { |
| 327 | StringTableEntry steIntName = StringTable->insert(argv[0]); |
| 328 | mAddGroup = dynamic_cast<SimGroup*>(Sim::getGuiGroup()->findObjectByInternalName( steIntName )); |
| 329 | if( mAddGroup == NULL ) |
| 330 | { |
| 331 | mAddGroup = new SimGroup(); |
| 332 | if( mAddGroup->registerObject() ) |
| 333 | { |
| 334 | mAddGroup->setInternalName( steIntName ); |
| 335 | Sim::getGuiGroup()->addObject( mAddGroup ); |
| 336 | } |
| 337 | else |
| 338 | { |
| 339 | SAFE_DELETE( mAddGroup ); |
| 340 | return false; |
| 341 | } |
| 342 | } |
| 343 | mAddGroup->addObject(this); |
| 344 | } |
| 345 | return true; |
| 346 | } |
| 347 | |
| 348 | //----------------------------------------------------------------------------- |
| 349 |
nothing calls this directly
no test coverage detected