]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/colrdlgg.h
Correct some minor compile pbs with VC++1.52c & VC++4.1
[wxWidgets.git] / include / wx / generic / colrdlgg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: colrdlgg.h
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
15 #ifdef __GNUG__
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;
30 class WXDLLEXPORT wxGenericColourDialog: public wxDialog
31 {
32 DECLARE_DYNAMIC_CLASS(wxGenericColourDialog)
33 protected:
34 wxColourData colourData;
35 wxWindow *dialogParent;
36
37 // Area reserved for grids of colours
38 wxRect standardColoursRect;
39 wxRect customColoursRect;
40 wxRect singleCustomColourRect;
41
42 // Size of each colour rectangle
43 wxPoint smallRectangleSize;
44
45 // For single customizable colour
46 wxPoint customRectangleSize;
47
48 // Grid spacing (between rectangles)
49 int gridSpacing;
50
51 // Section spacing (between left and right halves of dialog box)
52 int sectionSpacing;
53
54 // 48 'standard' colours
55 wxColour standardColours[48];
56
57 // 16 'custom' colours
58 wxColour customColours[16];
59
60 // One single custom colour (use sliders)
61 wxColour singleCustomColour;
62
63 // Which colour is selected? An index into one of the two areas.
64 int colourSelection;
65 int whichKind; // 1 for standard colours, 2 for custom colours,
66
67 wxSlider *redSlider;
68 wxSlider *greenSlider;
69 wxSlider *blueSlider;
70
71 int buttonY;
72
73 int okButtonX;
74 int customButtonX;
75
76 // static bool colourDialogCancelled;
77 public:
78 wxGenericColourDialog(void);
79 wxGenericColourDialog(wxWindow *parent, wxColourData *data = (wxColourData *) NULL);
80 ~wxGenericColourDialog(void);
81
82 bool Create(wxWindow *parent, wxColourData *data = (wxColourData *) NULL);
83
84 int ShowModal(void);
85 wxColourData &GetColourData(void) { return colourData; }
86
87 // Internal functions
88 void OnMouseEvent(wxMouseEvent& event);
89 void OnPaint(wxPaintEvent& event);
90
91 virtual void CalculateMeasurements(void);
92 virtual void CreateWidgets(void);
93 virtual void InitializeColours(void);
94
95 virtual void PaintBasicColours(wxDC& dc);
96 virtual void PaintCustomColours(wxDC& dc);
97 virtual void PaintCustomColour(wxDC& dc);
98 virtual void PaintHighlight(wxDC& dc, bool draw);
99
100 virtual void OnBasicColourClick(int which);
101 virtual void OnCustomColourClick(int which);
102
103 void OnAddCustom(wxCommandEvent& event);
104
105 void OnRedSlider(wxCommandEvent& event);
106 void OnGreenSlider(wxCommandEvent& event);
107 void OnBlueSlider(wxCommandEvent& event);
108
109 void OnCloseWindow(wxCloseEvent& event);
110
111 DECLARE_EVENT_TABLE()
112 };
113
114 #ifdef __WXGTK__
115 typedef wxGenericColourDialog wxColourDialog;
116 #endif
117
118 #endif