]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/clrpicker.h
adding measuring contexts, streamlining printing code
[wxWidgets.git] / include / wx / gtk / clrpicker.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/clrpicker.h
3 // Purpose: wxColourButton header
4 // Author: Francesco Montorsi
5 // Modified by:
6 // Created: 14/4/2006
7 // Copyright: (c) Francesco Montorsi
8 // RCS-ID: $Id$
9 // Licence: wxWindows Licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_GTK_CLRPICKER_H_
13 #define _WX_GTK_CLRPICKER_H_
14
15 // since GtkColorButton is available only for GTK+ >= 2.4,
16 // we need to use generic version if we detect (at runtime)
17 // that GTK+ < 2.4
18 #include "wx/generic/clrpickerg.h"
19
20 //-----------------------------------------------------------------------------
21 // wxColourButton
22 //-----------------------------------------------------------------------------
23
24 class WXDLLIMPEXP_CORE wxColourButton : public wxGenericColourButton
25 {
26 public:
27 wxColourButton() : m_topParent(NULL) {}
28 wxColourButton(wxWindow *parent,
29 wxWindowID id,
30 const wxColour& initial = *wxBLACK,
31 const wxPoint& pos = wxDefaultPosition,
32 const wxSize& size = wxDefaultSize,
33 long style = wxCLRBTN_DEFAULT_STYLE,
34 const wxValidator& validator = wxDefaultValidator,
35 const wxString& name = wxColourPickerWidgetNameStr)
36 : m_topParent(NULL)
37 {
38 Create(parent, id, initial, pos, size, style, validator, name);
39 }
40
41 virtual ~wxColourButton();
42
43
44 public: // overrides
45
46 bool Create(wxWindow *parent,
47 wxWindowID id,
48 const wxColour& initial = *wxBLACK,
49 const wxPoint& pos = wxDefaultPosition,
50 const wxSize& size = wxDefaultSize,
51 long style = wxCLRBTN_DEFAULT_STYLE,
52 const wxValidator& validator = wxDefaultValidator,
53 const wxString& name = wxColourPickerWidgetNameStr);
54
55 protected:
56 void UpdateColour();
57
58 public: // used by the GTK callback only
59
60 void SetGdkColor(const GdkColor& gdkColor)
61 { m_colour = wxColor(gdkColor); }
62
63 wxWindow *m_topParent;
64
65 private:
66 DECLARE_DYNAMIC_CLASS(wxColourButton)
67 };
68
69 #endif // _WX_GTK_CLRPICKER_H_
70