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