]>
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 | ||
13 | #ifdef __GNUG__ | |
14 | #pragma implementation "colordlg.h" | |
15 | #endif | |
16 | ||
519cb848 | 17 | #include "wx/mac/colordlg.h" |
356c775f RN |
18 | #include "wx/fontdlg.h" |
19 | ||
20 | ||
21 | #if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX | |
e9576ca5 | 22 | |
2f1ae414 | 23 | #if !USE_SHARED_LIBRARY |
e9576ca5 | 24 | IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog) |
2f1ae414 | 25 | #endif |
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; | |
49 | ||
50 | if (data) | |
51 | m_colourData = *data; | |
52 | return TRUE; | |
53 | } | |
54 | ||
55 | int wxColourDialog::ShowModal() | |
56 | { | |
e40298d5 | 57 | Point where ; |
ae500232 | 58 | RGBColor currentColor = *((RGBColor*)m_colourData.m_dataColour.GetPixel()) , newColor ; |
e40298d5 JS |
59 | |
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 | } | |
67 | else | |
68 | { | |
69 | return wxID_CANCEL; | |
70 | } | |
e9576ca5 SC |
71 | |
72 | return wxID_CANCEL; | |
73 | } | |
74 | ||
356c775f | 75 | #endif |