]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/colordlg.cpp
avoid setting initial position if it was not specified, broken in r70734
[wxWidgets.git] / src / osx / carbon / colordlg.cpp
index 4a226c357acd92e141690270a13d524c2a825afa..191286f6b169ad61f068ed2740281143ade460e2 100644 (file)
@@ -1,19 +1,19 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        colordlg.cpp
+// Name:        src/osx/carbon/colordlg.cpp
 // Purpose:     wxColourDialog class. NOTE: you can use the generic class
 //              if you wish, instead of implementing this.
 // Author:      Stefan Csomor
 // Modified by:
 // Created:     1998-01-01
-// RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
 // Licence:       wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
 
-#include "wx/osx/colordlg.h"
+#include "wx/colordlg.h"
 #include "wx/fontdlg.h"
+#include "wx/modalhook.h"
 
 
 #if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
@@ -47,19 +47,23 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
 
 int wxColourDialog::ShowModal()
 {
+    WX_HOOK_MODAL_DIALOG();
+
     RGBColor currentColor ;
-    
+
     m_colourData.m_dataColour.GetRGBColor( &currentColor );
     NColorPickerInfo info;
     OSStatus err ;
     memset(&info, 0, sizeof(info)) ;
     // TODO : use parent to determine better position and then kAtSpecifiedOrigin
-    info.placeWhere = kCenterOnMainScreen ; 
+    info.placeWhere = kCenterOnMainScreen ;
     info.flags = kColorPickerDialogIsMoveable | kColorPickerDialogIsModal ;
     info.theColor.color.rgb.red =  currentColor.red ;
     info.theColor.color.rgb.green =  currentColor.green ;
     info.theColor.color.rgb.blue =  currentColor.blue ;
+    wxDialog::OSXBeginModalDialog();
     err = NPickColor(&info);
+    wxDialog::OSXEndModalDialog();
     if ((err == noErr) && info.newColorChosen)
     {
         currentColor.red = info.theColor.color.rgb.red ;