Contents Up Previous Next

wxCheckBox

A checkbox is a labelled box which is either on (checkmark is visible) or off (no checkmark).

Derived from

wxControl
wxWindow
wxEvtHandler
wxObject

Include files

<wx/checkbox.h>

Window styles

There are no special styles for wxCheckBox.

See also window styles overview.

Event handling

EVT_CHECKBOX(id, func) Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked.

See also

wxRadioButton, wxCommandEvent

Members

wxCheckBox::wxCheckBox
wxCheckBox::~wxCheckBox
wxCheckBox::Create
wxCheckBox::GetValue
wxCheckBox::SetValue


wxCheckBox::wxCheckBox

wxCheckBox()

Default constructor.

wxCheckBox(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 checkbox.

Parameters

parent

id

label

pos

size

style

validator

name

See also

wxCheckBox::Create, wxValidator


wxCheckBox::~wxCheckBox

~wxCheckBox()

Destructor, destroying the checkbox.


wxCheckBox::Create

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 checkbox for two-step construction. See wxCheckBox::wxCheckBox for details.


wxCheckBox::GetValue

bool GetValue() const

Gets the state of the checkbox.

Return value

Returns TRUE if it is checked, FALSE otherwise.


wxCheckBox::SetValue

void SetValue(const bool state)

Sets the checkbox to the given state. This does not cause a wxEVT_COMMAND_CHECKBOX_CLICKED event to get emitted.

Parameters

state