wxCheckBox Class Reference

#include <checkbox.h>

Inherits wxControl.

List of all members.

Public Member Functions

bool Create (wxWindow *parent, wxWindowID id=-1, const wxString &label=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxPyCheckBoxNameStr)
wxCheckBoxState Get3StateValue () const
bool GetValue ()
bool Is3rdStateAllowedForUser () const
bool Is3State () const
bool IsChecked ()
void Set3StateValue (wxCheckBoxState state)
void SetValue (const bool state)
 wxCheckBox ()
 wxCheckBox (wxWindow *parent, wxWindowID id=-1, const wxString &label=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxPyCheckBoxNameStr)

Static Public Member Functions

static wxVisualAttributes GetClassDefaultAttributes (wxWindowVariant variant=wxWINDOW_VARIANT_NORMAL)


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

StyleDescription
wxCHK_2STATE Create a 2-state checkbox. This is the default.

wxCHK_3STATE Create a 3-state checkbox. Not implemented in wxMGL, wxOS2 and wxGTK built against GTK+ 1.2.

wxCHK_ALLOW_3RD_STATE_FOR_USER By default a user can't set a 3-state checkbox to the third state. It can only be done from code. Using this flags allows the user to set the checkbox to the third state by clicking.

wxALIGN_RIGHT Makes the text appear on the left of the checkbox.

Events

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


Constructor & Destructor Documentation

wxCheckBox::wxCheckBox ( wxWindow parent,
wxWindowID  id = -1,
const wxString &  label = wxEmptyString,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = 0,
const wxValidator validator = wxDefaultValidator,
const wxString &  name = wxPyCheckBoxNameStr 
)

wxCheckBox::wxCheckBox (  ) 


Member Function Documentation

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

Creates the checkbox for two-step construction. See wxCheckBox::wxCheckBox for details.

wxCheckBoxState wxCheckBox::Get3StateValue (  )  const

Gets the state of a 3-state checkbox.

Returns:
Returns wxCHK_UNCHECKED when the checkbox is unchecked, wxCHK_CHECKED when it is checked and wxCHK_UNDETERMINED when it's in the undetermined state. Asserts when the function is used with a 2-state checkbox.

static wxVisualAttributes wxCheckBox::GetClassDefaultAttributes ( wxWindowVariant  variant = wxWINDOW_VARIANT_NORMAL  )  [static]

Returns the default font and colours which are used by the control. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the users system, especially if it uses themes.

The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See wxWindow::SetWindowVariant for more about this.

This static method is "overridden'' in many derived classes and so calling, for example, wxButton::GetClassDefaultAttributes() will typically return the values appropriate for a button which will be normally different from those returned by, say, wxListCtrl::GetClassDefaultAttributes().

The wxVisualAttributes structure has at least the fields font, colFg and colBg. All of them may be invalid if it was not possible to determine the default control appearance or, especially for the background colour, if the field doesn't make sense as is the case for colBg for the controls with themed background.

Reimplemented from wxControl.

bool wxCheckBox::GetValue (  ) 

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:
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:
Returns true if this checkbox is a 3-state checkbox, false if it's a 2-state checkbox.

bool wxCheckBox::IsChecked (  ) 

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  ) 

void wxCheckBox::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 If true, the check is on, otherwise it is off.


The documentation for this class was generated from the following file:
Generated on Sun Sep 16 16:04:56 2007 for wxWidgets by  doxygen 1.5.3