Version: 2.9.4
Public Member Functions
wxCheckBox Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/checkbox.h>

Inheritance diagram for wxCheckBox:

Detailed Description

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

Optionally (when the wxCHK_3STATE style flag is set) it can have a third state, called the mixed or undetermined state. Often this is used as a "Does Not Apply" state.

Styles

This class supports the following styles:

Events emitted by this class

The following event handler macros redirect the events to member function handlers 'func' with prototypes like:

void handlerFuncName(wxCommandEvent& event)

Event macros for events emitted by this class:

Library:  wxCore
Category:  Controls

Appearance:
wxMSW appearancewxGTK appearancewxMac appearance
wxMSW appearancewxGTK appearancewxMac appearance
参照:
wxRadioButton, wxCommandEvent

Public Member Functions

 wxCheckBox ()
 Default constructor.
 wxCheckBox (wxWindow *parent, wxWindowID id, const wxString &label, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxCheckBoxNameStr)
 Constructor, creating and showing a checkbox.
virtual ~wxCheckBox ()
 Destructor, destroying the checkbox.
bool Create (wxWindow *parent, wxWindowID id, const wxString &label, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxCheckBoxNameStr)
 Creates the checkbox for two-step construction.
virtual bool GetValue () const
 Gets the state of a 2-state checkbox.
wxCheckBoxState Get3StateValue () const
 Gets the state of a 3-state checkbox.
bool Is3State () const
 Returns whether or not the checkbox is a 3-state checkbox.
bool Is3rdStateAllowedForUser () const
 Returns whether or not the user can set the checkbox to the third state.
bool IsChecked () const
 This is just a maybe more readable synonym for GetValue(): just as the latter, it returns true if the checkbox is checked and false otherwise.
virtual void SetValue (bool state)
 Sets the checkbox to the given state.
void Set3StateValue (wxCheckBoxState state)
 Sets the checkbox to the given state.

List of all members.


Constructor & Destructor Documentation

wxCheckBox::wxCheckBox ( )

Default constructor.

参照:
Create(), wxValidator
wxCheckBox::wxCheckBox ( wxWindow parent,
wxWindowID  id,
const wxString label,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = 0,
const wxValidator validator = wxDefaultValidator,
const wxString name = wxCheckBoxNameStr 
)

Constructor, creating and showing a checkbox.

Parameters:
parentParent window. Must not be NULL.
idCheckbox identifier. The value wxID_ANY indicates a default value.
labelText to be displayed next to the checkbox.
posCheckbox position. If wxDefaultPosition is specified then a default position is chosen.
sizeCheckbox size. If wxDefaultSize is specified then a default size is chosen.
styleWindow style. See wxCheckBox.
validatorWindow validator.
nameWindow name.
参照:
Create(), wxValidator
virtual wxCheckBox::~wxCheckBox ( ) [virtual]

Destructor, destroying the checkbox.


Member Function Documentation

bool wxCheckBox::Create ( wxWindow parent,
wxWindowID  id,
const wxString label,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = 0,
const wxValidator validator = wxDefaultValidator,
const wxString name = wxCheckBoxNameStr 
)

Creates the checkbox for two-step construction.

See wxCheckBox() for details.

wxCheckBoxState wxCheckBox::Get3StateValue ( ) const

Gets the state of a 3-state checkbox.

Asserts when the function is used with a 2-state checkbox.

virtual bool wxCheckBox::GetValue ( ) const [virtual]

Gets the state of a 2-state checkbox.

Returns:
Returns true if it is checked, false otherwise.
bool wxCheckBox::Is3rdStateAllowedForUser ( ) const

Returns whether or not the user can set the checkbox to the third state.

Returns:
true if the user can set the third state of this checkbox, false if it can only be set programmatically or if it's a 2-state checkbox.
bool wxCheckBox::Is3State ( ) const

Returns whether or not the checkbox is a 3-state checkbox.

Returns:
true if this checkbox is a 3-state checkbox, false if it's a 2-state checkbox.
bool wxCheckBox::IsChecked ( ) const

This is just a maybe more readable synonym for GetValue(): just as the latter, it returns true if the checkbox is checked and false otherwise.

void wxCheckBox::Set3StateValue ( wxCheckBoxState  state)

Sets the checkbox to the given state.

This does not cause a wxEVT_COMMAND_CHECKBOX_CLICKED event to get emitted.

Asserts when the checkbox is a 2-state checkbox and setting the state to wxCHK_UNDETERMINED.

virtual void wxCheckBox::SetValue ( bool  state) [virtual]

Sets the checkbox to the given state.

This does not cause a wxEVT_COMMAND_CHECKBOX_CLICKED event to get emitted.

Parameters:
stateIf true, the check is on, otherwise it is off.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines