X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b3ba1043299d50543aca2d4b9ca154f07402b841..66f75561893ea7b4bf429d1882d9cc0407ba932d:/src/osx/carbon/colordlgosx.mm diff --git a/src/osx/carbon/colordlgosx.mm b/src/osx/carbon/colordlgosx.mm index f1093c4391..0f75e74eef 100644 --- a/src/osx/carbon/colordlgosx.mm +++ b/src/osx/carbon/colordlgosx.mm @@ -32,21 +32,16 @@ IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog) -// Cocoa headers -#include "wx/cocoa/autorelease.h" -#include "wx/cocoa/string.h" +#include "wx/osx/private.h" -#import -#import -#import -#import -#import +#import +#import // --------------------------------------------------------------------------- // wxCPWCDelegate - Window Closed delegate // --------------------------------------------------------------------------- -@interface wxCPWCDelegate : NSObject +@interface wxCPWCDelegate : NSObject wxOSX_10_6_AND_LATER() { 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]]; @@ -146,6 +141,7 @@ int wxColourDialog::ShowModal() // // Start the color panel modal loop // + wxDialog::OSXBeginModalDialog(); NSModalSession session = [NSApp beginModalSessionForWindow:theColorPanel]; for (;;) { @@ -156,6 +152,7 @@ int wxColourDialog::ShowModal() break; } [NSApp endModalSession:session]; + wxDialog::OSXEndModalDialog(); //free up the memory for the delegates - we don't need them anymore [theColorPanel setDelegate:nil];