]> git.saurik.com Git - wxWidgets.git/blame - src/osx/cocoa/dialog.mm
added support for wxCAL_SHOW_WEEK_NUMBERS to generic version of wxCalendarCtrl (...
[wxWidgets.git] / src / osx / cocoa / dialog.mm
CommitLineData
fb8dcb05
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/osx/cocoa/dialog.cpp
3// Purpose: wxDialog class
4// Author: Stefan Csomor
5// Modified by:
6// Created: 1998-01-01
7// RCS-ID: $Id: dialog.cpp 54820 2008-07-29 20:04:11Z SC $
8// Copyright: (c) Stefan Csomor
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#include "wx/wxprec.h"
13
14#include "wx/dialog.h"
15
16#ifndef WX_PRECOMP
17 #include "wx/app.h"
18 #include "wx/utils.h"
19 #include "wx/frame.h"
20 #include "wx/settings.h"
21#endif // WX_PRECOMP
22
23#include "wx/osx/private.h"
24
25extern wxList wxModalDialogs;
26
27void wxDialog::DoShowModal()
28{
dbeddfb9
SC
29 wxCHECK_RET( !IsModal(), wxT("DoShowModal() called twice") );
30
31 wxModalDialogs.Append(this);
fb8dcb05
SC
32
33 SetFocus() ;
34/*
35 WindowGroupRef windowGroup;
36 WindowGroupRef formerParentGroup;
37 bool resetGroupParent = false;
38
39 if ( GetParent() == NULL )
40 {
41 windowGroup = GetWindowGroup(windowRef) ;
42 formerParentGroup = GetWindowGroupParent( windowGroup );
43 SetWindowGroupParent( windowGroup, GetWindowGroupOfClass( kMovableModalWindowClass ) );
44 resetGroupParent = true;
45 }
46*/
fb8dcb05
SC
47 NSWindow* theWindow = GetWXWindow();
48
49 NSModalSession session = [NSApp beginModalSessionForWindow:theWindow];
50 while (IsModal())
51 {
dbeddfb9 52 wxMacAutoreleasePool autoreleasepool;
fb8dcb05
SC
53 if ([NSApp runModalSession:session] != NSRunContinuesResponse)
54 break;
55 // TODO should we do some idle processing ?
56 }
57 [NSApp endModalSession:session];
58
59/*
60 if ( resetGroupParent )
61 {
62 SetWindowGroupParent( windowGroup , formerParentGroup );
63 }
64*/
65}