]>
Commit | Line | Data |
---|---|---|
1 | /////////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/univ/tglbtn.h | |
3 | // Purpose: wxToggleButton for wxUniversal | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: David Bjorkevik | |
6 | // Created: 16.05.06 | |
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 | ||
14 | #include "wx/button.h" | |
15 | ||
16 | // ---------------------------------------------------------------------------- | |
17 | // wxToggleButton: a push button | |
18 | // ---------------------------------------------------------------------------- | |
19 | ||
20 | class WXDLLIMPEXP_CORE wxToggleButton: public wxButton | |
21 | { | |
22 | public: | |
23 | wxToggleButton(); | |
24 | ||
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, | |
33 | const wxString& name = wxCheckBoxNameStr); | |
34 | ||
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, | |
42 | const wxString& name = wxCheckBoxNameStr); | |
43 | ||
44 | virtual ~wxToggleButton(); | |
45 | ||
46 | virtual bool IsPressed() const { return m_isPressed || m_value; } | |
47 | ||
48 | // wxToggleButton actions | |
49 | virtual void Toggle(); | |
50 | virtual void Click(); | |
51 | ||
52 | // Get/set the value | |
53 | void SetValue(bool state); | |
54 | bool GetValue() const { return m_value; } | |
55 | ||
56 | protected: | |
57 | virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } | |
58 | ||
59 | // the current value | |
60 | bool m_value; | |
61 | ||
62 | private: | |
63 | // common part of all ctors | |
64 | void Init(); | |
65 | ||
66 | DECLARE_DYNAMIC_CLASS(wxToggleButton) | |
67 | }; | |
68 | ||
69 | #endif // _WX_UNIV_TGLBTN_H_ |