qnx.fuse.ui.buttons.CheckBox

CheckBox

Properties | Methods | Examples


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.



Class information:
PlayBook Tablet OS Version:   1.0.6

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] Returns the explicit height (actual height, in pixels) of the UI component.
UIComponent
 InheritedexplicitWidth : Number
[read-only] Returns the explicit width (actual width, in pixels) of the UI component.
UIComponent
 InheritedincludeInLayout : Boolean
Specifies whether or not the component should be included in its parent container's 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
Gets or sets the minimum preferred height of the control.
UIComponent
 InheritedminWidth : Number
Gets or 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

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
Returns the size options for the given control.
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
This method calls doMeasure() in order to calculate the preferred size of the control.
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
Performs a measurement on the control, and returns a LayoutMeasurement instance containing the available width and height within the layout.
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

labelPlacement


labelPlacement:String

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

Can be one of:

  • LabelPlacement.RIGHT
  • LabelPlacement.LEFT
  • LabelPlacement.TOP
  • LabelPlacement.BOTTOM

The default value is LabelPlacement.RIGHT.


Implementation

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

See also

LabelPlacement

Constructor Detail

CheckBox()


public function CheckBox()

Creates a new CheckBox instance.

Method Detail

updateSkin()


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;

        }
    }
}