]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/tglbtn.h
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 // License: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef _WX_GTK_TOGGLEBUTTON_H_
14 #define _WX_GTK_TOGGLEBUTTON_H_
16 #include "wx/bitmap.h"
18 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
23 class wxToggleBitmapButton
;
25 //-----------------------------------------------------------------------------
27 //-----------------------------------------------------------------------------
29 extern const wxChar
*wxCheckBoxNameStr
;
31 //-----------------------------------------------------------------------------
32 // wxToggleBitmapButton
33 //-----------------------------------------------------------------------------
35 class wxToggleBitmapButton
: public wxControl
38 // construction/destruction
39 wxToggleBitmapButton() {}
40 wxToggleBitmapButton(wxWindow
*parent
,
42 const wxBitmap
& label
,
43 const wxPoint
& pos
= wxDefaultPosition
,
44 const wxSize
& size
= wxDefaultSize
,
46 const wxValidator
& validator
= wxDefaultValidator
,
47 const wxString
& name
= wxCheckBoxNameStr
)
49 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
53 bool Create(wxWindow
*parent
,
55 const wxBitmap
& label
,
56 const wxPoint
& pos
= wxDefaultPosition
,
57 const wxSize
& size
= wxDefaultSize
, long style
= 0,
58 const wxValidator
& validator
= wxDefaultValidator
,
59 const wxString
& name
= wxCheckBoxNameStr
);
62 void SetValue(bool state
);
63 bool GetValue() const;
66 void SetLabel(const wxBitmap
& label
);
67 bool Enable(bool enable
= TRUE
);
69 static wxVisualAttributes
70 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
77 void DoApplyWidgetStyle(GtkRcStyle
*style
);
78 bool IsOwnGtkWindow(GdkWindow
*window
);
80 virtual void OnInternalIdle();
81 virtual wxSize
DoGetBestSize() const;
84 DECLARE_DYNAMIC_CLASS(wxToggleBitmapButton
)
87 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
91 class wxToggleButton
: public wxControl
94 // construction/destruction
96 wxToggleButton(wxWindow
*parent
,
98 const wxString
& label
,
99 const wxPoint
& pos
= wxDefaultPosition
,
100 const wxSize
& size
= wxDefaultSize
,
102 const wxValidator
& validator
= wxDefaultValidator
,
103 const wxString
& name
= wxCheckBoxNameStr
)
105 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
108 // Create the control
109 bool Create(wxWindow
*parent
,
111 const wxString
& label
,
112 const wxPoint
& pos
= wxDefaultPosition
,
113 const wxSize
& size
= wxDefaultSize
, long style
= 0,
114 const wxValidator
& validator
= wxDefaultValidator
,
115 const wxString
& name
= wxCheckBoxNameStr
);
118 void SetValue(bool state
);
119 bool GetValue() const;
122 void SetLabel(const wxString
& label
);
123 bool Enable(bool enable
= TRUE
);
125 static wxVisualAttributes
126 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
131 void DoApplyWidgetStyle(GtkRcStyle
*style
);
132 bool IsOwnGtkWindow(GdkWindow
*window
);
134 virtual void OnInternalIdle();
135 virtual wxSize
DoGetBestSize() const;
138 DECLARE_DYNAMIC_CLASS(wxToggleButton
)
141 #endif // _WX_GTK_TOGGLEBUTTON_H_