Package | com.ghostwire.ui.controls |
Class | public class uiCheckBox |
Inheritance | uiCheckBox ![]() ![]() ![]() ![]() |
Subclasses | uiRadioButton |
uiCheckBox
component toggles its selected
property when it is clicked. This
control is used to give the user an option, such as true/false or yes/no. The component is typically
rendered as an empty box when the selected
property is false
and a box with
a check inside when the property is true
. The uiCheckBox
component can display,
next to itself, an uiImage
or uiText
or both (the component contains a
uiLabel
instance which in turn contains the uiImage
and/or
uiText
instances).
"group" Property
Note: if you set the group
property to an existing uiButtonGroup
object, the
uiCheckBox
will behave as a uiRadioButton
.
"skin" Property
The default value is "CheckBox"
and the asset(s) used are:
CheckBox.png
"toggle" Property
Always true
- attempting to set this property will throw an error.
~ This class is available in Aspire UI Components Lite Edition ~
Property | Defined by | ||
---|---|---|---|
![]() | alignX : Number
Indicates how the component would like to be aligned horizontally within its allocated space.
| uiComponent | |
![]() | alignY : Number
Indicates how the component would like to be aligned vertically within its allocated space.
| uiComponent | |
![]() | background : Object
Indicates the style of the background for this component.
| uiComponent | |
![]() | container : uiComponent
Indicates the
uiComponent instance that contains this instance. | uiComponent | |
![]() | data : Object
Indicates the data to be associated with this button.
| uiButton | |
![]() | depth : int
Indicates how deep the component is in the containment hierarchy.
| uiComponent | |
![]() | desiredAllocationHeight : int
Indicates the vertical space this component would like to be allocated.
| uiComponent | |
![]() | desiredAllocationWidth : int
Indicates the horizontal space this component would like to be allocated.
| uiComponent | |
![]() | displaceX : int
Indicates the amount of pixels to move any embedded child object horizontally to the right when the
button is pressed down.
| uiButton | |
![]() | displaceY : int
Indicates the amount of pixels to move any embedded child object vertically downwards when the
button is pressed down.
| uiButton | |
![]() | enabled : Boolean
Indicates whether the component is enabled for user interaction.
| uiComponent | |
![]() | fillX : Boolean
Indicates whether or not the component should automatically expand or shrink to fill its allocated
horizontal space.
| uiComponent | |
![]() | fillY : Boolean
Indicates whether or not the component should automatically expand or shrink to fill its allocated
vertical space.
| uiComponent | |
![]() | focusPadding : Object
Indicates the thickness of the interior space from the edge of the component to the focus
rectangle.
| uiComponent | |
![]() | focusRect : Object
Indicates the class to use when rendering the rectangle around the component to indicate that it
is in focus.
| uiComponent | |
![]() | group : uiButtonGroup
Indicates the
uiButtonGroup this button is assigned to. | uiButton | |
![]() | height : Number
Indicates the current
height of the component. | uiComponent | |
![]() | image : String
Indicates the source to the image displayed inside/beside the button.
| uiLabelButton | |
labelMargin : Object
Indicates the spacing that should be applied around the
uiLabel instance. | uiCheckBox | ||
labelPosition : int
Indicates the position of the
uiLabel instance (which contains the uiImage
and/or uiText ) vis-a-vis the checkbox. | uiCheckBox | ||
![]() | margin : Object
Indicates the thickness of the space surrounding the component.
| uiComponent | |
![]() | maxHeight : int
Indicates the upper limit for
height . | uiComponent | |
![]() | maxWidth : int
Indicates the upper limit for
width . | uiComponent | |
![]() | minHeight : int
Indicates the lower limit for
height . | uiComponent | |
![]() | minWidth : int
Indicates the lower limit for
width . | uiComponent | |
![]() | padding : Object
Indicates the thickness of the interior space from the edge of the component to the content area,
which is where child components, if any, are contained.
| uiComponent | |
![]() | selected : Boolean
Indicates whether the button is selected; applicable only if the
toggle property is
set to true . | uiButton | |
![]() | skin : String
Indicates the name of the skin to use for this component instance.
| uiComponent | |
![]() | stretch : Boolean
Indicates whether surplus space available in the parent container should be allocated to this
component.
| uiComponent | |
![]() | text : String
Indicates the text displayed inside/beside the button.
| uiLabelButton | |
![]() | textPosition : int
Indicates the position of the
uiText instance vis-a-vis the uiImage
instance, if any. | uiLabelButton | |
![]() | textStyle : String
Indicates the style to use for
uiText instances contained in this component. | uiComponent | |
![]() | toggle : Boolean
Indicates whether the button should toggle its
selected property value between
true and false when it is clicked. | uiButton | |
![]() | toolTip : Object
Indicates the content (text) of the tooltip that should be shown when the mouse hovers
over this control.
| uiComponent | |
![]() | uilabel : uiLabel
Returns the embedded
uiLabel instance - for advanced users only. | uiLabelButton | |
![]() | uiskin : uiBitmapImage
Returns the
uiBitmapImage rendered as the skin - for advanced users only. | uiComponent | |
![]() | uitext : uiText
Returns the embedded
uiText instance - for advanced users only. | uiLabelButton | |
![]() | visible : Boolean
Indicates whether or not the component is visible within its container.
| uiComponent | |
![]() | width : Number
Indicates the current
width of the component. | uiComponent |
Method | Defined by | ||
---|---|---|---|
uiCheckBox(text:String = null, image:String = null, textPosition:int = 0, labelPosition:int = 0)
Constructor - creates a new
uiCheckBox instance. | uiCheckBox | ||
![]() |
activate(noEvent:Boolean = false):void
Activates and gives focus to the button as if the button has been clicked on (a
MouseEvent.CLICK event will be dispatched). | uiButton | |
![]() |
invalidate(type:String):void
Invalidates this component's "size", "display", "layout" or "textstyle".
| uiComponent | |
![]() |
move(x:Number, y:Number, noEvent:Boolean = false):void
Moves the component to the specified position, disregarding its allocation.
| uiComponent | |
![]() |
removeAllChildren(all:Boolean = false):void
Removes all children from this component.
| uiComponent | |
![]() |
setFocus(flag:Boolean = true):void
Gives this component instance the focus; the component must be on the display list and has its
tabEnabled property set to true , otherwise this method will fail
silently. | uiComponent | |
![]() |
setSize(width:Number, height:Number, noEvent:Boolean = false):void
Sets this component's size to the specified
width and height . | uiComponent | |
![]() |
setVisible(value:Boolean, noEvent:Boolean = false):void
Sets the visibility of this component instance, dispatching a "show" or "hide" event accordingly.
| uiComponent | |
![]() |
validateNow():void
Validates and render the component instance, and any component instances with
depth higher than itself in the validation queue, immediately. | uiComponent |
labelMargin | property |
labelMargin:Object
[read-write]
Indicates the spacing that should be applied around the uiLabel
instance. You can use
this property to specify the spacing between the check box and the label, for example:
var mycheck:uiCheckBox = new uiCheckBox("Item A"); mycheck.labelMargin = "0,0,0,4"; // 0px margin top, left, bottom; 4px margin left
public function get labelMargin():Object
public function set labelMargin(value:Object):void
labelPosition | property |
labelPosition:int
[read-write]
Indicates the position of the uiLabel
instance (which contains the uiImage
and/or uiText
) vis-a-vis the checkbox. Qualified values are POSITION.LEFT
,
POSITION.RIGHT
, POSITION.TOP
or POSITION.BOTTOM
. By default,
the uiLabel
will be positioned to the right of the checkbox.
public function get labelPosition():int
public function set labelPosition(value:int):void
See also
uiCheckBox | () | constructor |
public function uiCheckBox(text:String = null, image:String = null, textPosition:int = 0, labelPosition:int = 0)
Constructor - creates a new uiCheckBox
instance.
text:String (default = null ) — A String value specifying the text to display next to the checkbox.
|
|
image:String (default = null ) — A String value indicating the source to the image/icon to be displayed next to the
checkbox.
|
|
textPosition:int (default = 0 ) — A String value indicating the position of the uiText
instance vis-a-vis the uiImage instance, if any. Qualified values are
POSITION.LEFT , POSITION.RIGHT , POSITION.TOP or
POSITION.BOTTOM . By default, the uiText is placed to the right
of the uiImage .
|
|
labelPosition:int (default = 0 ) — A String value indicating the position of the label (text/icon) vis-a-vis
the checkbox. Qualified values are POSITION.LEFT , POSITION.RIGHT ,
POSITION.TOP or POSITION.BOTTOM . By default, the label is positioned to
the right of the checkbox.
|