1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/cocoa/dialog.cpp
3 // Purpose: wxDialog class
4 // Author: Stefan Csomor
7 // RCS-ID: $Id: dialog.cpp 54820 2008-07-29 20:04:11Z SC $
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"
25 extern wxList wxModalDialogs;
27 void wxDialog::DoShowWindowModal()
29 m_modality = wxDIALOG_MODALITY_APP_MODAL;
31 SendWindowModalDialogEvent ( wxEVT_WINDOW_MODAL_DIALOG_CLOSED );
34 void wxDialog::EndWindowModal()
38 void wxDialog::DoShowModal()
40 wxCHECK_RET( !IsModal(), wxT("DoShowModal() called twice") );
42 wxModalDialogs.Append(this);
46 WindowGroupRef windowGroup;
47 WindowGroupRef formerParentGroup;
48 bool resetGroupParent = false;
50 if ( GetParent() == NULL )
52 windowGroup = GetWindowGroup(windowRef) ;
53 formerParentGroup = GetWindowGroupParent( windowGroup );
54 SetWindowGroupParent( windowGroup, GetWindowGroupOfClass( kMovableModalWindowClass ) );
55 resetGroupParent = true;
60 if ( resetGroupParent )
62 SetWindowGroupParent( windowGroup , formerParentGroup );