]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/colrdlgg.h
activating DrawRectangle optimization
[wxWidgets.git] / include / wx / generic / colrdlgg.h
CommitLineData
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
081d8d96
PC
12#ifndef _WX_COLORDLGG_H_
13#define _WX_COLORDLGG_H_
c801d85f 14
c801d85f
KB
15#include "wx/gdicmn.h"
16#include "wx/dialog.h"
c801d85f
KB
17
18#define wxID_ADD_CUSTOM 3000
c801d85f 19
6bb44116
WS
20#if wxUSE_SLIDER
21
22 #define wxID_RED_SLIDER 3001
23 #define wxID_GREEN_SLIDER 3002
24 #define wxID_BLUE_SLIDER 3003
25
b5dbe15d 26 class WXDLLIMPEXP_FWD_CORE wxSlider;
6bb44116
WS
27
28#endif // wxUSE_SLIDER
29
53a2db12 30class WXDLLIMPEXP_CORE wxGenericColourDialog : public wxDialog
c801d85f 31{
f6bcfd97
BP
32public:
33 wxGenericColourDialog();
34 wxGenericColourDialog(wxWindow *parent,
d3b9f782 35 wxColourData *data = NULL);
f6bcfd97 36 virtual ~wxGenericColourDialog();
c801d85f 37
d3b9f782 38 bool Create(wxWindow *parent, wxColourData *data = NULL);
c801d85f 39
66c59e2c 40 wxColourData &GetColourData() { return m_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
6bb44116 62#if wxUSE_SLIDER
f6bcfd97
BP
63 void OnRedSlider(wxCommandEvent& event);
64 void OnGreenSlider(wxCommandEvent& event);
65 void OnBlueSlider(wxCommandEvent& event);
6bb44116 66#endif // wxUSE_SLIDER
c801d85f 67
f6bcfd97 68 void OnCloseWindow(wxCloseEvent& event);
c801d85f 69
f6bcfd97 70protected:
66c59e2c 71 wxColourData m_colourData;
c801d85f 72
f6bcfd97 73 // Area reserved for grids of colours
66c59e2c
VZ
74 wxRect m_standardColoursRect;
75 wxRect m_customColoursRect;
76 wxRect m_singleCustomColourRect;
c801d85f 77
f6bcfd97 78 // Size of each colour rectangle
66c59e2c 79 wxPoint m_smallRectangleSize;
c801d85f 80
f6bcfd97 81 // For single customizable colour
66c59e2c 82 wxPoint m_customRectangleSize;
c801d85f 83
f6bcfd97 84 // Grid spacing (between rectangles)
66c59e2c 85 int m_gridSpacing;
c801d85f 86
f6bcfd97 87 // Section spacing (between left and right halves of dialog box)
66c59e2c 88 int m_sectionSpacing;
c801d85f 89
f6bcfd97 90 // 48 'standard' colours
66c59e2c 91 wxColour m_standardColours[48];
c801d85f 92
f6bcfd97 93 // 16 'custom' colours
66c59e2c 94 wxColour m_customColours[16];
c801d85f 95
f6bcfd97 96 // Which colour is selected? An index into one of the two areas.
66c59e2c
VZ
97 int m_colourSelection;
98 int m_whichKind; // 1 for standard colours, 2 for custom colours,
c801d85f 99
6bb44116 100#if wxUSE_SLIDER
66c59e2c
VZ
101 wxSlider *m_redSlider;
102 wxSlider *m_greenSlider;
103 wxSlider *m_blueSlider;
6bb44116 104#endif // wxUSE_SLIDER
e3065973 105
66c59e2c 106 int m_buttonY;
f6bcfd97 107
66c59e2c
VZ
108 int m_okButtonX;
109 int m_customButtonX;
f6bcfd97
BP
110
111 // static bool colourDialogCancelled;
112
113 DECLARE_EVENT_TABLE()
114 DECLARE_DYNAMIC_CLASS(wxGenericColourDialog)
c801d85f
KB
115};
116
081d8d96 117#endif // _WX_COLORDLGG_H_