Packageorg.openPyro.core
Classpublic class UIControl
InheritanceUIControl Inheritance MeasurableControl Inheritance flash.display.Sprite
ImplementsISkin, ISkinClient
SubclassesAbstractButtonSkin, AuroraPainterButtonSkin, Button, ComboBox, DefaultListRenderer, GradientRectSkin, HDividerSkin, Image, Label, ProgressBar, Slider, UIContainer

The UIControl is the basic building block for pyro controls. UIControls extend from Measurable control so can use all the different sizing properties like explicit or percent widths/heights. UIControls can also include other UIControls as children but cannot use layouts to position them. To use layouts, use UIContainers. UIControls also implement the ISkinClient interface so can be skinned and the ISkin interface so themselves can be used as base classes for skins



Public Properties
 PropertyDefined by
  backgroundPainter : IPainter
UIControls can have a backgroundPainter object attached that is triggered everytime updateDisplayList is called.
UIControl
 InheritedcreationCompleteFired : Boolean
MeasurableControl
 InheriteddisplayListInvalidated : Boolean = true
Flag to mark a dirty displaylist.
MeasurableControl
  dragData : Object
UIControl
  dragEnabled : Boolean
UIControl
  dropEnabled : Boolean
[write-only]
UIControl
 InheritedexplicitWidth : Number
The height set in terms of actual pixels.
MeasurableControl
 InheritedforceInvalidateDisplayList : Boolean = false
MeasurableControl
 Inheritedheight : Number
Set/get the height of the control.
MeasurableControl
 InheritedincludeInLayout : Boolean
Specifies whether this control participates in the layout system in OpenPyro.
MeasurableControl
 Inheritedinitialized : Boolean = false
Property indicates whether a control has been initialized or not.
MeasurableControl
 InheritedmaximumHeight : Number
MeasurableControl
 InheritedmaximumWidth : Number
MeasurableControl
  measuredHeight : Number
Overrides the set measuredHeight property from MeasurableControl to invalidate children (UIControl acknowledges that it can have children whose dimensions are based on its own)
UIControl
  measuredWidth : Number
Overrides the set measuredWidth property from MeasurableControl to invalidate children (UIControl acknowledges that it can have children whose dimensions are based on its own)
UIControl
 InheritedmouseActionsDisabled : Boolean
MeasurableControl
 InheritedneedsMeasurement : Boolean = true
Only setting percent width/heights changes the needsMeasurement flag which makes its parent container call measure on it.
MeasurableControl
  padding : Padding
Paddings define the unusable space within UIContainers that should not be used for measurement and layout.
UIControl
 InheritedparentContainer : UIControl
MeasurableControl
 InheritedpercentHeight : Number
MeasurableControl
 InheritedpercentUnusedHeight : Number
Set/get the percent height.
MeasurableControl
 InheritedpercentUnusedWidth : Number
Set/get the percent width.
MeasurableControl
 InheritedpercentWidth : Number
MeasurableControl
 InheritedsizeInvalidated : Boolean = false
The flag to mark that the control's size has been invalidated.
MeasurableControl
  skin : ISkin
[write-only]
UIControl
  skinnedControl : UIControl
UIControl
  styleName : String
Defines the skin this component is registered to.
UIControl
  toolTip : *
[write-only]
UIControl
 InheritedusesMeasurementStrategy : Boolean
This property defines whether measure() will be called during validateSize() or not.
MeasurableControl
 Inheritedvisible : Boolean
MeasurableControl
 Inheritedwidth : Number
Set/get the width of the control.
MeasurableControl
Protected Properties
 PropertyDefined by
  _backgroundPainter : IPainter
UIControl
 Inherited_creationCompleteFired : Boolean = false
MeasurableControl
 Inherited_dimensionsChanged : Boolean = true
MeasurableControl
  _dragEnabled : Boolean = false
UIControl
  _dropEnabled : Boolean = false
UIControl
 Inherited_explicitHeight : Number = NaN
MeasurableControl
 Inherited_explicitWidth : Number = NaN
MeasurableControl
  isMouseDown : Boolean = false
UIControl
 Inherited_maximumHeight : Number = NaN
MeasurableControl
 Inherited_maximumWidth : Number = NaN
MeasurableControl
 Inherited_measuredHeight : Number = NaN
MeasurableControl
 Inherited_measuredWidth : Number = NaN
MeasurableControl
 Inherited_mouseActionsDisabled : Boolean = false
MeasurableControl
  _padding : Padding
UIControl
 Inherited_parentContainer : UIControl
MeasurableControl
 Inherited_percentHeight : Number
MeasurableControl
 Inherited_percentUnusedHeight : Number
MeasurableControl
 Inherited_percentUnusedWidth : Number
MeasurableControl
 Inherited_percentWidth : Number
MeasurableControl
  _skin : ISkin
UIControl
  _skinnedControl : UIControl
UIControl
  _styleName : String
UIControl
  _toolTipData : *
UIControl
  toolTipRenderer : Class
UIControl
Public Methods
 MethodDefined by
  
UIControl
  
