X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/edccf4281bc8fbb9d8151240ba5b208339c9ac11..342751763793b5cdad252d731aac0618d0674e5b:/src/msw/dialog.cpp diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index dde02e52a8..2820cfaa33 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -46,7 +46,6 @@ wxWindowList wxModalDialogs; wxWindowList wxModelessWindows; // Frames and modeless dialogs extern wxList WXDLLEXPORT wxPendingDelete; -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxPanel) BEGIN_EVENT_TABLE(wxDialog, wxPanel) @@ -58,7 +57,6 @@ extern wxList WXDLLEXPORT wxPendingDelete; EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged) EVT_CLOSE(wxDialog::OnCloseWindow) END_EVENT_TABLE() -#endif wxDialog::wxDialog() { @@ -123,12 +121,12 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id, // resizeable or not (but a resizeable dialog always has caption - // otherwise it would look too strange) const wxChar *dlg; - if ( style & wxTHICK_FRAME ) - dlg = _T("wxResizeableDialog"); + if ( style & wxRESIZE_BORDER ) + dlg = wxT("wxResizeableDialog"); else if ( style & wxCAPTION ) - dlg = _T("wxCaptionDialog"); + dlg = wxT("wxCaptionDialog"); else - dlg = _T("wxNoCaptionDialog"); + dlg = wxT("wxNoCaptionDialog"); MSWCreate(m_windowId, parent, NULL, this, NULL, x, y, width, height, 0, // style is not used if we have dlg template @@ -215,6 +213,9 @@ void wxDialog::OnCharHook(wxKeyEvent& event) cancelEvent.SetEventObject( this ); GetEventHandler()->ProcessEvent(cancelEvent); + // ensure that there is another message for this window so the + // ShowModal loop will exit and won't get stuck in GetMessage(). + ::PostMessage(GetHwnd(), WM_NULL, 0, 0); return; } } @@ -281,6 +282,11 @@ bool wxDialog::IsShown() const return m_isShown; } +bool wxDialog::IsModal() const +{ + return wxModalDialogs.Find((wxDialog *)this) != 0; // const_cast +} + bool wxDialog::Show(bool show) { m_isShown = show; @@ -469,7 +475,9 @@ bool wxDialog::Show(bool show) if (hWndParent) ::BringWindowToTop(hWndParent); } - ShowWindow((HWND) GetHWND(), SW_HIDE); + + if ( m_hWnd ) + ShowWindow((HWND) GetHWND(), SW_HIDE); } } return TRUE;