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

Method popDialogControl

Engine/source/gui/core/guiCanvas.cpp:1546–1603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1544}
1545
1546void GuiCanvas::popDialogControl(GuiControl *gui)
1547{
1548 if (size() < 1)
1549 return;
1550
1551 //first, find the dialog, and call the "onDialogPop()" method
1552 GuiControl *ctrl = NULL;
1553 if (gui)
1554 {
1555 //make sure the gui really exists on the stack
1556 iterator i;
1557 bool found = false;
1558 for(i = begin(); i != end(); i++)
1559 {
1560 GuiControl *check = static_cast<GuiControl *>(*i);
1561 if (check == gui)
1562 {
1563 ctrl = check;
1564 found = true;
1565 }
1566 }
1567
1568 if (!found)
1569 return;
1570 }
1571 else
1572 ctrl = static_cast<GuiControl*>(last());
1573
1574 //call the "on pop" function
1575 ctrl->onDialogPop();
1576
1577 //now pop the last child (will sleep if awake)
1578 Sim::getGuiGroup()->addObject(ctrl);
1579
1580 if (size() > 0)
1581 {
1582 GuiControl *lastCtrl = static_cast<GuiControl *>(last());
1583 if(lastCtrl->getFirstResponder() )
1584 lastCtrl->getFirstResponder()->setFirstResponder();
1585 }
1586 else
1587 {
1588 setFirstResponder(NULL);
1589 }
1590
1591 //refresh the entire gui
1592 resetUpdateRegions();
1593
1594 //rebuild the accelerator map
1595 mAcceleratorMap.clear();
1596
1597 if (size() > 0)
1598 {
1599 GuiControl *lastCtrl = static_cast<GuiControl*>(last());
1600 lastCtrl->buildAcceleratorMap();
1601 }
1602 refreshMouseControl();
1603}

Callers 5

setVisibleMethod · 0.80
popBubbleMethod · 0.80
guiCanvas.cppFile · 0.80
closePopUpMethod · 0.80
closePopUpMethod · 0.80

Calls 8

beginFunction · 0.85
endFunction · 0.85
buildAcceleratorMapMethod · 0.80
sizeFunction · 0.50
onDialogPopMethod · 0.45
addObjectMethod · 0.45
setFirstResponderMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected