]>
Commit | Line | Data |
---|---|---|
e9576ca5 SC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: colordlg.cpp | |
3 | // Purpose: wxColourDialog class. NOTE: you can use the generic class | |
4 | // if you wish, instead of implementing this. | |
a31a5f85 | 5 | // Author: Stefan Csomor |
e9576ca5 | 6 | // Modified by: |
a31a5f85 | 7 | // Created: 1998-01-01 |
e9576ca5 | 8 | // RCS-ID: $Id$ |
a31a5f85 | 9 | // Copyright: (c) Stefan Csomor |
65571936 | 10 | // Licence: wxWindows licence |
e9576ca5 SC |
11 | ///////////////////////////////////////////////////////////////////////////// |
12 | ||
a8e9860d | 13 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
e9576ca5 SC |
14 | #pragma implementation "colordlg.h" |
15 | #endif | |
16 | ||
a8e9860d SC |
17 | #include "wx/wxprec.h" |
18 | ||
519cb848 | 19 | #include "wx/mac/colordlg.h" |
356c775f RN |
20 | #include "wx/fontdlg.h" |
21 | ||
22 | ||
23 | #if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX | |
e9576ca5 | 24 | |
e9576ca5 | 25 | IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog) |
e9576ca5 | 26 | |
76a5e5d2 | 27 | #include "wx/mac/private.h" |
66a09d47 SC |
28 | #ifndef __DARWIN__ |
29 | #include <ColorPicker.h> | |
30 | #endif | |
76a5e5d2 | 31 | |
e9576ca5 SC |
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; | |
902725ee | 49 | |
e9576ca5 SC |
50 | if (data) |
51 | m_colourData = *data; | |
902725ee | 52 | return true; |
e9576ca5 SC |
53 | } |
54 | ||
55 | int wxColourDialog::ShowModal() | |
56 | { | |
e40298d5 | 57 | Point where ; |
ae500232 | 58 | RGBColor currentColor = *((RGBColor*)m_colourData.m_dataColour.GetPixel()) , newColor ; |
902725ee | 59 | |
e40298d5 | 60 | where.h = where.v = -1; |
519cb848 | 61 | |
e40298d5 JS |
62 | if (GetColor( where, "\pSelect a new palette color.", ¤tColor, &newColor )) |
63 | { | |
ae500232 | 64 | m_colourData.m_dataColour.Set( (WXCOLORREF*) &newColor ) ; |
e40298d5 JS |
65 | return wxID_OK; |
66 | } | |
e9576ca5 SC |
67 | |
68 | return wxID_CANCEL; | |
69 | } | |
70 | ||
356c775f | 71 | #endif |