X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d6d3b323020f6851f04b7111bb432ac0bbd63eb5..08670ea85abf4b4946a9ce64971b591d7b1ee30b:/src/osx/carbon/dialog.cpp?ds=sidebyside diff --git a/src/osx/carbon/dialog.cpp b/src/osx/carbon/dialog.cpp index 9924b54b06..42000d9a52 100644 --- a/src/osx/carbon/dialog.cpp +++ b/src/osx/carbon/dialog.cpp @@ -23,43 +23,19 @@ #include "wx/osx/private.h" #include "wx/evtloop.h" -extern wxList wxModalDialogs; - -void wxDialog::DoShowModal() +void wxDialog::EndWindowModal() { - wxCHECK_RET( !IsModal(), wxT("DoShowModal() called twice") ); - - wxModalDialogs.Append(this); - - 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(); + // Nothing to do for now. +} - EndAppModalStateForWindow(windowRef) ; - if ( resetGroupParent ) - { - SetWindowGroupParent( windowGroup , formerParentGroup ); - } +void wxDialog::DoShowWindowModal() +{ + // 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. + + m_modality = wxDIALOG_MODALITY_APP_MODAL; + ShowModal(); + SendWindowModalDialogEvent ( wxEVT_WINDOW_MODAL_DIALOG_CLOSED ); }