1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/clrpicker.h
3 // Purpose: wxColourButton header
4 // Author: Francesco Montorsi
7 // Copyright: (c) Francesco Montorsi
9 // Licence: wxWindows Licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GTK_CLRPICKER_H_
13 #define _WX_GTK_CLRPICKER_H_
15 // since GtkColorButton is available only for GTK+ >= 2.4,
16 // we need to use generic version if we detect (at runtime)
18 #include "wx/generic/clrpickerg.h"
20 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
24 class WXDLLIMPEXP_CORE wxColourButton
: public wxGenericColourButton
27 wxColourButton() : m_topParent(NULL
) {}
28 wxColourButton(wxWindow
*parent
,
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
)
38 Create(parent
, id
, initial
, pos
, size
, style
, validator
, name
);
41 virtual ~wxColourButton();
46 bool Create(wxWindow
*parent
,
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
);
58 public: // used by the GTK callback only
60 void SetGdkColor(const GdkColor
& gdkColor
)
61 { m_colour
= wxColor(gdkColor
); }
63 wxWindow
*m_topParent
;
66 DECLARE_DYNAMIC_CLASS(wxColourButton
)
69 #endif // _WX_GTK_CLRPICKER_H_