return wxModalDialogs.Find((wxDialog *)this) != NULL; // const_cast
}
-extern bool s_macIsInModalLoop ;
-
bool wxDialog::Show(bool show)
{
if ( !wxDialogBase::Show(show) )
return TRUE;
}
+#if !TARGET_CARBON
+extern bool s_macIsInModalLoop ;
+#endif
+
void wxDialog::DoShowModal()
{
wxCHECK_RET( !IsModalShowing(), _T("DoShowModal() called twice") );
{
winFocus = wxTheApp->GetTopWindow();
}
+#if TARGET_CARBON
+ BeginAppModalStateForWindow( (WindowRef) MacGetWindowRef()) ;
+#else
// TODO : test whether parent gets disabled
-
bool formerModal = s_macIsInModalLoop ;
s_macIsInModalLoop = true ;
-
+#endif
while ( IsModalShowing() )
{
- while ( !wxTheApp->Pending() && wxTheApp->ProcessIdle() )
- {
- }
wxTheApp->MacDoOneEvent() ;
+ // calls process idle itself
}
+#if TARGET_CARBON
+ EndAppModalStateForWindow( (WindowRef) MacGetWindowRef() ) ;
+#else
+ // TODO probably reenable the parent window if any
s_macIsInModalLoop = formerModal ;
+#endif
- // TODO probably reenable the parent window if any
// and restore focus
if ( winFocus )