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

Method popDialogControl

Engine/source/gui/core/guiCanvas.cpp:1467–1524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1465}
1466
1467void GuiCanvas::popDialogControl(GuiControl *gui)
1468{
1469 if (size() < 1)
1470 return;
1471
1472 //first, find the dialog, and call the "onDialogPop()" method
1473 GuiControl *ctrl = NULL;
1474 if (gui)
1475 {
1476 //make sure the gui really exists on the stack
1477 iterator i;
1478 bool found = false;
1479 for(i = begin(); i != end(); i++)
1480 {
1481 GuiControl *check = static_cast<GuiControl *>(*i);
1482 if (check == gui)
1483 {
1484 ctrl = check;
1485 found = true;
1486 }
1487 }
1488
1489 if (!found)
1490 return;
1491 }
1492 else
1493 ctrl = static_cast<GuiControl*>(last());
1494
1495 //call the "on pop" function
1496 ctrl->onDialogPop();
1497
1498 //now pop the last child (will sleep if awake)
1499 Sim::getGuiGroup()->addObject(ctrl);
1500
1501 if (size() > 0)
1502 {
1503 GuiControl *ctrl = static_cast<GuiControl *>(last());
1504 if( ctrl->getFirstResponder() )
1505 ctrl->getFirstResponder()->setFirstResponder();
1506 }
1507 else
1508 {
1509 setFirstResponder(NULL);
1510 }
1511
1512 //refresh the entire gui
1513 resetUpdateRegions();
1514
1515 //rebuild the accelerator map
1516 mAcceleratorMap.clear();
1517
1518 if (size() > 0)
1519 {
1520 GuiControl *ctrl = static_cast<GuiControl*>(last());
1521 ctrl->buildAcceleratorMap();
1522 }
1523 refreshMouseControl();
1524}

Callers 7

setVisibleMethod · 0.80
popBubbleMethod · 0.80
guiCanvas.cppFile · 0.80
closeMenuMethod · 0.80
closeSubmenuMethod · 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