1 /////////////////////////////////////////////////////////////////////////////
2 // Name: univ/tglbtn.cpp
3 // Purpose: wxToggleButton
4 // Author: Vadim Zeitlin
5 // Modified by: David Bjorkevik
8 // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
20 #include "wx/tglbtn.h"
22 wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED
, wxCommandEvent
);
24 IMPLEMENT_DYNAMIC_CLASS(wxToggleButton
, wxButton
)
26 wxToggleButton::wxToggleButton()
31 wxToggleButton::wxToggleButton(wxWindow
*parent
,
33 const wxBitmap
& bitmap
,
34 const wxString
& label
,
38 const wxValidator
& validator
,
42 Create(parent
, id
, bitmap
, label
, pos
, size
, style
, validator
, name
);
45 wxToggleButton::wxToggleButton(wxWindow
*parent
,
47 const wxString
& label
,
51 const wxValidator
& validator
,
55 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
58 wxToggleButton::~wxToggleButton()
62 void wxToggleButton::Init()
68 void wxToggleButton::Toggle()
77 // releasing button after it had been pressed generates a click event
84 void wxToggleButton::Click()
86 wxCommandEvent
event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED
, GetId());
87 InitCommandEvent(event
);
88 event
.SetInt(GetValue());
92 void wxToggleButton::SetValue(bool state
)
98 #endif // wxUSE_TOGGLEBTN