addChild(child:DisplayObject):DisplayObject
UIControl
  
addChildAt(child:DisplayObject, index:int):DisplayObject
UIControl
 Inherited
MeasurableControl
  
Calls the queueValidateDisplayList if measure causes _dimensionsChanged to change to true.
UIControl
  
dispose():void
UIControl
  
UIControl
 Inherited
doOnAdded():void
[Temp] This function is called automatically by a parent UIControl if this is created as a child of a UIControl.
MeasurableControl
 Inherited
MeasurableControl
 Inherited
Returns the explicitly defined height or the measured height computed by the measure function.
MeasurableControl
 Inherited
Returns the explicitly defined width or the measured number computed by the measure function.
MeasurableControl
  
When measure is called, it uses the widthForMeasurement and heightForMeasurement to calculate the sizes for percent-dimension based children
UIControl
  
initialize():void
This happens only once when a child is first added to any parent.
UIControl
 Inherited
invalidateSize(event:PyroEvent = null):void
Marks itself dirty and waits till either the container to validateSize or validates itself at the next enterframe if it has no parent container.
MeasurableControl
 Inherited
isMouseOver(event:MouseEvent):Boolean
Utility function to check if a mouseEvent happened while the mouse was over the displayObject
MeasurableControl
  
measure():void
Measure is called during the validateSize if the needsmeasurement flag is set.
UIControl
  
position(x:Number, y:Number):UIControl
UIControl
 Inherited
This function is called if the framework determines that dimensions of the control have changed.
MeasurableControl
  
UIControl
  
removeChild(d:DisplayObject):DisplayObject
UIControl
 Inherited
MeasurableControl
  
size(w:*, h:*):UIControl
Convinience function for setting width and height in one call.
UIControl
  
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
The updateDisplayList is triggered everytime the framework determines that some event has taken place that needs the UI to be refreshed.
UIControl
 Inherited
validateDisplayList(event:Event = null):void
validateDisplayList is called as a response to invalidateDisplayList.
MeasurableControl
 Inherited
validateSize():void
The validateSize function is called in response to a component declaring its size invalid (usually by calling invalidateSize()).
MeasurableControl
  
When measure is called, it uses the widthForMeasurement and heightForMeasurement to calculate the sizes for percent-dimension based children
UIControl
Protected Methods
 MethodDefined by
 Inherited
Calculates the measuredHeight property.
MeasurableControl
 Inherited
Calculates the measuredWidth property.
MeasurableControl
 Inherited
This is where the new children should be created and then added to the displaylist.
MeasurableControl
 Inherited
disableEvent(event:Event):void
MeasurableControl
  
dispatchDragStart(event:MouseEvent):void
UIControl
 Inherited
Dispatches the UpdateComplete event
MeasurableControl
  
While UIControls can be sized based on the dimensions of the parent container, if the explicit or percent dimension values are not specified, the UIControl can look at its children's dimensions and base its sizing off them.
UIControl
 Inherited
doQueuedValidateSize(event:Event):void
doQueueValidateSize is executed by the top level UIControl.
MeasurableControl
  
handlePreDragMouseDown(event:Event):void
This function is called if the UIControl instance is drag enabled and the user clicks the mouse down.
UIControl
 Inherited
MeasurableControl
 Inherited
onAddedToParent(event:Event):void
The event listener executed when this component has been added to the parent.
MeasurableControl
  
onSkinnedControlResize(event:Event):void
Event handler for when the UIControl is applied as a Skin and the control it is skinning is resized.
UIControl
Events
 EventSummaryDefined by
    UIControl
 Inherited  MeasurableControl
 Inherited  MeasurableControl
 Inherited  MeasurableControl
 Inherited  MeasurableControl
 Inherited  MeasurableControl
 Inherited  MeasurableControl
 Inherited  MeasurableControl
 Inherited  MeasurableControl
Property detail
_backgroundPainterproperty
protected var _backgroundPainter:IPainter
backgroundPainterproperty 
backgroundPainter:IPainter  [read-write]

UIControls can have a backgroundPainter object attached that is triggered everytime updateDisplayList is called.

Implementation
    public function get backgroundPainter():IPainter
    public function set backgroundPainter(value:IPainter):void

See also

dragDataproperty 
public var dragData:Object
_dragEnabledproperty 
protected var _dragEnabled:Boolean = false
dragEnabledproperty 
dragEnabled:Boolean  [read-write]Implementation
    public function get dragEnabled():Boolean
    public function set dragEnabled(value:Boolean):void
_dropEnabledproperty 
protected var _dropEnabled:Boolean = false
dropEnabledproperty 
dropEnabled:Boolean  [write-only]Implementation
    public function set dropEnabled(value:Boolean):void
isMouseDownproperty 
protected var isMouseDown:Boolean = false
measuredHeightproperty 
measuredHeight:Number  [read-write]

Overrides the set measuredHeight property from MeasurableControl to invalidate children (UIControl acknowledges that it can have children whose dimensions are based on its own)

Implementation
    public function get measuredHeight():Number
    public function set measuredHeight(value:Number):void
