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