X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd04970ab45eb2f392af48b71aa9ecd5d4b1c8c2..a8d2fb31cbf09dcc4683c9566ff4bc89580f268c:/src/mac/carbon/dialog.cpp?ds=sidebyside diff --git a/src/mac/carbon/dialog.cpp b/src/mac/carbon/dialog.cpp index 830ab7f875..3e733e2f8d 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" @@ -60,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; @@ -91,7 +87,7 @@ wxDialog::~wxDialog() Show(FALSE); } -// By default, pressing escape cancels the dialog , on mac command-stop does the same thing +// By default, pressing escape cancels the dialog; on mac command-stop does the same thing void wxDialog::OnCharHook(wxKeyEvent& event) { if (( event.m_keyCode == WXK_ESCAPE || @@ -112,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; } @@ -135,7 +132,7 @@ bool wxDialog::Show(bool show) InitDialog(); } - if ( IsModal() ) + if ( m_isModalStyle ) { if ( show ) { @@ -189,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); } @@ -202,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