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.
継承元
wxControl
wxWindow
wxEvtHandler
wxObject
インクルードファイル
<wx/tglbtn.h>
ウィンドウスタイル
There are no special styles for wxToggleButton.
See also window styles overview.
Event handling
EVT_TOGGLEBUTTON(id, func) | Handles a toggle button click event. |
参照
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
参照
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