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

Method onAdd

Engine/source/gui/editor/guiInspectorTypes.cpp:1307–1390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1305);
1306
1307bool GuiInspectorTypeBitMask32::onAdd()
1308{
1309 // Skip our parent because we aren't using mEditCtrl
1310 // and according to our parent that would be cause to fail onAdd.
1311 if ( !Parent::Parent::onAdd() )
1312 return false;
1313
1314 if ( !mInspector )
1315 return false;
1316
1317 const EnumTable* table = mField->table;
1318 if( !table )
1319 {
1320 ConsoleBaseType* type = ConsoleBaseType::getType( mField->type );
1321 if( type && type->getEnumTable() )
1322 table = type->getEnumTable();
1323 else
1324 return false;
1325 }
1326
1327 static StringTableEntry sProfile = StringTable->insert( "profile" );
1328 setDataField( sProfile, NULL, "GuiInspectorFieldProfile" );
1329 setBounds(0,0,100,18);
1330
1331 // Allocate our children controls...
1332
1333 mRollout = new GuiRolloutCtrl();
1334 mRollout->setMargin( 14, 0, 0, 0 );
1335 mRollout->setCanCollapse( false );
1336 mRollout->registerObject();
1337 addObject( mRollout );
1338
1339 mArrayCtrl = new GuiDynamicCtrlArrayControl();
1340 mArrayCtrl->setDataField( sProfile, NULL, "GuiInspectorBitMaskArrayProfile" );
1341 mArrayCtrl->setField( "autoCellSize", "true" );
1342 mArrayCtrl->setField( "fillRowFirst", "true" );
1343 mArrayCtrl->setField( "dynamicSize", "true" );
1344 mArrayCtrl->setField( "rowSpacing", "4" );
1345 mArrayCtrl->setField( "colSpacing", "1" );
1346 mArrayCtrl->setField( "frozen", "true" );
1347 mArrayCtrl->registerObject();
1348
1349 mRollout->addObject( mArrayCtrl );
1350
1351 GuiCheckBoxCtrl *pCheckBox = NULL;
1352
1353 const EngineEnumTable& t = *table;
1354 const U32 numValues = t.getNumValues();
1355
1356 for ( S32 i = 0; i < numValues; i++ )
1357 {
1358 pCheckBox = new GuiCheckBoxCtrl();
1359 pCheckBox->setText( t[ i ].getName() );
1360 pCheckBox->registerObject();
1361 mArrayCtrl->addObject( pCheckBox );
1362
1363 pCheckBox->autoSize();
1364

Callers

nothing calls this directly

Calls 15

getTypeFunction · 0.85
setBoundsFunction · 0.85
dSprintfFunction · 0.85
setFieldMethod · 0.80
getNumValuesMethod · 0.80
autoSizeMethod · 0.80
setExtentMethod · 0.80
getExtentMethod · 0.80
sizeToContentsMethod · 0.80
instantCollapseMethod · 0.80
getEnumTableMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected