back to gui 

wxCheckBox

generated from ../src/mod_gui/control/checkbox.cpp

A checkbox is a labeled box which is either on (checkmark is visible) or off (no checkmark).
An example:


   // dlg is a wxDialog
   var chkbox = new wxCheckBox(dlg, -1, "Check me");
   chkbox.onCheckBox = function(event)
   {
     if ( event.checked )
       wxMessageBox("Checked");
     else
       wxMessageBox("Unchecked");
   }
  
Because JavaScript doesn't allow to create properties which begin with a number, the styles wxCHK_3STATE and wxCHK_2STATE are ported as THREE_STATE and TWO_STATE.

Constants

style

Name Description
TWO_STATE
THREE_STATE
ALLOW_3RD_STATE_FOR_USER
ALIGN_RIGHT

wxCheckBoxState

Name Description
UNCHECKED
CHECKED
UNDETERMINED

Constructor

wxCheckBox

wxCheckBox()
 
wxCheckBox(Parent, 
           Id, 
           Text, 
           Pos = wxDefaultPosition, 
           Size = wxDefaultSize, 
           Style = 0, 
           Validator = null)
 
Name Type Default Description
Parent wxWindow The parent of the checkbox
Id Integer A window identifier. Use -1 when you don't need it
Text String The label of the checkbox
Pos wxPoint wxDefaultPosition The position of the checkbox on the given parent
Size wxSize wxDefaultSize The size of the checkbox
Style Integer 0 The style of the checkbox
Validator wxValidator null A validator

Constructs a new wxCheckBox object.

Properties

Name Type Description
checked read only Boolean Returns true when the checkbox is checked
thirdStateAllowedForUser read only Boolean Returns whether or not the user can set the checkbox to the third state.
threeState read only Boolean Returns whether or not the checkbox is a 3-state checkbox.
threeStateValue Integer Sets the checkbox to the given state.
value Boolean Checks/Unchecks the checkbox.

Methods

create

create(Parent, 
       Id, 
       Text, 
       Pos = wxDefaultPosition, 
       Size = wxDefaultSize, 
       Style = 0, 
       Validator = null) : Boolean
 
Name Type Default Description
Parent wxWindow The parent of the checkbox
Id Integer A window identifier. Use -1 when you don't need it
Text String The label of the checkbox
Pos wxPoint wxDefaultPosition The position of the checkbox on the given parent.
Size wxSize wxDefaultSize The size of the checkbox
Style Integer 0 The style of the checkbox
Validator wxValidator null A validator

Constructs a new wxCheckBox object.

Events

onCheckBox Called when the checkbox is clicked. The type of the argument that your handler receives is wxCommandEvent.


SourceForge.net Logo Support This Project

Table of Contents

Prototype

wxControl

Constructor

wxCheckBox

Properties

checked
thirdStateAllowedForUser
threeState
threeStateValue
value

Methods

create

Events

onCheckBox


Design downloaded from Zeroweb.org: Free website templates, layouts, and tools.