]>
Commit | Line | Data |
---|---|---|
fb8dcb05 | 1 | ///////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: src/osx/cocoa/dialog.mm |
fb8dcb05 SC |
3 | // Purpose: wxDialog class |
4 | // Author: Stefan Csomor | |
5 | // Modified by: | |
6 | // Created: 1998-01-01 | |
fb8dcb05 SC |
7 | // Copyright: (c) Stefan Csomor |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #include "wx/wxprec.h" | |
12 | ||
13 | #include "wx/dialog.h" | |
14 | ||
15 | #ifndef WX_PRECOMP | |
16 | #include "wx/app.h" | |
17 | #include "wx/utils.h" | |
18 | #include "wx/frame.h" | |
19 | #include "wx/settings.h" | |
20 | #endif // WX_PRECOMP | |
21 | ||
22 | #include "wx/osx/private.h" | |
23 | ||
24 | extern wxList wxModalDialogs; | |
25 | ||
4d572a2c | 26 | void wxDialog::DoShowWindowModal() |
9482c644 KO |
27 | { |
28 | wxTopLevelWindow* parent = static_cast<wxTopLevelWindow*>(wxGetTopLevelParent(GetParent())); | |
29 | ||
30 | wxASSERT_MSG(parent, "ShowWindowModal requires the dialog to have a parent."); | |
31 | ||
32 | NSWindow* parentWindow = parent->GetWXWindow(); | |
33 | NSWindow* theWindow = GetWXWindow(); | |
f44af1dc | 34 | |
9482c644 KO |
35 | [NSApp beginSheet: theWindow |
36 | modalForWindow: parentWindow | |
37 | modalDelegate: theWindow | |
38 | didEndSelector: nil | |
39 | contextInfo: nil]; | |
40 | } | |
41 | ||
42 | void wxDialog::EndWindowModal() | |
43 | { | |
44 | [NSApp endSheet: GetWXWindow()]; | |
779a4d41 | 45 | [GetWXWindow() orderOut:GetWXWindow()]; |
9482c644 | 46 | } |