1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/tglbtn.h
3 // Purpose: Declaration of the wxToggleButton class, which implements a
4 // toggle button under wxGTK.
5 // Author: John Norris, minor changes by Axel Schlueter
9 // Copyright: (c) 2000 Johnny C. Norris II
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef _WX_GTK_TOGGLEBUTTON_H_
14 #define _WX_GTK_TOGGLEBUTTON_H_
16 #include "wx/bitmap.h"
18 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
22 class WXDLLIMPEXP_CORE wxToggleButton
: public wxToggleButtonBase
25 // construction/destruction
27 wxToggleButton(wxWindow
*parent
,
29 const wxString
& label
,
30 const wxPoint
& pos
= wxDefaultPosition
,
31 const wxSize
& size
= wxDefaultSize
,
33 const wxValidator
& validator
= wxDefaultValidator
,
34 const wxString
& name
= wxCheckBoxNameStr
)
36 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
40 bool Create(wxWindow
*parent
,
42 const wxString
& label
,
43 const wxPoint
& pos
= wxDefaultPosition
,
44 const wxSize
& size
= wxDefaultSize
, long style
= 0,
45 const wxValidator
& validator
= wxDefaultValidator
,
46 const wxString
& name
= wxCheckBoxNameStr
);
49 void SetValue(bool state
);
50 bool GetValue() const;
53 void SetLabel(const wxString
& label
);
55 static wxVisualAttributes
56 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
59 void GTKDisableEvents();
60 void GTKEnableEvents();
62 virtual wxSize
DoGetBestSize() const;
63 virtual void DoApplyWidgetStyle(GtkRcStyle
*style
);
66 virtual bool DoSetLabelMarkup(const wxString
& markup
);
67 #endif // wxUSE_MARKUP
70 typedef wxToggleButtonBase base_type
;
72 // Return the GtkLabel used by this toggle button.
73 GtkLabel
*GTKGetLabel() const;
75 DECLARE_DYNAMIC_CLASS(wxToggleButton
)
78 //-----------------------------------------------------------------------------
79 // wxBitmapToggleButton
80 //-----------------------------------------------------------------------------
82 class WXDLLIMPEXP_CORE wxBitmapToggleButton
: public wxToggleButton
85 // construction/destruction
86 wxBitmapToggleButton() {}
87 wxBitmapToggleButton(wxWindow
*parent
,
89 const wxBitmap
& label
,
90 const wxPoint
& pos
= wxDefaultPosition
,
91 const wxSize
& size
= wxDefaultSize
,
93 const wxValidator
& validator
= wxDefaultValidator
,
94 const wxString
& name
= wxCheckBoxNameStr
)
96 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
100 bool Create(wxWindow
*parent
,
102 const wxBitmap
& label
,
103 const wxPoint
& pos
= wxDefaultPosition
,
104 const wxSize
& size
= wxDefaultSize
, long style
= 0,
105 const wxValidator
& validator
= wxDefaultValidator
,
106 const wxString
& name
= wxCheckBoxNameStr
);
108 // deprecated synonym for SetBitmapLabel()
109 wxDEPRECATED_INLINE( void SetLabel(const wxBitmap
& bitmap
),
110 SetBitmapLabel(bitmap
); )
111 // prevent virtual function hiding
112 virtual void SetLabel(const wxString
& label
) { wxToggleButton::SetLabel(label
); }
115 typedef wxToggleButtonBase base_type
;
117 DECLARE_DYNAMIC_CLASS(wxBitmapToggleButton
)
120 #endif // _WX_GTK_TOGGLEBUTTON_H_