]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/colordlgosx.mm
trying to simplify and optimize font handling
[wxWidgets.git] / src / osx / carbon / colordlgosx.mm
index f1093c4391e6c9f0fc1b519ff37164033644ee3d..067e5b413ce1eebdefab5e0f3dec4524c9f2a7c1 100644 (file)
 
 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
 // ---------------------------------------------------------------------------
 
-@interface wxCPWCDelegate : NSObject
+@interface wxCPWCDelegate : NSObject wxOSX_10_6_AND_LATER(<NSWindowDelegate>)
 {
     bool m_bIsClosed;
 }
@@ -112,10 +107,10 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
 
     if(m_colourData.GetColour().IsOk())
         [[NSColorPanel sharedColorPanel] setColor:
-            [NSColor colorWithCalibratedRed:m_colourData.GetColour().Red() / 255.0
-                                        green:m_colourData.GetColour().Green() / 255.0
-                                        blue:m_colourData.GetColour().Blue() / 255.0
-                                        alpha:1.0]
+            [NSColor colorWithCalibratedRed:(CGFloat) (m_colourData.GetColour().Red() / 255.0)
+                                        green:(CGFloat) (m_colourData.GetColour().Green() / 255.0)
+                                        blue:(CGFloat) (m_colourData.GetColour().Blue() / 255.0)
+                                        alpha:(CGFloat) 1.0]
         ];
     else
         [[NSColorPanel sharedColorPanel] setColor:[NSColor blackColor]];