X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6991087b08355e652866e97d3a8211103864ed8f..437a8892a107139e9f808f0a11792a56a55b4e25:/src/motif/dialog.cpp diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp index 95abbae57c..3955a68d45 100644 --- a/src/motif/dialog.cpp +++ b/src/motif/dialog.cpp @@ -12,13 +12,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#ifdef __VMS -#define XtDisplay XTDISPLAY -#define XtWindow XTWINDOW -#define XtParent XTPARENT -#define XtScreen XTSCREEN -#endif - #include "wx/dialog.h" #ifndef WX_PRECOMP @@ -190,6 +183,9 @@ wxDialog::~wxDialog() { m_isBeingDeleted = true; + // if the dialog is modal, this will end its event loop + Show(false); + delete m_eventLoop; if (m_mainWidget) @@ -248,10 +244,16 @@ bool wxDialog::Show( bool show ) if( !wxWindowBase::Show( show ) ) return false; + if ( !show && IsModal() ) + EndModal(wxID_CANCEL); + m_isShown = show; if (show) { + if (CanDoLayoutAdaptation()) + DoLayoutAdaptation(); + // this usually will result in TransferDataToWindow() being called // which will change the controls values so do it before showing as // otherwise we could have some flicker