1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/carbon/dialog.cpp
3 // Purpose: wxDialog class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
14 #include "wx/dialog.h"
20 #include "wx/settings.h"
23 #include "wx/osx/private.h"
24 #include "wx/evtloop.h"
26 void wxDialog::EndWindowModal()
28 // Nothing to do for now.
31 void wxDialog::DoShowWindowModal()
33 // If someone wants to add support for this to wxOSX Carbon, here would
34 // be the place to start: http://trac.wxwidgets.org/ticket/9459
35 // Unfortunately, supporting sheets in Carbon isn't as straightforward
36 // as with Cocoa, so it will probably take some tweaking.
37 wxDialogBase::ShowWindowModal();
40 void wxDialog::DoShowModal()
45 WindowRef windowRef
= (WindowRef
) GetWXWindow();
46 WindowGroupRef windowGroup
= NULL
;
47 WindowGroupRef formerParentGroup
= NULL
;
48 bool resetGroupParent
= false;
50 if ( GetParent() == NULL
)
52 windowGroup
= GetWindowGroup(windowRef
) ;
53 if ( windowGroup
!= GetWindowGroupOfClass( kMovableModalWindowClass
) )
55 formerParentGroup
= GetWindowGroupParent( windowGroup
);
56 SetWindowGroupParent( windowGroup
, GetWindowGroupOfClass( kMovableModalWindowClass
) );
57 resetGroupParent
= true;
60 BeginAppModalStateForWindow(windowRef
) ;
62 #if wxUSE_CONSOLE_EVENTLOOP
63 wxEventLoopGuarantor ensureHasLoop
;
65 wxEventLoopBase
* const loop
= wxEventLoop::GetActive();
69 EndAppModalStateForWindow(windowRef
) ;
70 if ( resetGroupParent
)
72 SetWindowGroupParent( windowGroup
, formerParentGroup
);