]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
f6bcfd97 | 2 | // Name: wx/generic/colrdlgg.h |
c801d85f KB |
3 | // Purpose: wxGenericColourDialog |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef __COLORDLGH_G__ | |
13 | #define __COLORDLGH_G__ | |
14 | ||
af49c4b8 | 15 | #if defined(__GNUG__) && !defined(__APPLE__) |
c801d85f KB |
16 | #pragma interface "colrdlgg.h" |
17 | #endif | |
18 | ||
19 | #include "wx/setup.h" | |
20 | #include "wx/gdicmn.h" | |
21 | #include "wx/dialog.h" | |
22 | #include "wx/cmndata.h" | |
23 | ||
24 | #define wxID_ADD_CUSTOM 3000 | |
25 | #define wxID_RED_SLIDER 3001 | |
26 | #define wxID_GREEN_SLIDER 3002 | |
27 | #define wxID_BLUE_SLIDER 3003 | |
28 | ||
29 | class WXDLLEXPORT wxSlider; | |
f6bcfd97 | 30 | class WXDLLEXPORT wxGenericColourDialog : public wxDialog |
c801d85f | 31 | { |
f6bcfd97 BP |
32 | public: |
33 | wxGenericColourDialog(); | |
34 | wxGenericColourDialog(wxWindow *parent, | |
35 | wxColourData *data = (wxColourData *) NULL); | |
36 | virtual ~wxGenericColourDialog(); | |
c801d85f | 37 | |
f6bcfd97 | 38 | bool Create(wxWindow *parent, wxColourData *data = (wxColourData *) NULL); |
c801d85f | 39 | |
f6bcfd97 | 40 | wxColourData &GetColourData() { return colourData; } |
c801d85f | 41 | |
f6bcfd97 | 42 | virtual int ShowModal(); |
c801d85f | 43 | |
f6bcfd97 BP |
44 | // Internal functions |
45 | void OnMouseEvent(wxMouseEvent& event); | |
46 | void OnPaint(wxPaintEvent& event); | |
c801d85f | 47 | |
f6bcfd97 BP |
48 | virtual void CalculateMeasurements(); |
49 | virtual void CreateWidgets(); | |
50 | virtual void InitializeColours(); | |
c801d85f | 51 | |
f6bcfd97 BP |
52 | virtual void PaintBasicColours(wxDC& dc); |
53 | virtual void PaintCustomColours(wxDC& dc); | |
54 | virtual void PaintCustomColour(wxDC& dc); | |
55 | virtual void PaintHighlight(wxDC& dc, bool draw); | |
c801d85f | 56 | |
f6bcfd97 BP |
57 | virtual void OnBasicColourClick(int which); |
58 | virtual void OnCustomColourClick(int which); | |
c801d85f | 59 | |
f6bcfd97 | 60 | void OnAddCustom(wxCommandEvent& event); |
c801d85f | 61 | |
f6bcfd97 BP |
62 | void OnRedSlider(wxCommandEvent& event); |
63 | void OnGreenSlider(wxCommandEvent& event); | |
64 | void OnBlueSlider(wxCommandEvent& event); | |
c801d85f | 65 | |
f6bcfd97 | 66 | void OnCloseWindow(wxCloseEvent& event); |
c801d85f | 67 | |
f6bcfd97 BP |
68 | protected: |
69 | wxColourData colourData; | |
70 | wxWindow *dialogParent; | |
c801d85f | 71 | |
f6bcfd97 BP |
72 | // Area reserved for grids of colours |
73 | wxRect standardColoursRect; | |
74 | wxRect customColoursRect; | |
75 | wxRect singleCustomColourRect; | |
c801d85f | 76 | |
f6bcfd97 BP |
77 | // Size of each colour rectangle |
78 | wxPoint smallRectangleSize; | |
c801d85f | 79 | |
f6bcfd97 BP |
80 | // For single customizable colour |
81 | wxPoint customRectangleSize; | |
c801d85f | 82 | |
f6bcfd97 BP |
83 | // Grid spacing (between rectangles) |
84 | int gridSpacing; | |
c801d85f | 85 | |
f6bcfd97 BP |
86 | // Section spacing (between left and right halves of dialog box) |
87 | int sectionSpacing; | |
c801d85f | 88 | |
f6bcfd97 BP |
89 | // 48 'standard' colours |
90 | wxColour standardColours[48]; | |
c801d85f | 91 | |
f6bcfd97 BP |
92 | // 16 'custom' colours |
93 | wxColour customColours[16]; | |
c801d85f | 94 | |
f6bcfd97 BP |
95 | // One single custom colour (use sliders) |
96 | wxColour singleCustomColour; | |
c801d85f | 97 | |
f6bcfd97 BP |
98 | // Which colour is selected? An index into one of the two areas. |
99 | int colourSelection; | |
100 | int whichKind; // 1 for standard colours, 2 for custom colours, | |
c801d85f | 101 | |
f6bcfd97 BP |
102 | wxSlider *redSlider; |
103 | wxSlider *greenSlider; | |
104 | wxSlider *blueSlider; | |
e3065973 | 105 | |
f6bcfd97 BP |
106 | int buttonY; |
107 | ||
108 | int okButtonX; | |
109 | int customButtonX; | |
110 | ||
111 | // static bool colourDialogCancelled; | |
112 | ||
113 | DECLARE_EVENT_TABLE() | |
114 | DECLARE_DYNAMIC_CLASS(wxGenericColourDialog) | |
c801d85f KB |
115 | }; |
116 | ||
cd34332f | 117 | /* This shouldn't be necessary, we have a #define in wx/colordlg.h. |
2049ba38 | 118 | #ifdef __WXGTK__ |
c801d85f | 119 | typedef wxGenericColourDialog wxColourDialog; |
ef77f91e | 120 | #endif |
cd34332f | 121 | */ |
c801d85f KB |
122 | |
123 | #endif |