Class CheckBox
Object
|
+--Widget
|
+--CheckBox
- class
CheckBox
- extends Widget
Raises:
click
- when the checked-state changes. Event listeners are passed a
boolean
value that is the checkbox's current state.
Defined in form_widgets.js
Constructor Summary |
CheckBox
(unused1, <boolean> defaultValue, unused2, unused3, <Function> onClick)
Creates a standard checkbox widget.
|
Method Summary |
void
|
check()
Sets the checkbox's state to checked.
|
boolean
|
getStatus()
Returns the checkbox's checked-state.
|
void
|
setChecked(<boolean> status)
Sets the checkbox's checked-state to status .
|
void
|
toggle()
Toggles the checkbox's state, either from checked
to unchecked or from unchecked to checked.
|
void
|
uncheck()
Sets the checkbox's state to unchecked.
|
Methods inherited from class Widget |
installContextMenu, installDefaultContextMenu, uninstallContextMenu, isDraggable, setDraggable, addEventListener, blur, createEventTable, dispose, focus, getAbsoluteBottom, getAbsoluteLeft, getAbsoluteRight, getAbsoluteTop, getBottom, getBounds, getClientHeight, getClientWidth, getCorner, getHeight, getLeft, getPixelsPerEm, getRight, getToolTip, getTop, getWidth, isDisposed, isEnabled, layout, moveToAbsolute, moveTo, raiseEvent, registerEventType, removeEventListener, setAbsoluteBottom, setAbsoluteLeft, setAbsoluteRight, setAbsoluteTop, setBottom, setBounds, setEnabled, setHeight, setLeft, setRight, setToolTip, setTop, setWidth, setParent, toString
|
CheckBox
function CheckBox(unused1, <boolean> defaultValue, unused2, unused3, <Function> onClick)
Creates a standard checkbox widget.
A CheckBox is a control that can be toggled between two states a) Selected
or checked and b) unselected or unchecked. The state of the check box can
be changed pragmatically with the setChecked or toggle methods. It can
also be changed by having the user click inside of the box.
An onclick event handler can optionally be added to the Widget that will
be called to response to state changes.
Always use the constructor to set the initial checked/unchecked state
of a CheckBox. In IE the setChecked() or check() methods will not
properly change the state if they are called before the widget has been
drawn on the screen.
Parameters:
unused1
- this parameter is deprecated
defaultValue
- (Optional) - the default checked state. Pass true
false for unchecled. Defaults to false
.
unused2
- this parameter is deprecated
unused3
- this parameter is deprecated
onClick
- a default click-listener. The click-listener is passed the current state as its only parameter.
check
void check()
Sets the checkbox's state to checked.
getStatus
boolean getStatus()
Returns the checkbox's checked-state.
Returns:
true
if the checkbox is checked and false
otherwise
setChecked
void setChecked(<boolean> status)
Sets the checkbox's checked-state to status
.
Parameters:
status
- the new checked-state for the checkbox. true
checks the box and false
unchecks it.
toggle
void toggle()
Toggles the checkbox's state, either from checked
to unchecked or from unchecked to checked.
uncheck
void uncheck()
Sets the checkbox's state to unchecked.
