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