]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/colordlgosx.mm
Add RunScript and implement on all backends. Document and add a very simple unit...
[wxWidgets.git] / src / osx / carbon / colordlgosx.mm
index df8e2263a6f634e9456e4be656ecb55ddb1f43b5..1fdc0bee31872ae2b35e49cdc7741b95f73c9b37 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        src/osx/carbon/colordlg.mm
+// Name:        src/osx/carbon/colordlgosx.mm
 // Purpose:     wxColourDialog class. NOTE: you can use the generic class
 //              if you wish, instead of implementing this.
 // Author:      Ryan Norton
 // Purpose:     wxColourDialog class. NOTE: you can use the generic class
 //              if you wish, instead of implementing this.
 // Author:      Ryan Norton
@@ -20,7 +20,7 @@
 
 #include "wx/wxprec.h"
 
 
 #include "wx/wxprec.h"
 
-#include "wx/osx/colordlg.h"
+#include "wx/colordlg.h"
 #include "wx/fontdlg.h"
 
 // ============================================================================
 #include "wx/fontdlg.h"
 
 // ============================================================================
 
 IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
 
 
 IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
 
-// Cocoa headers
-#include "wx/cocoa/autorelease.h"
-#include "wx/cocoa/string.h"
+#include "wx/osx/private.h"
 
 
-#import <AppKit/NSFont.h>
-#import <AppKit/NSFontManager.h>
-#import <AppKit/NSFontPanel.h>
-#import <AppKit/NSColor.h>
-#import <AppKit/NSColorPanel.h>
+#import <Foundation/Foundation.h>
+#import <AppKit/AppKit.h>
 
 // ---------------------------------------------------------------------------
 // wxCPWCDelegate - Window Closed delegate
 // ---------------------------------------------------------------------------
 
 
 // ---------------------------------------------------------------------------
 // wxCPWCDelegate - Window Closed delegate
 // ---------------------------------------------------------------------------
 
-@interface wxCPWCDelegate : NSObject
+@interface wxCPWCDelegate : NSObject wxOSX_10_6_AND_LATER(<NSWindowDelegate>)
 {
     bool m_bIsClosed;
 }
 {
     bool m_bIsClosed;
 }
@@ -146,6 +141,7 @@ int wxColourDialog::ShowModal()
             //
             // Start the color panel modal loop
             //
             //
             // Start the color panel modal loop
             //
+            wxDialog::OSXBeginModalDialog();
             NSModalSession session = [NSApp beginModalSessionForWindow:theColorPanel];
             for (;;)
             {
             NSModalSession session = [NSApp beginModalSessionForWindow:theColorPanel];
             for (;;)
             {
@@ -156,6 +152,7 @@ int wxColourDialog::ShowModal()
                     break;
             }
             [NSApp endModalSession:session];
                     break;
             }
             [NSApp endModalSession:session];
+            wxDialog::OSXEndModalDialog();
 
     //free up the memory for the delegates - we don't need them anymore
     [theColorPanel setDelegate:nil];
 
     //free up the memory for the delegates - we don't need them anymore
     [theColorPanel setDelegate:nil];