X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/64c11164f0a9ed48a69d0ef3f77ae03e11671394..e86f2cc84aabc8a58b1984c1ed7fb9475f6abe67:/src/gtk/dialog.cpp diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index fe9a0036c2..c70813d557 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -66,13 +66,26 @@ bool wxDialog::Show( bool show ) 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; @@ -136,7 +149,7 @@ void wxDialog::EndModal( int retCode ) if (!IsModal()) { - wxFAIL_MSG( wxT("wxDialog:EndModal called twice") ); + wxFAIL_MSG( "either wxDialog:EndModal called twice or ShowModal wasn't called" ); return; }