]> git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/colordlg.cpp
wxTextPos for all GetLastPosition with constants for special cases. Make it virtual...
[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 #ifdef __GNUG__
14 #pragma implementation "colordlg.h"
15 #endif
16
17 #include "wx/mac/colordlg.h"
18 #include "wx/fontdlg.h"
19
20
21 #if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
22
23 #if !USE_SHARED_LIBRARY
24 IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
25 #endif
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 else
68 {
69 return wxID_CANCEL;
70 }
71
72 return wxID_CANCEL;
73 }
74
75 #endif