qnx.fuse.ui.buttons.CheckBox

CheckBox

Properties | Methods | Examples


Packageqnx.fuse.ui.buttons
Classpublic class CheckBox
InheritanceCheckBox Inheritance qnx.fuse.ui.buttons.ToggleButtonBase

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:
BlackBerry 10 Version:   10.0.0
Found in:  qnxui.swc

View the examples

See also

Button
ToggleSwitch



Protected Properties

 PropertyDefined By
  cssID : String
[override] [read-only] Returns the CSS ID of the component.
CheckBox

Public Methods

 MethodDefined By
  
Creates a new CheckBox instance.
CheckBox

Property Detail

cssID


cssID:String  [read-only]
[override]

Returns the CSS ID of the component. The CSS ID is used for identifying the type of component in CSS.

The default value is CheckBox.


Implementation

protected function get cssID():String

Constructor Detail

CheckBox()


public function CheckBox()

Creates a new CheckBox instance.

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(frameRate="60", 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;
        }
    }
}
     




comments powered by Disqus