X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3d1a4878f36ba4b5f66c2ccfd2cb27a9dc528b6f..41ab357ed9b661d9bbc55c841420b323237dbc15:/src/mac/carbon/dialog.cpp diff --git a/src/mac/carbon/dialog.cpp b/src/mac/carbon/dialog.cpp index 832ff9bc39..4f037becd7 100644 --- a/src/mac/carbon/dialog.cpp +++ b/src/mac/carbon/dialog.cpp @@ -9,10 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "dialog.h" -#endif - #include "wx/wxprec.h" #include "wx/dialog.h" @@ -29,7 +25,6 @@ wxList wxModalDialogs; //wxList wxModelessWindows; // Frames and modeless dialogs extern wxList wxPendingDelete; -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow) BEGIN_EVENT_TABLE(wxDialog, wxDialogBase) @@ -44,8 +39,6 @@ BEGIN_EVENT_TABLE(wxDialog, wxDialogBase) EVT_CLOSE(wxDialog::OnCloseWindow) END_EVENT_TABLE() -#endif - void wxDialog::Init() { m_isModalStyle = false; @@ -63,7 +56,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id, // All dialogs should really have this style style |= wxTAB_TRAVERSAL; - if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style & ~(wxYES|wxOK|wxNO|wxCANCEL) , name) ) + if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style & ~(wxYES|wxOK|wxNO /*|wxCANCEL*/) , name) ) return FALSE; return TRUE; @@ -115,7 +108,8 @@ void wxDialog::OnCharHook(wxKeyEvent& event) bool wxDialog::IsModal() const { - return m_isModalStyle; + return wxModalDialogs.Find((wxDialog *)this) != NULL; // const_cast + // return m_isModalStyle; } @@ -138,7 +132,7 @@ bool wxDialog::Show(bool show) InitDialog(); } - if ( IsModal() ) + if ( m_isModalStyle ) { if ( show ) { @@ -192,7 +186,7 @@ void wxDialog::DoShowModal() // Replacement for Show(TRUE) for modal dialogs - returns return code int wxDialog::ShowModal() { - if ( !IsModal() ) + if ( !m_isModalStyle ) { SetModal(TRUE); } @@ -205,8 +199,9 @@ int wxDialog::ShowModal() // dialogs and should work for both of them void wxDialog::EndModal(int retCode) { - SetReturnCode(retCode); - Show(FALSE); + SetReturnCode(retCode); + Show(FALSE); + SetModal(false); } // Standard buttons