]>
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 | ||
b73e73f9 | 15 | #include "wx/defs.h" |
c801d85f KB |
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 | ||
b5dbe15d | 28 | class WXDLLIMPEXP_FWD_CORE wxSlider; |
6bb44116 WS |
29 | |
30 | #endif // wxUSE_SLIDER | |
31 | ||
53a2db12 | 32 | class WXDLLIMPEXP_CORE 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 | |
66c59e2c | 42 | wxColourData &GetColourData() { return m_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 | 72 | protected: |
66c59e2c | 73 | wxColourData m_colourData; |
c801d85f | 74 | |
f6bcfd97 | 75 | // Area reserved for grids of colours |
66c59e2c VZ |
76 | wxRect m_standardColoursRect; |
77 | wxRect m_customColoursRect; | |
78 | wxRect m_singleCustomColourRect; | |
c801d85f | 79 | |
f6bcfd97 | 80 | // Size of each colour rectangle |
66c59e2c | 81 | wxPoint m_smallRectangleSize; |
c801d85f | 82 | |
f6bcfd97 | 83 | // For single customizable colour |
66c59e2c | 84 | wxPoint m_customRectangleSize; |
c801d85f | 85 | |
f6bcfd97 | 86 | // Grid spacing (between rectangles) |
66c59e2c | 87 | int m_gridSpacing; |
c801d85f | 88 | |
f6bcfd97 | 89 | // Section spacing (between left and right halves of dialog box) |
66c59e2c | 90 | int m_sectionSpacing; |
c801d85f | 91 | |
f6bcfd97 | 92 | // 48 'standard' colours |
66c59e2c | 93 | wxColour m_standardColours[48]; |
c801d85f | 94 | |
f6bcfd97 | 95 | // 16 'custom' colours |
66c59e2c | 96 | wxColour m_customColours[16]; |
c801d85f | 97 | |
f6bcfd97 | 98 | // Which colour is selected? An index into one of the two areas. |
66c59e2c VZ |
99 | int m_colourSelection; |
100 | int m_whichKind; // 1 for standard colours, 2 for custom colours, | |
c801d85f | 101 | |
6bb44116 | 102 | #if wxUSE_SLIDER |
66c59e2c VZ |
103 | wxSlider *m_redSlider; |
104 | wxSlider *m_greenSlider; | |
105 | wxSlider *m_blueSlider; | |
6bb44116 | 106 | #endif // wxUSE_SLIDER |
e3065973 | 107 | |
66c59e2c | 108 | int m_buttonY; |
f6bcfd97 | 109 | |
66c59e2c VZ |
110 | int m_okButtonX; |
111 | int m_customButtonX; | |
f6bcfd97 BP |
112 | |
113 | // static bool colourDialogCancelled; | |
114 | ||
115 | DECLARE_EVENT_TABLE() | |
116 | DECLARE_DYNAMIC_CLASS(wxGenericColourDialog) | |
c801d85f KB |
117 | }; |
118 | ||
c801d85f | 119 | #endif |