1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/tglbtn.h
3 // Purpose: Declaration of the wxToggleButton class, which implements a
4 // toggle button under wxMSW.
5 // Author: John Norris, minor changes by Axel Schlueter
8 // Copyright: (c) 2000 Johnny C. Norris II
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_TOGGLEBUTTON_H_
13 #define _WX_TOGGLEBUTTON_H_
15 #include "wx/bitmap.h"
17 // Checkbox item (single checkbox)
18 class WXDLLIMPEXP_CORE wxToggleButton
: public wxToggleButtonBase
21 wxToggleButton() { Init(); }
22 wxToggleButton(wxWindow
*parent
,
24 const wxString
& label
,
25 const wxPoint
& pos
= wxDefaultPosition
,
26 const wxSize
& size
= wxDefaultSize
,
28 const wxValidator
& validator
= wxDefaultValidator
,
29 const wxString
& name
= wxCheckBoxNameStr
)
31 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
34 bool Create(wxWindow
*parent
,
36 const wxString
& label
,
37 const wxPoint
& pos
= wxDefaultPosition
,
38 const wxSize
& size
= wxDefaultSize
,
40 const wxValidator
& validator
= wxDefaultValidator
,
41 const wxString
& name
= wxCheckBoxNameStr
);
43 virtual void SetValue(bool value
);
44 virtual bool GetValue() const ;
46 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
47 virtual void Command(wxCommandEvent
& event
);
49 virtual State
GetNormalState() const;
51 // returns true if the platform should explicitly apply a theme border
52 virtual bool CanApplyThemeBorder() const { return false; }
55 virtual wxBorder
GetDefaultBorder() const { return wxBORDER_NONE
; }
57 virtual WXDWORD
MSWGetStyle(long flags
, WXDWORD
*exstyle
= NULL
) const;
61 // current state of the button (when owner-drawn)
65 DECLARE_DYNAMIC_CLASS_NO_COPY(wxToggleButton
)
68 //-----------------------------------------------------------------------------
69 // wxBitmapToggleButton
70 //-----------------------------------------------------------------------------
73 class WXDLLIMPEXP_CORE wxBitmapToggleButton
: public wxToggleButton
76 // construction/destruction
77 wxBitmapToggleButton() {}
78 wxBitmapToggleButton(wxWindow
*parent
,
80 const wxBitmap
& label
,
81 const wxPoint
& pos
= wxDefaultPosition
,
82 const wxSize
& size
= wxDefaultSize
,
84 const wxValidator
& validator
= wxDefaultValidator
,
85 const wxString
& name
= wxCheckBoxNameStr
)
87 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
91 bool Create(wxWindow
*parent
,
93 const wxBitmap
& label
,
94 const wxPoint
& pos
= wxDefaultPosition
,
95 const wxSize
& size
= wxDefaultSize
, long style
= 0,
96 const wxValidator
& validator
= wxDefaultValidator
,
97 const wxString
& name
= wxCheckBoxNameStr
);
99 // deprecated synonym for SetBitmapLabel()
100 wxDEPRECATED_INLINE( void SetLabel(const wxBitmap
& bitmap
),
101 SetBitmapLabel(bitmap
); )
102 // prevent virtual function hiding
103 virtual void SetLabel(const wxString
& label
) { wxToggleButton::SetLabel(label
); }
106 DECLARE_DYNAMIC_CLASS(wxBitmapToggleButton
)
109 #endif // _WX_TOGGLEBUTTON_H_