/////////////////////////////////////////////////////////////////////////////
-// 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
#include "wx/wxprec.h"
-#include "wx/osx/colordlg.h"
+#include "wx/colordlg.h"
#include "wx/fontdlg.h"
// ============================================================================
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;
}
- (id)init
{
- [super init];
+ self = [super init];
m_bIsClosed = false;
return self;
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]];
//
// Start the color panel modal loop
//
+ wxDialog::OSXBeginModalDialog();
NSModalSession session = [NSApp beginModalSessionForWindow:theColorPanel];
for (;;)
{
break;
}
[NSApp endModalSession:session];
+ wxDialog::OSXEndModalDialog();
//free up the memory for the delegates - we don't need them anymore
[theColorPanel setDelegate:nil];