]> git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/colordlg.cpp
6c542fdcfb86924911d8141fc02344c146acc043
[wxWidgets.git] / src / mac / carbon / colordlg.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: colordlg.cpp
3 // Purpose: wxColourDialog class. NOTE: you can use the generic class
4 // if you wish, instead of implementing this.
5 // Author: Stefan Csomor
6 // Modified by:
7 // Created: 1998-01-01
8 // RCS-ID: $Id$
9 // Copyright: (c) Stefan Csomor
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
12
13 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
14 #pragma implementation "colordlg.h"
15 #endif
16
17 #include "wx/wxprec.h"
18
19 #include "wx/mac/colordlg.h"
20 #include "wx/fontdlg.h"
21
22
23 #if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
24
25 IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
26
27 #include "wx/mac/private.h"
28 #ifndef __DARWIN__
29 #include <ColorPicker.h>
30 #endif
31
32 /*
33 * wxColourDialog
34 */
35
36 wxColourDialog::wxColourDialog()
37 {
38 m_dialogParent = NULL;
39 }
40
41 wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
42 {
43 Create(parent, data);
44 }
45
46 bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
47 {
48 m_dialogParent = parent;
49
50 if (data)
51 m_colourData = *data;
52 return true;
53 }
54
55 int wxColourDialog::ShowModal()
56 {
57 Point where ;
58 RGBColor currentColor = *((RGBColor*)m_colourData.m_dataColour.GetPixel()) , newColor ;
59
60 where.h = where.v = -1;
61
62 if (GetColor( where, "\pSelect a new palette color.", &currentColor, &newColor ))
63 {
64 m_colourData.m_dataColour.Set( (WXCOLORREF*) &newColor ) ;
65 return wxID_OK;
66 }
67
68 return wxID_CANCEL;
69 }
70
71 #endif