]> git.saurik.com Git - wxWidgets.git/blob - src/mac/classic/colordlg.cpp
made wx-config work in place on systems where /bin/sh is a Bourne shell (such as...
[wxWidgets.git] / src / mac / classic / 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 #ifdef __GNUG__
14 #pragma implementation "colordlg.h"
15 #endif
16
17 #include "wx/mac/colordlg.h"
18
19 IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
20
21 #include "wx/mac/private.h"
22 #ifndef __DARWIN__
23 #include <ColorPicker.h>
24 #endif
25
26 /*
27 * wxColourDialog
28 */
29
30 wxColourDialog::wxColourDialog()
31 {
32 m_dialogParent = NULL;
33 }
34
35 wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
36 {
37 Create(parent, data);
38 }
39
40 bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
41 {
42 m_dialogParent = parent;
43
44 if (data)
45 m_colourData = *data;
46 return TRUE;
47 }
48
49 int wxColourDialog::ShowModal()
50 {
51 Point where ;
52 RGBColor currentColor = *((RGBColor*)m_colourData.m_dataColour.GetPixel()) , newColor ;
53
54 where.h = where.v = -1;
55
56 if (GetColor( where, "\pSelect a new palette color.", &currentColor, &newColor ))
57 {
58 m_colourData.m_dataColour.Set( (WXCOLORREF*) &newColor ) ;
59 return wxID_OK;
60 }
61 else
62 {
63 return wxID_CANCEL;
64 }
65
66 return wxID_CANCEL;
67 }
68