#endif
#include "wx/evtloop.h"
+#include "wx/modalhook.h"
//-----------------------------------------------------------------------------
// wxDialog
EVT_CLOSE (wxDialog::OnCloseWindow)
END_EVENT_TABLE()
-IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxTopLevelWindow)
-
void wxDialog::Init()
{
m_returnCode = 0;
s_closing.Append(this);
- wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
+ wxCommandEvent cancelEvent(wxEVT_BUTTON, wxID_CANCEL);
cancelEvent.SetEventObject(this);
GetEventHandler()->ProcessEvent(cancelEvent);
s_closing.DeleteObject(this);
// if we had disabled other app windows, reenable them back now because
// if they stay disabled Windows will activate another window (one
// which is enabled, anyhow) and we will lose activation
- if ( m_windowDisabler )
- {
- delete m_windowDisabler;
- m_windowDisabler = NULL;
- }
+ wxDELETE(m_windowDisabler);
if ( IsModal() )
EndModal(wxID_CANCEL);
int wxDialog::ShowModal()
{
+ WX_HOOK_MODAL_DIALOG();
+
if ( IsModal() )
{
wxFAIL_MSG( wxT("wxDialog:ShowModal called twice") );
wxASSERT_MSG( !m_windowDisabler, wxT("disabling windows twice?") );
-#if defined(__WXGTK__) || defined(__WXMGL__)
+#if defined(__WXGTK__)
wxBusyCursorSuspender suspender;
- // FIXME (FIXME_MGL) - make sure busy cursor disappears under MSW too
#endif
m_windowDisabler = new wxWindowDisabler(this);