]> git.saurik.com Git - wxWidgets.git/blob - src/mac/colordlg.cpp
added generic color dialog to setup
[wxWidgets.git] / src / mac / 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: AUTHOR
6 // Modified by:
7 // Created: ??/??/98
8 // RCS-ID: $Id$
9 // Copyright: (c) AUTHOR
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 #if !USE_SHARED_LIBRARY
20 IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
21 #endif
22
23 /*
24 * wxColourDialog
25 */
26
27 wxColourDialog::wxColourDialog()
28 {
29 m_dialogParent = NULL;
30 }
31
32 wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
33 {
34 Create(parent, data);
35 }
36
37 bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
38 {
39 m_dialogParent = parent;
40
41 if (data)
42 m_colourData = *data;
43 return TRUE;
44 }
45
46 int wxColourDialog::ShowModal()
47 {
48 Point where ;
49 RGBColor currentColor = m_colourData.dataColour.GetPixel() , newColor ;
50
51 where.h = where.v = -1;
52
53 if (GetColor( where, "\pSelect a new palette color.", &currentColor, &newColor ))
54 {
55 m_colourData.dataColour.Set( newColor ) ;
56 return wxID_OK;
57 }
58 else
59 {
60 return wxID_CANCEL;
61 }
62
63 return wxID_CANCEL;
64 }
65