EndModal( wxID_CANCEL );
}
- bool ret = wxWindow::Show( show );
+ if (show && CanDoLayoutAdaptation())
+ DoLayoutAdaptation();
- if (show) InitDialog();
+ bool ret = wxDialogBase::Show(show);
+
+ if (show)
+ InitDialog();
return ret;
}
+wxDialog::~wxDialog()
+{
+ m_isBeingDeleted = true;
+
+ // if the dialog is modal, this will end its event loop
+ if ( IsModal() )
+ EndModal(wxID_CANCEL);
+}
+
bool wxDialog::IsModal() const
{
return m_modalShowing;
if (!IsModal())
{
- wxFAIL_MSG( wxT("wxDialog:EndModal called twice") );
+ wxFAIL_MSG( "either wxDialog:EndModal called twice or ShowModal wasn't called" );
return;
}