1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/clrpickerg.h
3 // Purpose: wxGenericColourButton header
4 // Author: Francesco Montorsi (based on Vadim Zeitlin's code)
7 // Copyright: (c) Vadim Zeitlin, Francesco Montorsi
9 // Licence: wxWindows Licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_CLRPICKER_H_
13 #define _WX_CLRPICKER_H_
15 class WXDLLIMPEXP_CORE wxColourData
;
17 //-----------------------------------------------------------------------------
18 // wxGenericColourButton: a button which brings up a wxColourDialog
19 //-----------------------------------------------------------------------------
21 // show the colour in HTML form (#AABBCC) as colour button label
22 #define wxCLRBTN_SHOW_LABEL 100
25 #define wxCLRBTN_DEFAULT_STYLE wxCLRBTN_SHOW_LABEL
28 class WXDLLIMPEXP_CORE wxGenericColourButton
: public wxButton
,
29 public wxColourPickerWidgetBase
32 wxGenericColourButton() {}
33 wxGenericColourButton(wxWindow
*parent
,
35 const wxColour
& col
= *wxBLACK
,
36 const wxPoint
& pos
= wxDefaultPosition
,
37 const wxSize
& size
= wxDefaultSize
,
38 long style
= wxCLRBTN_DEFAULT_STYLE
,
39 const wxValidator
& validator
= wxDefaultValidator
,
40 const wxString
& name
= wxColourPickerWidgetNameStr
)
42 Create(parent
, id
, col
, pos
, size
, style
, validator
, name
);
45 virtual ~wxGenericColourButton() {}
48 public: // API extensions specific for wxGenericColourButton
50 // user can override this to init colour data in a different way
51 virtual void InitColourData();
53 // returns the colour data shown in wxColourDialog
54 wxColourData
*GetColourData() { return &ms_data
; }
59 bool Create(wxWindow
*parent
,
61 const wxColour
& col
= *wxBLACK
,
62 const wxPoint
& pos
= wxDefaultPosition
,
63 const wxSize
& size
= wxDefaultSize
,
64 long style
= wxCLRBTN_DEFAULT_STYLE
,
65 const wxValidator
& validator
= wxDefaultValidator
,
66 const wxString
& name
= wxColourPickerWidgetNameStr
);
68 void OnButtonClick(wxCommandEvent
&);
75 // the colour data shown in wxColourPickerCtrlGeneric
76 // controls. This member is static so that all colour pickers
77 // in the program share the same set of custom colours.
78 static wxColourData ms_data
;
81 DECLARE_DYNAMIC_CLASS(wxGenericColourButton
)
85 #endif // _WX_CLRPICKER_H_