| Package | qnx.fuse.ui.buttons |
| Class | public class CheckBox |
| Inheritance | CheckBox LabelButton Button SkinnableComponent UIComponent flash.display.MovieClip |
CheckBox class is a simple subclass of the LabelButton class. The CheckBox class provides simple binary check box
functionality for your application. The CheckBox
class has its toggle property set to true. This property cannot be changed.
You can adjust the position of the text relative to the check box by setting the labelPlacement property.
See also
| Property | Defined By | ||
|---|---|---|---|
![]() | embedFonts : Boolean
Gets or sets the embedFonts property of the internal TextField of the LabelButton. | LabelButton | |
![]() | explicitHeight : Number [read-only] | UIComponent | |
![]() | explicitWidth : Number [read-only] | UIComponent | |
![]() | includeInLayout : Boolean
Specifies if the component should be included in it's parent containers layout. | UIComponent | |
![]() | label : String
Gets or sets the label for the button. | LabelButton | |
| labelPlacement : String
Gets or sets the placement of the label according to the skin. | CheckBox | ||
![]() | layoutData : Object
Returns the layout data for the object. | UIComponent | |
![]() | minHeight : Number
Sets the minimum preferred height of the control. | UIComponent | |
![]() | minWidth : Number
Sets the minimum preferred width of the control. | UIComponent | |
![]() | paddingBottom : uint
Sets the number of extra pixels that are added on the bottom, between the text and the border of the button. | LabelButton | |
![]() | paddingLeft : uint
Sets the number of extra pixels that are added on the left, between the border of the button and the text. | LabelButton | |
![]() | paddingRight : uint
Sets the number of extra pixels that are added on the right, between the text and the border of the button. | LabelButton | |
![]() | paddingTop : uint
Sets the number of extra pixels that are added on the top, between the border of the button and the text. | LabelButton | |
![]() | selected : Boolean
Gets or sets the selected property of the button. | Button | |
![]() | state : String
Gets or sets the state of the component. | SkinnableComponent | |
![]() | toggle : Boolean
Gets or sets the toggle property of the button. | Button | |
![]() | truncationMode : String
Gets or sets the truncationMode of the button. | LabelButton | |
| Method | Defined By | ||
|---|---|---|---|
CheckBox()
Creates a new CheckBox instance. | CheckBox | ||
![]() | childChanged(resizedChild:DisplayObject = null):Boolean
Notifies the UIComponent that one or more of its children has changed in a manner
that may affect this object's layout. | UIComponent | |
![]() | destroy():void
Call this method when you want to have your object collected by the garbage collector. | UIComponent | |
![]() | getSizeOptions():int | UIComponent | |
![]() | getTextFormatForState(state:String):TextFormat
Returns the TextFormat object for a specified state. | LabelButton | |
![]() | invalidateDisplayList():void
Calling this method results in a call to the components validateDisplayList() method before the display list is rendered. | UIComponent | |
![]() | invalidateProperties():void
Calling this method results in a call to the components validateProperties() method before the display list is rendered. | UIComponent | |
![]() | measure(availableWidth:Number, availableHeight:Number):LayoutMeasurement | UIComponent | |
![]() | setActualSize(w:Number, h:Number):void
Sets the width and height of the object without setting
the explicitWidth and explicitHeight. | UIComponent | |
![]() | setLayoutBounds(bounds:Rectangle):void
Sets the receiver's size and location to the rectangular area specified
by the arguments. | UIComponent | |
![]() | setPosition(x:Number, y:Number):void
Sets the x and y position of the component. | UIComponent | |
![]() | setSkin(newSkin:Object):void
Set the skin object on the component for it to render. | SkinnableComponent | |
![]() | setTextFormatForState(format:TextFormat, stateToModify:String):void
Sets the TextFormat object for the label for a given state. | LabelButton | |
![]() | validateDisplayList():void
Validates the display list of the component by calling the updateDisplayList(). | UIComponent | |
![]() | validateNow():void
Validates the component immediately by calling validateProperties(), validateSizes(), and validateDisplayList() if necessary. | UIComponent | |
![]() | validateProperties():void
Validates the properties of the component by calling the commitProperties() method. | UIComponent | |
| Method | Defined By | ||
|---|---|---|---|
![]() | commitProperties():void
Process properties of the component. | UIComponent | |
![]() | commitState():void
Process the state of the component. | UIComponent | |
![]() | doMeasure(availableWidth:Number, availableHeight:Number):LayoutMeasurement | UIComponent | |
![]() | flushCache():void
Invoked as part of parentLayoutChanged. | UIComponent | |
![]() | onAdded():void
Called when the instance is added to the stage. | UIComponent | |
![]() | onRemoved():void
Called when the instance is removed from the stage. | UIComponent | |
![]() | parentLayoutChanged():void
Invalidates the parent's size and display list if includeInLayout property is set to true. | UIComponent | |
![]() | updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
Sets the size and position of the children of the component. | UIComponent | |
updateSkin(unscaledWidth:Number, unscaledHeight:Number):void [override] | CheckBox | ||
| labelPlacement | property |
labelPlacement:StringGets or sets the placement of the label according to the skin.
Can be one of:
LabelPlacement.RIGHTLabelPlacement.LEFTLabelPlacement.TOPLabelPlacement.BOTTOM The default value is .LabelPlacement.RIGHT
public function get labelPlacement():String public function set labelPlacement(value:String):voidSee also
| CheckBox | () | Constructor |
public function CheckBox()
Creates a new CheckBox instance.
| updateSkin | () | method |
override protected function updateSkin(unscaledWidth:Number, unscaledHeight:Number):voidParameters
unscaledWidth:Number | |
unscaledHeight:Number |
In the following example, a CheckBox is used to disable a set of controls.
package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
import qnx.fuse.ui.buttons.CheckBox;
import qnx.fuse.ui.buttons.LabelButton;
import qnx.fuse.ui.text.TextInput;
[SWF(height="600", width="1024", frameRate="30",
backgroundColor="#FFFFFF")]
public class checkBoxSample extends Sprite
{
private var myCheckBox:CheckBox;
private var myButton:LabelButton;
private var myText:TextInput;
public function checkBoxSample()
{
initializeUI();
}
private function initializeUI():void
{
myCheckBox = new CheckBox();
myCheckBox.setPosition(175, 350);
myCheckBox.width = 200;
myCheckBox.label = "Disable login";
myCheckBox.addEventListener(MouseEvent.CLICK, disableButton);
this.addChild(myCheckBox);
myButton = new LabelButton();
myButton.setPosition(175, 300);
myButton.width = 100;
myButton.label = "Login";
this.addChild(myButton);
myText = new TextInput();
myText.setPosition(175, 250);
myText.width = 150;
this.addChild(myText);
}
private function disableButton(e:MouseEvent):void
{
myButton.enabled = !myButton.enabled;
myText.enabled = !myText.enabled;
}
}
}