X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/313901f3e5b6c2b91ba7040e5fe2ac67b0ffa9cb..f0a126fe7ad375110956325f8bdc3d3162f222c0:/src/msw/dialog.cpp diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index 44b80d4354..b7ccfaf0d6 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "dialog.h" #endif @@ -70,6 +70,13 @@ static wxWindowList wxModalDialogs; IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow) +/* + TODO PROPERTIES + + style (wxDEFAULT_DIALOG_STYLE) + centered (bool, false ) +*/ + BEGIN_EVENT_TABLE(wxDialog, wxDialogBase) EVT_BUTTON(wxID_OK, wxDialog::OnOK) EVT_BUTTON(wxID_APPLY, wxDialog::OnApply) @@ -191,7 +198,7 @@ bool wxDialog::IsModal() const bool wxDialog::IsModalShowing() const { - return wxModalDialogs.Find((wxDialog *)this) != NULL; // const_cast + return wxModalDialogs.Find(wxConstCast(this, wxDialog)) != NULL; } wxWindow *wxDialog::FindSuitableParent() const @@ -333,6 +340,10 @@ bool wxDialog::Show(bool show) // this will cause IsModalShowing() return FALSE and our local // message loop will terminate wxModalDialogs.DeleteObject(this); + + // 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); } }