]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/colrdlgg.h
wxMessageBox off the main thread lost result code.
[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
99d80019 7// Copyright: (c) Julian Smart
65571936 8// Licence: wxWindows licence
c801d85f
KB
9/////////////////////////////////////////////////////////////////////////////
10
081d8d96
PC
11#ifndef _WX_COLORDLGG_H_
12#define _WX_COLORDLGG_H_
c801d85f 13
c801d85f
KB
14#include "wx/gdicmn.h"
15#include "wx/dialog.h"
c801d85f
KB
16
17#define wxID_ADD_CUSTOM 3000
c801d85f 18
6bb44116
WS
19#if wxUSE_SLIDER
20
21 #define wxID_RED_SLIDER 3001
22 #define wxID_GREEN_SLIDER 3002
23 #define wxID_BLUE_SLIDER 3003
24
b5dbe15d 25 class WXDLLIMPEXP_FWD_CORE wxSlider;
6bb44116
WS
26
27#endif // wxUSE_SLIDER
28
53a2db12 29class WXDLLIMPEXP_CORE wxGenericColourDialog : public wxDialog
c801d85f 30{
f6bcfd97
BP
31public:
32 wxGenericColourDialog();
33 wxGenericColourDialog(wxWindow *parent,
d3b9f782 34 wxColourData *data = NULL);
f6bcfd97 35 virtual ~wxGenericColourDialog();
c801d85f 36
d3b9f782 37 bool Create(wxWindow *parent, wxColourData *data = NULL);
c801d85f 38
66c59e2c 39 wxColourData &GetColourData() { return m_colourData; }
c801d85f 40
f6bcfd97 41 virtual int ShowModal();
c801d85f 42
f6bcfd97
BP
43 // Internal functions
44 void OnMouseEvent(wxMouseEvent& event);
45 void OnPaint(wxPaintEvent& event);
c801d85f 46
f6bcfd97
BP
47 virtual void CalculateMeasurements();
48 virtual void CreateWidgets();
49 virtual void InitializeColours();
c801d85f 50
f6bcfd97
BP
51 virtual void PaintBasicColours(wxDC& dc);
52 virtual void PaintCustomColours(wxDC& dc);
53 virtual void PaintCustomColour(wxDC& dc);
54 virtual void PaintHighlight(wxDC& dc, bool draw);
c801d85f 55
f6bcfd97
BP
56 virtual void OnBasicColourClick(int which);
57 virtual void OnCustomColourClick(int which);
c801d85f 58
f6bcfd97 59 void OnAddCustom(wxCommandEvent& event);
c801d85f 60
6bb44116 61#if wxUSE_SLIDER
f6bcfd97
BP
62 void OnRedSlider(wxCommandEvent& event);
63 void OnGreenSlider(wxCommandEvent& event);
64 void OnBlueSlider(wxCommandEvent& event);
6bb44116 65#endif // wxUSE_SLIDER
c801d85f 66
f6bcfd97 67 void OnCloseWindow(wxCloseEvent& event);
c801d85f 68
f6bcfd97 69protected:
66c59e2c 70 wxColourData m_colourData;
c801d85f 71
f6bcfd97 72 // Area reserved for grids of colours
66c59e2c
VZ
73 wxRect m_standardColoursRect;
74 wxRect m_customColoursRect;
75 wxRect m_singleCustomColourRect;
c801d85f 76
f6bcfd97 77 // Size of each colour rectangle
66c59e2c 78 wxPoint m_smallRectangleSize;
c801d85f 79
f6bcfd97 80 // For single customizable colour
66c59e2c 81 wxPoint m_customRectangleSize;
c801d85f 82
f6bcfd97 83 // Grid spacing (between rectangles)
66c59e2c 84 int m_gridSpacing;
c801d85f 85
f6bcfd97 86 // Section spacing (between left and right halves of dialog box)
66c59e2c 87 int m_sectionSpacing;
c801d85f 88
f6bcfd97 89 // 48 'standard' colours
66c59e2c 90 wxColour m_standardColours[48];
c801d85f 91
f6bcfd97 92 // 16 'custom' colours
66c59e2c 93 wxColour m_customColours[16];
c801d85f 94
f6bcfd97 95 // Which colour is selected? An index into one of the two areas.
66c59e2c
VZ
96 int m_colourSelection;
97 int m_whichKind; // 1 for standard colours, 2 for custom colours,
c801d85f 98
6bb44116 99#if wxUSE_SLIDER
66c59e2c
VZ
100 wxSlider *m_redSlider;
101 wxSlider *m_greenSlider;
102 wxSlider *m_blueSlider;
6bb44116 103#endif // wxUSE_SLIDER
e3065973 104
66c59e2c 105 int m_buttonY;
f6bcfd97 106
66c59e2c
VZ
107 int m_okButtonX;
108 int m_customButtonX;
f6bcfd97
BP
109
110 // static bool colourDialogCancelled;
111
112 DECLARE_EVENT_TABLE()
113 DECLARE_DYNAMIC_CLASS(wxGenericColourDialog)
c801d85f
KB
114};
115
081d8d96 116#endif // _WX_COLORDLGG_H_