#include "wx/dialog.h"
#include "wx/evtloop.h"
+#include "wx/modalhook.h"
#ifndef WX_PRECOMP
#include "wx/app.h"
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
default:
break;
}
- m_modality = wxDIALOG_MODALITY_NONE;
}
return true;
// Replacement for Show(true) for modal dialogs - returns return code
int wxDialog::ShowModal()
{
+ WX_HOOK_MODAL_DIALOG();
+
m_modality = wxDIALOG_MODALITY_APP_MODAL;
Show();