MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / processArguments

Method processArguments

Engine/source/gui/core/guiControl.cpp:316–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314//-----------------------------------------------------------------------------
315
316bool 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

Callers

nothing calls this directly

Calls 5

setInternalNameMethod · 0.80
insertMethod · 0.45
registerObjectMethod · 0.45
addObjectMethod · 0.45

Tested by

no test coverage detected