X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6239ee05567eac71754f56c2a154222d10b57ff1..43a302f200f1e9f5f21380bbc7ba74ad8c22d6d6:/src/mac/carbon/dialog.cpp?ds=sidebyside diff --git a/src/mac/carbon/dialog.cpp b/src/mac/carbon/dialog.cpp index aa23b77e34..8743e10547 100644 --- a/src/mac/carbon/dialog.cpp +++ b/src/mac/carbon/dialog.cpp @@ -62,23 +62,19 @@ void wxDialog::SetModal( bool flag ) { m_isModalStyle = true; - wxModelessWindows.DeleteObject( this ); - -#if TARGET_CARBON SetWindowModality( (WindowRef)MacGetWindowRef(), kWindowModalityAppModal, NULL ) ; -#endif } else { m_isModalStyle = false; - - wxModelessWindows.Append( this ); } } wxDialog::~wxDialog() { m_isBeingDeleted = true; + + // if the dialog is modal, this will end its event loop Show(false); } @@ -105,6 +101,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 +127,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") );