X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ce00f59b5b169752d2f05ce3bb1a88ddc1b38b4c..cc4d5638c66a409e421420ed7110917755a66788:/src/osx/dialog_osx.cpp?ds=sidebyside diff --git a/src/osx/dialog_osx.cpp b/src/osx/dialog_osx.cpp index 05da19bcc8..fe870deaed 100644 --- a/src/osx/dialog_osx.cpp +++ b/src/osx/dialog_osx.cpp @@ -4,7 +4,6 @@ // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -13,6 +12,7 @@ #include "wx/dialog.h" #include "wx/evtloop.h" +#include "wx/modalhook.h" #ifndef WX_PRECOMP #include "wx/app.h" @@ -40,9 +40,6 @@ void wxDialog::OSXEndModalDialog() s_openDialogs--; } - -IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow) - void wxDialog::Init() { m_modality = wxDIALOG_MODALITY_NONE; @@ -83,7 +80,7 @@ wxDialog::~wxDialog() // about it bool wxDialog::IsEscapeKey(const wxKeyEvent& event) { - if ( event.GetKeyCode() == '.' && event.GetModifiers() == wxMOD_CMD ) + if ( event.GetKeyCode() == '.' && event.GetModifiers() == wxMOD_CONTROL ) return true; return wxDialogBase::IsEscapeKey(event); @@ -118,7 +115,12 @@ bool wxDialog::Show(bool show) if ( !show ) { - switch( m_modality ) + const int modalityOrig = m_modality; + + // complete the 'hiding' before we send the event + m_modality = wxDIALOG_MODALITY_NONE; + + switch ( modalityOrig ) { case wxDIALOG_MODALITY_WINDOW_MODAL: EndWindowModal(); // OS X implementation method for cleanup @@ -127,7 +129,6 @@ bool wxDialog::Show(bool show) default: break; } - m_modality = wxDIALOG_MODALITY_NONE; } return true; @@ -136,6 +137,8 @@ bool wxDialog::Show(bool show) // Replacement for Show(true) for modal dialogs - returns return code int wxDialog::ShowModal() { + WX_HOOK_MODAL_DIALOG(); + m_modality = wxDIALOG_MODALITY_APP_MODAL; Show();