]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/clrpickerg.h
added possibility to reorder columns by dragging them (patch 1409677)
[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 class WXDLLIMPEXP_CORE wxColourData;
16
17 //-----------------------------------------------------------------------------
18 // wxGenericColourButton: a button which brings up a wxColourDialog
19 //-----------------------------------------------------------------------------
20
21 // show the colour in HTML form (#AABBCC) as colour button label
22 #define wxCLRBTN_SHOW_LABEL 100
23
24 // the default style
25 #define wxCLRBTN_DEFAULT_STYLE wxCLRBTN_SHOW_LABEL
26
27
28 class WXDLLIMPEXP_CORE wxGenericColourButton : public wxButton,
29 public wxColourPickerWidgetBase
30 {
31 public:
32 wxGenericColourButton() {}
33 wxGenericColourButton(wxWindow *parent,
34 wxWindowID id,
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)
41 {
42 Create(parent, id, col, pos, size, style, validator, name);
43 }
44
45 virtual ~wxGenericColourButton() {}
46
47
48 public: // API extensions specific for wxGenericColourButton
49
50 // user can override this to init colour data in a different way
51 virtual void InitColourData();
52
53 // returns the colour data shown in wxColourDialog
54 wxColourData *GetColourData() { return &ms_data; }
55
56
57 public:
58
59 bool Create(wxWindow *parent,
60 wxWindowID id,
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);
67
68 void OnButtonClick(wxCommandEvent &);
69
70
71 protected:
72
73 void UpdateColour();
74
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;
79
80 private:
81 DECLARE_DYNAMIC_CLASS(wxGenericColourButton)
82 };
83
84
85 #endif // _WX_CLRPICKER_H_