Exemplo n.º 1
0
void
SingleWindow::CancelDialog()
{
  AssertThread();

  GetTopDialog().SetModalResult(mrCancel);
}
Exemplo n.º 2
0
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;
	}
Exemplo n.º 3
0
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();
}
Exemplo n.º 4
0
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();
	}