]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/dialog.cpp
Update version to 2.9.4 in version.bkl too and rebake everything.
[wxWidgets.git] / src / osx / carbon / dialog.cpp
index ad1c94796507cad6d219deb651fd3a6b21cbc7b7..42000d9a52982d5e4c0aacf708e8ddf74e65d59d 100644 (file)
@@ -30,45 +30,12 @@ void wxDialog::EndWindowModal()
 
 void wxDialog::DoShowWindowModal()
 {
-    // If someone wants to add support for this to wxOSX Carbon, here would 
+    // If someone wants to add support for this to wxOSX Carbon, here would
     // be the place to start: http://trac.wxwidgets.org/ticket/9459
     // Unfortunately, supporting sheets in Carbon isn't as straightforward
     // as with Cocoa, so it will probably take some tweaking.
-    wxDialogBase::ShowWindowModal();
-}
-
-void wxDialog::DoShowModal()
-{
-
-    SetFocus() ;
-
-    WindowRef windowRef = (WindowRef) GetWXWindow();
-    WindowGroupRef windowGroup = NULL;
-    WindowGroupRef formerParentGroup = NULL;
-    bool resetGroupParent = false;
-
-    if ( GetParent() == NULL )
-    {
-        windowGroup = GetWindowGroup(windowRef) ;
-        if ( windowGroup != GetWindowGroupOfClass( kMovableModalWindowClass ) )
-        {
-            formerParentGroup = GetWindowGroupParent( windowGroup );
-            SetWindowGroupParent( windowGroup, GetWindowGroupOfClass( kMovableModalWindowClass ) );
-            resetGroupParent = true;
-        }
-    }
-    BeginAppModalStateForWindow(windowRef) ;
-
-#if wxUSE_CONSOLE_EVENTLOOP
-    wxEventLoopGuarantor ensureHasLoop;
-#endif
-    wxEventLoopBase * const loop = wxEventLoop::GetActive();
-    while ( IsModal() )
-        loop->Dispatch();
 
-    EndAppModalStateForWindow(windowRef) ;
-    if ( resetGroupParent )
-    {
-        SetWindowGroupParent( windowGroup , formerParentGroup );
-    }
+    m_modality = wxDIALOG_MODALITY_APP_MODAL;
+    ShowModal();
+    SendWindowModalDialogEvent ( wxEVT_WINDOW_MODAL_DIALOG_CLOSED  );
 }