void SingleWindow::CancelDialog() { AssertThread(); GetTopDialog().SetModalResult(mrCancel); }
void Screen::RecheckActiveDialog() { Dialog *pNewTop = GetTopDialog(); if (pActiveDlg == pNewTop) return; Mouse.ReleaseElements(); // do not set yet if it's fading if (pActiveDlg && pActiveDlg->IsFading()) pActiveDlg = NULL; }
void MainWindow::OnSetFocus() { SingleWindow::OnSetFocus(); if (!HasDialog()) { /* the main window should never have the keyboard focus; if we happen to get the focus despite of that, forward it to the map window to make keyboard shortcuts work */ if (map != NULL && widget == NULL) map->SetFocus(); else if (widget != NULL) widget->SetFocus(); } else /* recover the dialog focus if it got lost */ GetTopDialog().FocusFirstControl(); }
void Screen::CloseDialog(Dialog *pDlg, bool fFade) { // hide dlg if (!fFade) pDlg->fShow = false; // kill from active if (pActiveDlg == pDlg) { // release any MouseOver/Drag of previous dlg Mouse.ReleaseElements(); // close context menu: probably belonging to closed dlg anyway AbortContext(false); // set new active dlg pActiveDlg = GetTopDialog(); // do not set yet if it's fading if (pActiveDlg && pActiveDlg->IsFading()) pActiveDlg = NULL; } // redraw background; clip update Game.GraphicsSystem.InvalidateBg(); UpdateMouseFocus(); }