]>
Commit | Line | Data |
---|---|---|
2646f485 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. | |
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 | ||
19 | #if !USE_SHARED_LIBRARY | |
20 | IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog) | |
21 | #endif | |
22 | ||
23 | #include "wx/mac/private.h" | |
24 | #ifndef __DARWIN__ | |
25 | #include <ColorPicker.h> | |
26 | #endif | |
27 | ||
28 | /* | |
29 | * wxColourDialog | |
30 | */ | |
31 | ||
32 | wxColourDialog::wxColourDialog() | |
33 | { | |
34 | m_dialogParent = NULL; | |
35 | } | |
36 | ||
37 | wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data) | |
38 | { | |
39 | Create(parent, data); | |
40 | } | |
41 | ||
42 | bool wxColourDialog::Create(wxWindow *parent, wxColourData *data) | |
43 | { | |
44 | m_dialogParent = parent; | |
45 | ||
46 | if (data) | |
47 | m_colourData = *data; | |
48 | return TRUE; | |
49 | } | |
50 | ||
51 | int wxColourDialog::ShowModal() | |
52 | { | |
53 | Point where ; | |
54 | RGBColor currentColor = *((RGBColor*)m_colourData.m_dataColour.GetPixel()) , newColor ; | |
55 | ||
56 | where.h = where.v = -1; | |
57 | ||
58 | if (GetColor( where, "\pSelect a new palette color.", ¤tColor, &newColor )) | |
59 | { | |
60 | m_colourData.m_dataColour.Set( (WXCOLORREF*) &newColor ) ; | |
61 | return wxID_OK; | |
62 | } | |
63 | else | |
64 | { | |
65 | return wxID_CANCEL; | |
66 | } | |
67 | ||
68 | return wxID_CANCEL; | |
69 | } | |
70 |