| 1488 | } |
| 1489 | |
| 1490 | void 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 | |
| 1546 | void GuiCanvas::popDialogControl(GuiControl *gui) |
| 1547 | { |
no test coverage detected