Packageqnx.fuse.ui.buttons
Classpublic class CheckBox
InheritanceCheckBox Inheritance LabelButton Inheritance Button Inheritance SkinnableComponent Inheritance UIComponent Inheritance flash.display.MovieClip

The 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.

A check box.

You can adjust the position of the text relative to the check box by setting the labelPlacement property.

View the examples

See also

Button
ToggleSwitch


Public Properties
 PropertyDefined By
 InheritedembedFonts : Boolean
Gets or sets the embedFonts property of the internal TextField of the LabelButton.
LabelButton
 InheritedexplicitHeight : Number
[read-only]
UIComponent
 InheritedexplicitWidth : Number
[read-only]
UIComponent
 InheritedincludeInLayout : Boolean
Specifies if the component should be included in it's parent containers layout.
UIComponent
 Inheritedlabel : 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
 InheritedlayoutData : Object
Returns the layout data for the object.
UIComponent
 InheritedminHeight : Number
Sets the minimum preferred height of the control.
UIComponent
 InheritedminWidth : Number
Sets the minimum preferred width of the control.
UIComponent
 InheritedpaddingBottom : uint
Sets the number of extra pixels that are added on the bottom, between the text and the border of the button.
LabelButton
 InheritedpaddingLeft : uint
Sets the number of extra pixels that are added on the left, between the border of the button and the text.
LabelButton
 InheritedpaddingRight : uint
Sets the number of extra pixels that are added on the right, between the text and the border of the button.
LabelButton
 InheritedpaddingTop : uint
Sets the number of extra pixels that are added on the top, between the border of the button and the text.
LabelButton
 Inheritedselected : Boolean
Gets or sets the selected property of the button.
Button
 Inheritedstate : String
Gets or sets the state of the component.
SkinnableComponent
 Inheritedtoggle : Boolean
Gets or sets the toggle property of the button.
Button
 InheritedtruncationMode : String
Gets or sets the truncationMode of the button.
LabelButton
Protected Properties
 PropertyDefined By
 InheriteddisplayListIsInvalid : Boolean = false
UIComponent
 InheritedpropertiesAreInvalid : Boolean = false
UIComponent
 InheritedsizeChange : Boolean
UIComponent
 InheritedstateChanged : Boolean
UIComponent
Public Methods
 MethodDefined By
  
Creates a new CheckBox instance.
CheckBox
 Inherited
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
 Inherited
destroy():void
Call this method when you want to have your object collected by the garbage collector.
UIComponent
 Inherited
UIComponent
 Inherited
getTextFormatForState(state:String):TextFormat
Returns the TextFormat object for a specified state.
LabelButton
 Inherited
Calling this method results in a call to the components validateDisplayList() method before the display list is rendered.
UIComponent
 Inherited
Calling this method results in a call to the components validateProperties() method before the display list is rendered.
UIComponent
 Inherited
measure(availableWidth:Number, availableHeight:Number):LayoutMeasurement
UIComponent
 Inherited
setActualSize(w:Number, h:Number):void
Sets the width and height of the object without setting the explicitWidth and explicitHeight.
UIComponent
 Inherited
setLayoutBounds(bounds:Rectangle):void
Sets the receiver's size and location to the rectangular area specified by the arguments.
UIComponent
 Inherited
setPosition(x:Number, y:Number):void
Sets the x and y position of the component.
UIComponent
 Inherited
setSkin(newSkin:Object):void
Set the skin object on the component for it to render.
SkinnableComponent
 Inherited
setTextFormatForState(format:TextFormat, stateToModify:String):void
Sets the TextFormat object for the label for a given state.
LabelButton
 Inherited
Validates the display list of the component by calling the updateDisplayList().
UIComponent
 Inherited
Validates the component immediately by calling validateProperties(), validateSizes(), and validateDisplayList() if necessary.
UIComponent
 Inherited
Validates the properties of the component by calling the commitProperties() method.
UIComponent
Protected Methods
 MethodDefined By
 Inherited
Process properties of the component.
UIComponent
 Inherited
Process the state of the component.
UIComponent
 Inherited
doMeasure(availableWidth:Number, availableHeight:Number):LayoutMeasurement
UIComponent
 Inherited
flushCache():void
Invoked as part of parentLayoutChanged.
UIComponent
 Inherited
onAdded():void
Called when the instance is added to the stage.
UIComponent
 Inherited
onRemoved():void
Called when the instance is removed from the stage.
UIComponent
 Inherited
Invalidates the parent's size and display list if includeInLayout property is set to true.
UIComponent
 Inherited
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
Property Detail
labelPlacementproperty
labelPlacement:String

Gets or sets the placement of the label according to the skin.

Can be one of:

The default value is LabelPlacement.RIGHT.


Implementation
    public function get labelPlacement():String
    public function set labelPlacement(value:String):void

See also

Constructor Detail
CheckBox()Constructor
public function CheckBox()

Creates a new CheckBox instance.

Method Detail
updateSkin()method
override protected function updateSkin(unscaledWidth:Number, unscaledHeight:Number):void

Parameters

unscaledWidth:Number
 
unscaledHeight:Number

Examples

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;
            
        }
    }
}