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

Method pushDialogControl

Engine/source/gui/core/guiCanvas.cpp:1490–1544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1488}
1489
1490void GuiCanvas::pushDialogControl(GuiControl *gui, S32 layer, bool center)
1491{
1492 if( center )
1493 gui->setPosition( getExtent().x / 2 - gui->getExtent().x / 2,
1494 getExtent().y / 2 - gui->getExtent().y / 2 );
1495
1496 //add the gui
1497 gui->mLayer = layer;
1498
1499 // GuiControl::addObject wakes the object
1500 addObject(gui);
1501
1502 //reorder it to the correct layer
1503 iterator i;
1504 for (i = begin(); i != end(); i++)
1505 {
1506 GuiControl *ctrl = static_cast<GuiControl*>(*i);
1507 if (ctrl->mLayer > gui->mLayer)
1508 {
1509 reOrder(gui, ctrl);
1510 break;
1511 }
1512 }
1513
1514 //call the dialog push method
1515 gui->onDialogPush();
1516
1517 //find the first responder
1518 GuiControl* responder = gui->findFirstTabable();
1519 if(responder)
1520 responder->setFirstResponder();
1521
1522 // call the 'onWake' method?
1523 //if(wakedGui)
1524 // Con::executef(gui, 1, "onWake");
1525
1526 //refresh the entire gui
1527 resetUpdateRegions();
1528
1529 //rebuild the accelerator map
1530 mAcceleratorMap.clear();
1531 if (size() > 0)
1532 {
1533 GuiControl *ctrl = static_cast<GuiControl*>(last());
1534 ctrl->buildAcceleratorMap();
1535 }
1536
1537 refreshMouseControl();
1538
1539 // I don't see the purpose of this, and it's causing issues when showing, for instance the
1540 // metrics dialog while in a 3d scene, causing the cursor to be shown even when the mouse
1541 // is locked [4/25/2007 justind]
1542 //if(gui->mProfile && gui->mProfile->mModal)
1543 // mPlatformWindow->getCursorController()->pushCursor(PlatformCursorController::curArrow);
1544}
1545
1546void GuiCanvas::popDialogControl(GuiControl *gui)
1547{

Callers 7

setVisibleMethod · 0.80
_getContentControlMethod · 0.80
onMouseDownMethod · 0.80
guiCanvas.cppFile · 0.80
showPopupMethod · 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