X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..8a82c9ecc9a2cba9727b538c818ebdba243eacbc:/src/msw/dialog.cpp?ds=sidebyside diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index 214bfb1dd4..b7ccfaf0d6 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -5,7 +5,7 @@ // Modified by: // Created: 01/02/97 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem +// Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -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,12 +340,21 @@ 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); } } return TRUE; } +void wxDialog::Raise() +{ + ::SetForegroundWindow(GetHwnd()); +} + // a special version for Show(TRUE) for modal dialogs which returns return code int wxDialog::ShowModal() {