]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/dialog.mm
cocoa specific implementations
[wxWidgets.git] / src / osx / cocoa / dialog.mm
diff --git a/src/osx/cocoa/dialog.mm b/src/osx/cocoa/dialog.mm
new file mode 100644 (file)
index 0000000..9d99165
--- /dev/null
@@ -0,0 +1,62 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/osx/cocoa/dialog.cpp
+// Purpose:     wxDialog class
+// Author:      Stefan Csomor
+// Modified by:
+// Created:     1998-01-01
+// RCS-ID:      $Id: dialog.cpp 54820 2008-07-29 20:04:11Z SC $
+// Copyright:   (c) Stefan Csomor
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#include "wx/wxprec.h"
+
+#include "wx/dialog.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+    #include "wx/utils.h"
+    #include "wx/frame.h"
+    #include "wx/settings.h"
+#endif // WX_PRECOMP
+
+#include "wx/osx/private.h"
+
+extern wxList wxModalDialogs;
+
+void wxDialog::DoShowModal()
+{
+
+    SetFocus() ;
+/*
+    WindowGroupRef windowGroup;
+    WindowGroupRef formerParentGroup;
+    bool resetGroupParent = false;
+
+    if ( GetParent() == NULL )
+    {
+        windowGroup = GetWindowGroup(windowRef) ;
+        formerParentGroup = GetWindowGroupParent( windowGroup );
+        SetWindowGroupParent( windowGroup, GetWindowGroupOfClass( kMovableModalWindowClass ) );
+        resetGroupParent = true;
+    }
+*/
+
+    NSWindow* theWindow = GetWXWindow();
+    
+    NSModalSession session = [NSApp beginModalSessionForWindow:theWindow];
+    while (IsModal()) 
+    {
+        if ([NSApp runModalSession:session] != NSRunContinuesResponse)
+            break;
+        // TODO should we do some idle processing ?
+    }
+    [NSApp endModalSession:session];
+
+/*
+    if ( resetGroupParent )
+    {
+        SetWindowGroupParent( windowGroup , formerParentGroup );
+    }
+*/
+}