]>
Commit | Line | Data |
---|---|---|
43be3c33 | 1 | /////////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/univ/tglbtn.h |
43be3c33 JS |
3 | // Purpose: wxToggleButton for wxUniversal |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: David Bjorkevik | |
6 | // Created: 16.05.06 | |
43be3c33 JS |
7 | // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) |
8 | // Licence: wxWindows licence | |
9 | /////////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_UNIV_TGLBTN_H_ | |
12 | #define _WX_UNIV_TGLBTN_H_ | |
13 | ||
bd88c1fa | 14 | #include "wx/button.h" |
13199c3d | 15 | |
43be3c33 JS |
16 | // ---------------------------------------------------------------------------- |
17 | // wxToggleButton: a push button | |
18 | // ---------------------------------------------------------------------------- | |
19 | ||
bd88c1fa | 20 | class WXDLLIMPEXP_CORE wxToggleButton: public wxButton |
43be3c33 JS |
21 | { |
22 | public: | |
bd88c1fa PC |
23 | wxToggleButton(); |
24 | ||
43be3c33 JS |
25 | wxToggleButton(wxWindow *parent, |
26 | wxWindowID id, | |
27 | const wxBitmap& bitmap, | |
28 | const wxString& label = wxEmptyString, | |
29 | const wxPoint& pos = wxDefaultPosition, | |
30 | const wxSize& size = wxDefaultSize, | |
31 | long style = 0, | |
32 | const wxValidator& validator = wxDefaultValidator, | |
bd88c1fa | 33 | const wxString& name = wxCheckBoxNameStr); |
43be3c33 | 34 | |
43be3c33 JS |
35 | wxToggleButton(wxWindow *parent, |
36 | wxWindowID id, | |
37 | const wxString& label = wxEmptyString, | |
38 | const wxPoint& pos = wxDefaultPosition, | |
39 | const wxSize& size = wxDefaultSize, | |
40 | long style = 0, | |
41 | const wxValidator& validator = wxDefaultValidator, | |
bd88c1fa | 42 | const wxString& name = wxCheckBoxNameStr); |
43be3c33 JS |
43 | |
44 | virtual ~wxToggleButton(); | |
45 | ||
43be3c33 JS |
46 | virtual bool IsPressed() const { return m_isPressed || m_value; } |
47 | ||
48 | // wxToggleButton actions | |
bd88c1fa | 49 | virtual void Toggle(); |
43be3c33 JS |
50 | virtual void Click(); |
51 | ||
52 | // Get/set the value | |
53 | void SetValue(bool state); | |
54 | bool GetValue() const { return m_value; } | |
55 | ||
13199c3d | 56 | protected: |
dc797d8e JS |
57 | virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } |
58 | ||
43be3c33 JS |
59 | // the current value |
60 | bool m_value; | |
61 | ||
43be3c33 | 62 | private: |
bd88c1fa PC |
63 | // common part of all ctors |
64 | void Init(); | |
43be3c33 | 65 | |
bd88c1fa | 66 | DECLARE_DYNAMIC_CLASS(wxToggleButton) |
43be3c33 JS |
67 | }; |
68 | ||
69 | #endif // _WX_UNIV_TGLBTN_H_ |