X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6239ee05567eac71754f56c2a154222d10b57ff1..6cef0db28018fd2644ee4e38af715872e5242459:/src/mac/carbon/dialog.cpp?ds=sidebyside diff --git a/src/mac/carbon/dialog.cpp b/src/mac/carbon/dialog.cpp index aa23b77e34..bb90e3812b 100644 --- a/src/mac/carbon/dialog.cpp +++ b/src/mac/carbon/dialog.cpp @@ -64,9 +64,7 @@ void wxDialog::SetModal( bool flag ) wxModelessWindows.DeleteObject( this ); -#if TARGET_CARBON SetWindowModality( (WindowRef)MacGetWindowRef(), kWindowModalityAppModal, NULL ) ; -#endif } else { @@ -79,6 +77,8 @@ void wxDialog::SetModal( bool flag ) wxDialog::~wxDialog() { m_isBeingDeleted = true; + + // if the dialog is modal, this will end its event loop Show(false); } @@ -105,6 +105,9 @@ bool wxDialog::Show(bool show) // nothing to do return false; + if (show && CanDoLayoutAdaptation()) + DoLayoutAdaptation(); + if ( show ) // usually will result in TransferDataToWindow() being called InitDialog(); @@ -128,10 +131,6 @@ bool wxDialog::Show(bool show) return true; } -#if !TARGET_CARBON -extern bool s_macIsInModalLoop ; -#endif - void wxDialog::DoShowModal() { wxCHECK_RET( !IsModal(), wxT("DoShowModal() called twice") );