$szTitle = "wxtogglebutton"; include "./_header.inc"; ?>
wxtogglebutton is a button that stays pressed when clicked by the user. in other words, it is similar to wxcheckbox in functionality but looks like a wxbutton.
you can see wxtogglebutton in action in the sixth page of the controls sample.
derived from
wxcontrol
wxwindow
wxevthandler
wxobject
include files
<wx/tglbtn.h>
window styles
there are no special styles for wxtogglebutton.
see also window styles overview.
event handling
evt_togglebutton(id, func) | handles a toggle button click event. |
see also
members
wxtogglebutton::wxtogglebutton
wxtogglebutton::~wxtogglebutton
wxtogglebutton::create
wxtogglebutton::getvalue
wxtogglebutton::setvalue
wxtogglebutton()
default constructor.
wxtogglebutton(wxwindow* parent, wxwindowid id, const wxstring& label, const wxpoint& pos = wxdefaultposition, const wxsize& size = wxdefaultsize, long style = 0, const wxvalidator& val, const wxstring& name = "checkbox")
constructor, creating and showing a toggle button.
parameters
parent
id
label
pos
size
style
validator
name
see also
wxtogglebutton::create, wxvalidator
~wxtogglebutton()
destructor, destroying the toggle button.
bool create(wxwindow* parent, wxwindowid id, const wxstring& label, const wxpoint& pos = wxdefaultposition, const wxsize& size = wxdefaultsize, long style = 0, const wxvalidator& val, const wxstring& name = "checkbox")
creates the toggle button for two-step construction. see wxtogglebutton::wxtogglebutton for details.
bool getvalue() const
gets the state of the toggle button.
return value
returns true if it is pressed, false otherwise.
void setvalue(const bool state)
sets the toggle button to the given state. this does not cause a evt_togglebutton event to be emitted.
parameters
state