X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d491523b1f5aef1081306d7e3002eb63b91c5cc9..1978421a6d8b81c1f8a961da4b8ddf544fec7b1b:/src/os2/dialog.cpp diff --git a/src/os2/dialog.cpp b/src/os2/dialog.cpp index 63f5abfe25..1ab046a28e 100644 --- a/src/os2/dialog.cpp +++ b/src/os2/dialog.cpp @@ -93,6 +93,12 @@ bool wxDialog::Create( )) return FALSE; SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); + + // + // Must defer setting the title until after dialog is created and sized + // + if (!rsTitle.IsNull()) + SetTitle(rsTitle); return TRUE; } // end of wxDialog::Create @@ -194,7 +200,20 @@ void wxDialog::DoShowModal() // wxASSERT_MSG(!m_pWindowDisabler, _T("disabling windows twice?")); - m_pWindowDisabler = new wxWindowDisabler(this); + // + // Disables other app windows and window proc message processing + // until WinDismissDlg called + // + ::WinProcessDlg((HWND)GetHwnd()); + + // + // Before entering the modal loop, reset the "is in OnIdle()" flag (see + // comment in app.cpp) + // + extern bool gbInOnIdle; + bool bWasInOnIdle = gbInOnIdle; + + gbInOnIdle = FALSE; // // Enter the modal loop @@ -211,6 +230,7 @@ void wxDialog::DoShowModal() // a message came or no more idle processing to do wxTheApp->DoMessage(); } + gbInOnIdle = bWasInOnIdle; // // Snd restore focus @@ -237,7 +257,8 @@ bool wxDialog::Show( // // If we had disabled other app windows, reenable them back now because // if they stay disabled Windows will activate another window (one - // which is enabled, anyhow) and we will lose activation + // which is enabled, anyhow) and we will lose activation. We really don't + // do this in OS/2 since PM does this for us. // if (m_pWindowDisabler) { @@ -265,6 +286,8 @@ bool wxDialog::Show( InitDialog(); } + if (GetTitle().c_str()) + ::WinSetWindowText((HWND)GetHwnd(), GetTitle().c_str()); if (IsModal()) { if (bShow) @@ -318,6 +341,7 @@ void wxDialog::EndModal( { SetReturnCode(nRetCode); Show(FALSE); + ::WinDismissDlg((HWND)GetHwnd(), nRetCode); } // end of wxDialog::EndModal // ----------------------------------------------------------------------------