]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/tglbtn.h
Add support for the new history functions to the ie backend. For this we manage our...
[wxWidgets.git] / include / wx / gtk / tglbtn.h
CommitLineData
1db8dc4a
VZ
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
6// Modified by:
7// Created: 08.02.01
8// RCS-ID: $Id$
9// Copyright: (c) 2000 Johnny C. Norris II
526954c5 10// Licence: wxWindows licence
1db8dc4a
VZ
11/////////////////////////////////////////////////////////////////////////////
12
13#ifndef _WX_GTK_TOGGLEBUTTON_H_
14#define _WX_GTK_TOGGLEBUTTON_H_
15
4f856067
RR
16#include "wx/bitmap.h"
17
1db8dc4a
VZ
18//-----------------------------------------------------------------------------
19// classes
20//-----------------------------------------------------------------------------
21
b5dbe15d
VS
22class WXDLLIMPEXP_FWD_CORE wxToggleButton;
23class WXDLLIMPEXP_FWD_CORE wxToggleBitmapButton;
1db8dc4a 24
4f856067 25//-----------------------------------------------------------------------------
10ff9c61 26// wxBitmapToggleButton
4f856067
RR
27//-----------------------------------------------------------------------------
28
10ff9c61 29class WXDLLIMPEXP_CORE wxBitmapToggleButton: public wxToggleButtonBase
4f856067
RR
30{
31public:
32 // construction/destruction
10ff9c61
RR
33 wxBitmapToggleButton() {}
34 wxBitmapToggleButton(wxWindow *parent,
4f856067
RR
35 wxWindowID id,
36 const wxBitmap& label,
37 const wxPoint& pos = wxDefaultPosition,
38 const wxSize& size = wxDefaultSize,
39 long style = 0,
40 const wxValidator& validator = wxDefaultValidator,
41 const wxString& name = wxCheckBoxNameStr)
42 {
43 Create(parent, id, label, pos, size, style, validator, name);
44 }
45
46 // Create the control
47 bool Create(wxWindow *parent,
48 wxWindowID id,
49 const wxBitmap& label,
50 const wxPoint& pos = wxDefaultPosition,
51 const wxSize& size = wxDefaultSize, long style = 0,
52 const wxValidator& validator = wxDefaultValidator,
53 const wxString& name = wxCheckBoxNameStr);
54
55 // Get/set the value
56 void SetValue(bool state);
57 bool GetValue() const;
58
59 // Set the label
17a1ebd1
VZ
60 virtual void SetLabel(const wxString& label) { wxControl::SetLabel(label); }
61 virtual void SetLabel(const wxBitmap& label);
8e6efd1f 62 bool Enable(bool enable = true);
4f856067 63
9d522606
RD
64 static wxVisualAttributes
65 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
66
4f856067 67 // implementation
4f856067
RR
68 wxBitmap m_bitmap;
69
70 void OnSetBitmap();
6f02a879
VZ
71
72protected:
c71ab7c1
RR
73 void GTKDisableEvents();
74 void GTKEnableEvents();
23318a53 75
4f856067 76 virtual wxSize DoGetBestSize() const;
ef5c70f9
VZ
77 virtual void DoApplyWidgetStyle(GtkRcStyle *style);
78 virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
4f856067
RR
79
80private:
b545684e
PC
81 typedef wxToggleButtonBase base_type;
82
10ff9c61 83 DECLARE_DYNAMIC_CLASS(wxBitmapToggleButton)
4f856067 84};
9d522606 85
1db8dc4a
VZ
86//-----------------------------------------------------------------------------
87// wxToggleButton
88//-----------------------------------------------------------------------------
89
10ff9c61 90class WXDLLIMPEXP_CORE wxToggleButton: public wxToggleButtonBase
1db8dc4a
VZ
91{
92public:
93 // construction/destruction
94 wxToggleButton() {}
95 wxToggleButton(wxWindow *parent,
96 wxWindowID id,
97 const wxString& label,
98 const wxPoint& pos = wxDefaultPosition,
99 const wxSize& size = wxDefaultSize,
100 long style = 0,
101 const wxValidator& validator = wxDefaultValidator,
102 const wxString& name = wxCheckBoxNameStr)
103 {
104 Create(parent, id, label, pos, size, style, validator, name);
105 }
106
107 // Create the control
108 bool Create(wxWindow *parent,
109 wxWindowID id,
110 const wxString& label,
111 const wxPoint& pos = wxDefaultPosition,
112 const wxSize& size = wxDefaultSize, long style = 0,
113 const wxValidator& validator = wxDefaultValidator,
114 const wxString& name = wxCheckBoxNameStr);
115
116 // Get/set the value
117 void SetValue(bool state);
118 bool GetValue() const;
119
120 // Set the label
121 void SetLabel(const wxString& label);
8e6efd1f 122 bool Enable(bool enable = true);
1db8dc4a 123
9d522606
RD
124 static wxVisualAttributes
125 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
23318a53 126
6f02a879 127protected:
c71ab7c1
RR
128 void GTKDisableEvents();
129 void GTKEnableEvents();
23318a53 130
1db8dc4a 131 virtual wxSize DoGetBestSize() const;
ef5c70f9
VZ
132 virtual void DoApplyWidgetStyle(GtkRcStyle *style);
133 virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
1db8dc4a
VZ
134
135private:
b545684e
PC
136 typedef wxToggleButtonBase base_type;
137
1db8dc4a
VZ
138 DECLARE_DYNAMIC_CLASS(wxToggleButton)
139};
140
141#endif // _WX_GTK_TOGGLEBUTTON_H_
142