MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / addChildren

Method addChildren

Engine/source/gui/controls/guiPopUpCtrl.cpp:1348–1377  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1346
1347//------------------------------------------------------------------------------
1348void GuiPopUpMenuCtrl::addChildren()
1349{
1350 // Create Text List.
1351 mTl = new GuiPopupTextListCtrl( this );
1352 AssertFatal( mTl, "Failed to create the GuiPopUpTextListCtrl for the PopUpMenu" );
1353 // Use the children's profile rather than the parent's profile, if it exists.
1354 mTl->setControlProfile( mProfile->getChildrenProfile() ? mProfile->getChildrenProfile() : mProfile );
1355 mTl->setField("noDuplicates", "false");
1356
1357 mSc = new GuiScrollCtrl;
1358 AssertFatal( mSc, "Failed to create the GuiScrollCtrl for the PopUpMenu" );
1359 GuiControlProfile *prof;
1360 if ( Sim::findObject( "GuiScrollProfile", prof ) )
1361 {
1362 mSc->setControlProfile( prof );
1363 }
1364 else
1365 {
1366 // Use the children's profile rather than the parent's profile, if it exists.
1367 mSc->setControlProfile( mProfile->getChildrenProfile() ? mProfile->getChildrenProfile() : mProfile );
1368 }
1369
1370 mSc->setField( "hScrollBar", "AlwaysOff" );
1371 mSc->setField( "vScrollBar", "dynamic" );
1372 //if(mRenderScrollInNA) // Force the scroll control to render using fillColorNA rather than fillColor
1373 // mSc->mUseNABackground = true;
1374
1375 mBackground = new GuiPopUpBackgroundCtrl( this, mTl );
1376 AssertFatal( mBackground, "Failed to create the GuiBackgroundCtrl for the PopUpMenu" );
1377}
1378
1379//------------------------------------------------------------------------------
1380void GuiPopUpMenuCtrl::repositionPopup()

Callers

nothing calls this directly

Calls 4

setControlProfileMethod · 0.80
getChildrenProfileMethod · 0.80
setFieldMethod · 0.80
findObjectFunction · 0.50

Tested by

no test coverage detected