| 1409 | } |
| 1410 | |
| 1411 | void 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 | |
| 1467 | void GuiCanvas::popDialogControl(GuiControl *gui) |
| 1468 | { |
no test coverage detected