]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/clrpickerg.h
Build fix based on wxOS2 night build log.
[wxWidgets.git] / include / wx / generic / clrpickerg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/clrpickerg.h
3 // Purpose: wxGenericColourButton header
4 // Author: Francesco Montorsi (based on Vadim Zeitlin's code)
5 // Modified by:
6 // Created: 14/4/2006
7 // Copyright: (c) Vadim Zeitlin, Francesco Montorsi
8 // RCS-ID: $Id$
9 // Licence: wxWindows Licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_CLRPICKER_H_
13 #define _WX_CLRPICKER_H_
14
15 #include "wx/button.h"
16
17 class WXDLLIMPEXP_CORE wxColourData;
18
19 //-----------------------------------------------------------------------------
20 // wxGenericColourButton: a button which brings up a wxColourDialog
21 //-----------------------------------------------------------------------------
22
23 // show the colour in HTML form (#AABBCC) as colour button label
24 #define wxCLRBTN_SHOW_LABEL 100
25
26 // the default style
27 #define wxCLRBTN_DEFAULT_STYLE wxCLRBTN_SHOW_LABEL
28
29
30 class WXDLLIMPEXP_CORE wxGenericColourButton : public wxButton,
31 public wxColourPickerWidgetBase
32 {
33 public:
34 wxGenericColourButton() {}
35 wxGenericColourButton(wxWindow *parent,
36 wxWindowID id,
37 const wxColour& col = *wxBLACK,
38 const wxPoint& pos = wxDefaultPosition,
39 const wxSize& size = wxDefaultSize,
40 long style = wxCLRBTN_DEFAULT_STYLE,
41 const wxValidator& validator = wxDefaultValidator,
42 const wxString& name = wxColourPickerWidgetNameStr)
43 {
44 Create(parent, id, col, pos, size, style, validator, name);
45 }
46
47 virtual ~wxGenericColourButton() {}
48
49
50 public: // API extensions specific for wxGenericColourButton
51
52 // user can override this to init colour data in a different way
53 virtual void InitColourData();
54
55 // returns the colour data shown in wxColourDialog
56 wxColourData *GetColourData() { return &ms_data; }
57
58
59 public:
60
61 bool Create(wxWindow *parent,
62 wxWindowID id,
63 const wxColour& col = *wxBLACK,
64 const wxPoint& pos = wxDefaultPosition,
65 const wxSize& size = wxDefaultSize,
66 long style = wxCLRBTN_DEFAULT_STYLE,
67 const wxValidator& validator = wxDefaultValidator,
68 const wxString& name = wxColourPickerWidgetNameStr);
69
70 void OnButtonClick(wxCommandEvent &);
71
72
73 protected:
74
75 void UpdateColour();
76
77 // the colour data shown in wxColourPickerCtrlGeneric
78 // controls. This member is static so that all colour pickers
79 // in the program share the same set of custom colours.
80 static wxColourData ms_data;
81
82 private:
83 DECLARE_DYNAMIC_CLASS(wxGenericColourButton)
84 };
85
86
87 #endif // _WX_CLRPICKER_H_