1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/cocoa/dialog.mm
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"
25 extern wxList wxModalDialogs;
27 void wxDialog::DoShowWindowModal()
29 wxTopLevelWindow* parent = static_cast<wxTopLevelWindow*>(wxGetTopLevelParent(GetParent()));
31 wxASSERT_MSG(parent, "ShowWindowModal requires the dialog to have a parent.");
33 NSWindow* parentWindow = parent->GetWXWindow();
34 NSWindow* theWindow = GetWXWindow();
36 [NSApp beginSheet: theWindow
37 modalForWindow: parentWindow
38 modalDelegate: theWindow
43 void wxDialog::EndWindowModal()
45 [NSApp endSheet: GetWXWindow()];
46 [GetWXWindow() orderOut:GetWXWindow()];