Contents Up Previous Next

wxCheckBox: wxItem

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

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


wxCheckBox::wxCheckBox

void wxCheckBox(void)

Constructor, used when deriving from this class.

void wxCheckBox(wxPanel *parent, wxFunction func, char *label,
int x = -1, int y = -1, int width = -1, int height = -1,
long style = 0, char *name = "checkBox")

void wxCheckBox(wxPanel *parent, wxFunction func, wxBitmap *bitmap,
int x = -1, int y = -1, int width = -1, int height = -1,
long style = 0, char *name = "checkBox")

Constructor, creating and showing a checkbox.

func may be NULL; otherwise it is used as the callback for the check box. Note that the cast (wxFunction) must be used when passing your callback function name, or the compiler may complain that the function does not match the constructor declaration.

In the second form, if label is non-NULL, it is used as the label for the checkbox. In the third form, a bitmap is provided instead of a text label.

The parameters x and y are used to specify an absolute position, or a position after the previous panel item if omitted or default.

If width or height are omitted (or are less than zero), an appropriate size will be used for the check box.

The style parameter is reserved for future use.

The name parameter is used to associate a name with the item, allowing the application user to set Motif resource values for individual checkboxes.


wxCheckBox::~wxCheckBox

void ~wxCheckBox(void)

Destructor, destroying the checkbox.


wxCheckBox::Create

Bool Create(wxPanel *parent, wxFunction func, char *label,
int x = -1, int y = -1, int width = -1, int height = -1,
long style = 0, char *name = "checkBox")

Bool Create(wxPanel *parent, wxFunction func, char *bitmap,
int x = -1, int y = -1, int width = -1, int height = -1,
long style = 0, char *name = "checkBox")

Creates the checkbox for two-step construction. Derived classes should call or replace this function. See wxCheckBox::wxCheckBox for details.


wxCheckBox::GetValue

Bool GetValue(void)

Gets the state of the checkbox, TRUE if it is checked, FALSE otherwise.


wxCheckBox::SetLabel

void SetLabel(wxBitmap *label)

Sets the bitmap for a bitmap checkbox.


wxCheckBox::SetValue

void SetValue(Bool state)

Sets the checkbox to the given state: if the state is TRUE, the check is on, otherwise it is off.