]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/tglbtn.h
Don't set a normal cursor for the frame, set the NULL cursor, else
[wxWidgets.git] / include / wx / gtk1 / 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
6 // Modified by:
7 // Created: 08.02.01
8 // RCS-ID: $Id$
9 // Copyright: (c) 2000 Johnny C. Norris II
10 // License: Rocketeer license
11 /////////////////////////////////////////////////////////////////////////////
12
13 #ifndef _WX_GTK_TOGGLEBUTTON_H_
14 #define _WX_GTK_TOGGLEBUTTON_H_
15
16 //-----------------------------------------------------------------------------
17 // classes
18 //-----------------------------------------------------------------------------
19
20 class wxToggleButton;
21
22 //-----------------------------------------------------------------------------
23 // global data
24 //-----------------------------------------------------------------------------
25
26 extern const char *wxCheckBoxNameStr;
27
28 //-----------------------------------------------------------------------------
29 // wxToggleButton
30 //-----------------------------------------------------------------------------
31
32 class wxToggleButton: public wxControl
33 {
34 public:
35 // construction/destruction
36 wxToggleButton() {}
37 wxToggleButton(wxWindow *parent,
38 wxWindowID id,
39 const wxString& label,
40 const wxPoint& pos = wxDefaultPosition,
41 const wxSize& size = wxDefaultSize,
42 long style = 0,
43 const wxValidator& validator = wxDefaultValidator,
44 const wxString& name = wxCheckBoxNameStr)
45 {
46 Create(parent, id, label, pos, size, style, validator, name);
47 }
48
49 // Create the control
50 bool Create(wxWindow *parent,
51 wxWindowID id,
52 const wxString& label,
53 const wxPoint& pos = wxDefaultPosition,
54 const wxSize& size = wxDefaultSize, long style = 0,
55 const wxValidator& validator = wxDefaultValidator,
56 const wxString& name = wxCheckBoxNameStr);
57
58 // Get/set the value
59 void SetValue(bool state);
60 bool GetValue() const;
61
62 // Set the label
63 void SetLabel(const wxString& label);
64 bool Enable(bool enable = TRUE);
65
66
67 // implementation
68 bool m_blockEvent;
69
70 void ApplyWidgetStyle();
71 bool IsOwnGtkWindow(GdkWindow *window);
72
73 virtual void OnInternalIdle();
74 virtual wxSize DoGetBestSize() const;
75
76 private:
77 DECLARE_DYNAMIC_CLASS(wxToggleButton)
78 };
79
80 #endif // _WX_GTK_TOGGLEBUTTON_H_
81