X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d572a2cace8d11a10ecea598ff342c36ec007cf..2680ddc6787e05b9eb058091e252e28f925d533c:/src/osx/carbon/dialog.cpp diff --git a/src/osx/carbon/dialog.cpp b/src/osx/carbon/dialog.cpp index ad1c947965..20742be5e4 100644 --- a/src/osx/carbon/dialog.cpp +++ b/src/osx/carbon/dialog.cpp @@ -34,41 +34,8 @@ void wxDialog::DoShowWindowModal() // 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 ); }