1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/cocoa/dialog.mm
3 // Purpose: wxDialog class
4 // Author: Stefan Csomor
7 // Copyright: (c) Stefan Csomor
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #include "wx/wxprec.h"
13 #include "wx/dialog.h"
19 #include "wx/settings.h"
22 #include "wx/osx/private.h"
24 extern wxList wxModalDialogs;
26 void wxDialog::DoShowWindowModal()
28 wxTopLevelWindow* parent = static_cast<wxTopLevelWindow*>(wxGetTopLevelParent(GetParent()));
30 wxASSERT_MSG(parent, "ShowWindowModal requires the dialog to have a parent.");
32 NSWindow* parentWindow = parent->GetWXWindow();
33 NSWindow* theWindow = GetWXWindow();
35 [NSApp beginSheet: theWindow
36 modalForWindow: parentWindow
37 modalDelegate: theWindow
42 void wxDialog::EndWindowModal()
44 [NSApp endSheet: GetWXWindow()];
45 [GetWXWindow() orderOut:GetWXWindow()];