measuredWidthproperty 
measuredWidth:Number  [read-write]

Overrides the set measuredWidth property from MeasurableControl to invalidate children (UIControl acknowledges that it can have children whose dimensions are based on its own)

Implementation
    public function get measuredWidth():Number
    public function set measuredWidth(value:Number):void
_paddingproperty 
protected var _padding:Padding
paddingproperty 
padding:Padding  [read-write]

Paddings define the unusable space within UIContainers that should not be used for measurement and layout. Similar to HTML/CSS padding

Implementation
    public function get padding():Padding
    public function set padding(value:Padding):void
_skinproperty 
protected var _skin:ISkin
skinproperty 
skin:ISkin  [write-only]Implementation
    public function set skin(value:ISkin):void
_skinnedControlproperty 
protected var _skinnedControl:UIControl
skinnedControlproperty 
skinnedControl:UIControl  [read-write]Implementation
    public function get skinnedControl():UIControl
    public function set skinnedControl(value:UIControl):void
_styleNameproperty 
protected var _styleName:String
styleNameproperty 
styleName:String  [read-write]

Defines the skin this component is registered to. As long as a skin is registered with the same name as this value, this control will get that skin when instantiated or when that definition changes.

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

See also

toolTipproperty 
toolTip:*  [write-only]Implementation
    public function set toolTip(value:*):void
_toolTipDataproperty 
protected var _toolTipData:*
toolTipRendererproperty 
protected var toolTipRenderer:Class
Constructor detail
UIControl()constructor
public function UIControl()
Method detail
addChild()method
public override function addChild(child:DisplayObject):DisplayObject

Parameters
child:DisplayObject

Returns
DisplayObject
addChildAt()method 
public override function addChildAt(child:DisplayObject, index:int):DisplayObject

Parameters
child:DisplayObject
 
index:int

Returns
DisplayObject
checkDisplayListValidation()method 
public override function checkDisplayListValidation():void

Calls the queueValidateDisplayList if measure causes _dimensionsChanged to change to true. UIControl overrides this with a call to doChildBasedValidation which then goes and checks if the size of the children affects the size of the control.

dispatchDragStart()method 
protected function dispatchDragStart(event:MouseEvent):voidParameters
event:MouseEvent
dispose()method 
public function dispose():void
doChildBasedValidation()method 
protected function doChildBasedValidation():void

While UIControls can be sized based on the dimensions of the parent container, if the explicit or percent dimension values are not specified, the UIControl can look at its children's dimensions and base its sizing off them. For example, Label controls can look at the size of the text rendered by them to define their own width.

doLayoutChildren()method 
public function doLayoutChildren():void
handlePreDragMouseDown()method 
protected function handlePreDragMouseDown(event:Event):void

This function is called if the UIControl instance is drag enabled and the user clicks the mouse down. The control then waits for the mouse to move for dispatching the DragEvent.DRAG_START event. That event can be used to trigger DragManager's doDrag() function to implement Drag And Drop

Parameters
event:Event
heightForMeasurement()method 
public function heightForMeasurement():Number

When measure is called, it uses the widthForMeasurement and heightForMeasurement to calculate the sizes for percent-dimension based children

Returns
Number
initialize()method 
public override function initialize():void

This happens only once when a child is first added to any parent. Subsequent removeChild and addChild actions do not trigger this function but rather directly call validateSize.

measure()method 
public override function measure():void

Measure is called during the validateSize if the needsmeasurement flag is set. At this point, new measured width/heights are calculated. If these values are different from the values previously calculated, the resizeHandler is queued for the next enterframe

onSkinnedControlResize()method 
protected function onSkinnedControlResize(event:Event):void

Event handler for when the UIControl is applied as a Skin and the control it is skinning is resized.

Parameters
event:Event

See also

position()method 
public function position(x:Number, y:Number):UIControlParameters
x:Number
 
y:Number

Returns
UIControl
removeBackgroundPainter()method 
public function removeBackgroundPainter():void
removeChild()method 
public override function removeChild(d:DisplayObject):DisplayObject

Parameters
d:DisplayObject

Returns
DisplayObject
size()method 
public function size(w:*, h:*):UIControl

Convinience function for setting width and height in one call. The parameters can either be Strings or Numbers. When passing strings, you can append a '%' character at the end of the string to set a percent value

Parameters
w:* — Width either as a Number or as a String ending with a % character
 
h:* — Height either as a Number or as a String ending with a % character

Returns
UIControl

Throws
— if the datatype passed in is not a Number or String
updateDisplayList()method 
public override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

The updateDisplayList is triggered everytime the framework determines that some event has taken place that needs the UI to be refreshed.

Parameters
unscaledWidth:Number — The computed width of the control
 
unscaledHeight:Number — The computed height of the control
widthForMeasurement()method 
public function widthForMeasurement():Number

When measure is called, it uses the widthForMeasurement and heightForMeasurement to calculate the sizes for percent-dimension based children

Returns
Number
Event detail
dragDropevent 
Event object type: org.openPyro.managers.events.DragEvent