1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/univ/tglbtn.cpp
3 // Purpose: wxToggleButton
4 // Author: Vadim Zeitlin
5 // Modified by: David Bjorkevik
7 // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #include "wx/wxprec.h"
19 #include "wx/tglbtn.h"
21 wxDEFINE_EVENT( wxEVT_TOGGLEBUTTON
, wxCommandEvent
);
23 IMPLEMENT_DYNAMIC_CLASS(wxToggleButton
, wxButton
)
25 wxToggleButton
::wxToggleButton()
30 wxToggleButton
::wxToggleButton(wxWindow
*parent
,
32 const wxBitmap
& bitmap
,
33 const wxString
& label
,
37 const wxValidator
& validator
,
41 Create(parent
, id
, bitmap
, label
, pos
, size
, style
, validator
, name
);
44 wxToggleButton
::wxToggleButton(wxWindow
*parent
,
46 const wxString
& label
,
50 const wxValidator
& validator
,
54 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
57 wxToggleButton
::~wxToggleButton()
61 void wxToggleButton
::Init()
67 void wxToggleButton
::Toggle()
76 // releasing button after it had been pressed generates a click event
83 void wxToggleButton
::Click()
85 wxCommandEvent
event(wxEVT_TOGGLEBUTTON
, GetId());
86 InitCommandEvent(event
);
87 event
.SetInt(GetValue());
91 void wxToggleButton
::SetValue(bool state
)
97 #endif // wxUSE_TOGGLEBTN