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