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

Method pushDialogControl

Engine/source/gui/core/guiCanvas.cpp:1411–1465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1409}
1410
1411void GuiCanvas::pushDialogControl(GuiControl *gui, S32 layer, bool center)
1412{
1413 if( center )
1414 gui->setPosition( getExtent().x / 2 - gui->getExtent().x / 2,
1415 getExtent().y / 2 - gui->getExtent().y / 2 );
1416
1417 //add the gui
1418 gui->mLayer = layer;
1419
1420 // GuiControl::addObject wakes the object
1421 addObject(gui);
1422
1423 //reorder it to the correct layer
1424 iterator i;
1425 for (i = begin(); i != end(); i++)
1426 {
1427 GuiControl *ctrl = static_cast<GuiControl*>(*i);
1428 if (ctrl->mLayer > gui->mLayer)
1429 {
1430 reOrder(gui, ctrl);
1431 break;
1432 }
1433 }
1434
1435 //call the dialog push method
1436 gui->onDialogPush();
1437
1438 //find the first responder
1439 GuiControl* responder = gui->findFirstTabable();
1440 if(responder)
1441 responder->setFirstResponder();
1442
1443 // call the 'onWake' method?
1444 //if(wakedGui)
1445 // Con::executef(gui, 1, "onWake");
1446
1447 //refresh the entire gui
1448 resetUpdateRegions();
1449
1450 //rebuild the accelerator map
1451 mAcceleratorMap.clear();
1452 if (size() > 0)
1453 {
1454 GuiControl *ctrl = static_cast<GuiControl*>(last());
1455 ctrl->buildAcceleratorMap();
1456 }
1457
1458 refreshMouseControl();
1459
1460 // I don't see the purpose of this, and it's causing issues when showing, for instance the
1461 // metrics dialog while in a 3d scene, causing the cursor to be shown even when the mouse
1462 // is locked [4/25/2007 justind]
1463 //if(gui->mProfile && gui->mProfile->mModal)
1464 // mPlatformWindow->getCursorController()->pushCursor(PlatformCursorController::curArrow);
1465}
1466
1467void GuiCanvas::popDialogControl(GuiControl *gui)
1468{

Callers 9

showPopupMethod · 0.80
setVisibleMethod · 0.80
_getContentControlMethod · 0.80
onMouseDownMethod · 0.80
guiCanvas.cppFile · 0.80
onActionMethod · 0.80
onSubmenuActionMethod · 0.80
onActionMethod · 0.80
onActionMethod · 0.80

Calls 10

beginFunction · 0.85
endFunction · 0.85
getExtentMethod · 0.80
findFirstTabableMethod · 0.80
buildAcceleratorMapMethod · 0.80
sizeFunction · 0.50
setPositionMethod · 0.45
onDialogPushMethod · 0.45
setFirstResponderMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected