Packageorg.openPyro.core
Classpublic class UIContainer
InheritanceUIContainer Inheritance UIControl Inheritance MeasurableControl Inheritance flash.display.Sprite
SubclassesApplication, DividedBox, List, ScrollBar, ViewStack

UIContainers extend UIControls and introduce the concept of scrolling and layouts. If the bounds of the children of a UIContainer, they get clipped by the mask layer on top. todo: Create UIContainer.clipContent = false/true function

See also

layout


Public Properties
 PropertyDefined by
 InheritedbackgroundPainter : IPainter
UIControls can have a backgroundPainter object attached that is triggered everytime updateDisplayList is called.
UIControl
  clipContent : Boolean
UIContainer
  contentHeight : Number
[read-only]
UIContainer
  contentWidth : Number
[read-only]
UIContainer
 InheritedcreationCompleteFired : Boolean
MeasurableControl
 InheriteddisplayListInvalidated : Boolean = true
Flag to mark a dirty displaylist.
MeasurableControl
 InheriteddragData : Object
UIControl
 InheriteddragEnabled : Boolean
UIControl
 InheriteddropEnabled : Boolean
UIControl
  explicitlyAllocatedHeight : Number
This property are modified by IContainerMeasurementHelpers.
UIContainer
  explicitlyAllocatedWidth : Number
This property are modified by IContainerMeasurementHelpers.
UIContainer
 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
  horizontalScrollBar : ScrollBar
[read-only] Returns The instance of the created horizontal or null if it was never created or is not visible.
UIContainer
  horizontalScrollIncrement : Number
UIContainer
  horizontalScrollPolicy : Boolean
UIContainer
  horizontalScrollPosition : Number
UIContainer
 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
  layout : ILayout
Containers can be assigned different layouts which control the positioning of the different controls.
UIContainer
  layoutChildren : Array
[read-only] Returns an Array of displayObjects whose positions are controlled by the ILayout object.
UIContainer
 InheritedmaximumHeight : Number
MeasurableControl
 InheritedmaximumWidth : Number
MeasurableControl
 InheritedmeasuredHeight : 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
 InheritedmeasuredWidth : 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
  mouseOverDisabled : Boolean = false
[static]
UIContainer
 InheritedneedsMeasurement : Boolean = true
Only setting percent width/heights changes the needsMeasurement flag which makes its parent container call measure on it.
MeasurableControl
 Inheritedpadding : 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
  scrollHeight : Number
[read-only] scrollHeight is the max height a vertical scrollbar needs to scroll
UIContainer
  scrollWidth : Number
[read-only] scrollWidth is the max width a horizontal scrollbar needs to scroll
UIContainer
 InheritedsizeInvalidated : Boolean = false
The flag to mark that the control's size has been invalidated.
MeasurableControl
 Inheritedskin : ISkin
UIControl
 InheritedskinnedControl : UIControl
UIControl
 InheritedstyleName : String
Defines the skin this component is registered to.
UIControl
 InheritedtoolTip : *
UIControl
 InheritedusesMeasurementStrategy : Boolean
This property defines whether measure() will be called during validateSize() or not.
MeasurableControl
  verticalScrollBar : ScrollBar
Returns The instance of the created verticalScrollBar or null if it was never created or is not visible.
UIContainer
  verticalScrollIncrement : Number
UIContainer
  verticalScrollPolicy : Boolean
UIContainer
  verticalScrollPosition : Number
UIContainer
 Inheritedvisible : Boolean
MeasurableControl
 Inheritedwidth : Number
Set/get the width of the control.
MeasurableControl
Protected Properties
 PropertyDefined by
 Inherited_backgroundPainter : IPainter
UIControl
  _clipContent : Boolean = true
UIContainer
  _contentHeight : Number = 0
UIContainer
  contentPane : UIControl
UIContainer
  _contentWidth : Number = 0
UIContainer
 Inherited_creationCompleteFired : Boolean = false
MeasurableControl
 Inherited_dimensionsChanged : Boolean = true
MeasurableControl
 Inherited_dragEnabled : Boolean = false
UIControl
 Inherited_dropEnabled : Boolean = false
UIControl
 Inherited_explicitHeight : Number = NaN
MeasurableControl
 Inherited_explicitWidth : Number = NaN
MeasurableControl
  _horizontalScrollBar : ScrollBar
UIContainer
  _horizontalScrollPolicy : Boolean = true
UIContainer
 InheritedisMouseDown : Boolean = false
UIControl
  _layout : ILayout
UIContainer
  layoutInvalidated : Boolean = true
UIContainer
 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
  needsHorizontalScrollBar : Boolean = false
UIContainer
  needsVerticalScrollBar : Boolean = false
UIContainer
 Inherited_padding : Padding
UIControl
 Inherited_parentContainer : UIControl
MeasurableControl
 Inherited_percentHeight : Number
MeasurableControl
 Inherited_percentUnusedHeight : Number
MeasurableControl
 Inherited_percentUnusedWidth : Number
MeasurableControl
 Inherited_percentWidth : Number
MeasurableControl
  scrollBarsChanged : Boolean = false
UIContainer
  scrollX : Number = 0
UIContainer
  scrollY : Number = 0
UIContainer
 Inherited_skin : ISkin
UIControl
 Inherited_skinnedControl : UIControl
UIControl
 Inherited_styleName : String
UIControl
 Inherited_toolTipData : *
UIControl
 InheritedtoolTipRenderer : Class
UIControl
  _verticalScrollBar : ScrollBar
UIContainer
  _verticalScrollPolicy : Boolean = true
UIContainer
Public Methods
 MethodDefined by
  
UIContainer
  
addChild(child:DisplayObject):DisplayObject
UIContainer
  
addChildAt(child:DisplayObject, index:int):DisplayObject
UIContainer
 Inherited
MeasurableControl
 Inherited
Calls the queueValidateDisplayList if measure causes _dimensionsChanged to change to true.
UIControl
 Inherited
dispose():void
UIControl
  
Lays out the layoutChildren based ILayout object.
UIContainer
 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
  
getChildByName(name:String):DisplayObject
UIContainer
 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
UIContainer
  
initialize():void
This happens only once when a child is first added to any parent.
UIContainer
 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
 Inherited
measure():void
Measure is called during the validateSize if the needsmeasurement flag is set.
UIControl
 Inherited
position(x:Number, y:Number):UIControl
UIControl
 Inherited
This function is called if the framework determines that dimensions of the control have changed.
MeasurableControl
  
UIContainer
 Inherited
UIControl
  
removeChild(child:DisplayObject):DisplayObject
UIContainer
 Inherited
MeasurableControl
 Inherited
size(w:*, h:*):UIControl
Convinience function for setting width and height in one call.
UIControl
  
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
Unlike UIControls, UIContainers do not apply a skin directly on themselves but interpret the skin file and apply them to the different children.
UIContainer
 Inherited
validateDisplayList(event:Event = null):void
validateDisplayList is called as a response to invalidateDisplayList.
MeasurableControl
  
validateSize():void
The validateSize function is called in response to a component declaring its size invalid (usually by calling invalidateSize()).
UIContainer
  
When measure is called, it uses the widthForMeasurement and heightForMeasurement to calculate the sizes for percent-dimension based children
UIContainer
Protected Methods
 MethodDefined by
 Inherited
Calculates the measuredHeight property.
MeasurableControl
 Inherited
Calculates the measuredWidth property.
MeasurableControl
  
UIContainer
  
UIContainer
  
UIContainer
 Inherited
This is where the new children should be created and then added to the displaylist.
MeasurableControl
  
UIContainer
  
UIContainer
 Inherited
disableEvent(event:Event):void
MeasurableControl
 Inherited
dispatchDragStart(event:MouseEvent):void
UIControl
 Inherited
Dispatches the UpdateComplete event
MeasurableControl
  
UIContainer
 Inherited
doQueuedValidateSize(event:Event):void
doQueueValidateSize is executed by the top level UIControl.
MeasurableControl
  
handleMouseWheel(event:MouseEvent):void
UIContainer
 Inherited
handlePreDragMouseDown(event:Event):void
This function is called if the UIControl instance is drag enabled and the user clicks the mouse down.
UIControl
  
UIContainer
  
UIContainer
 Inherited
MeasurableControl
 Inherited
onAddedToParent(event:Event):void
The event listener executed when this component has been added to the parent.
MeasurableControl
  
Event listener for when the horizontal scrollbar is used.
UIContainer
  
UIContainer
  
Event listener for the horizontal scrollbar's creation and validation event.
UIContainer
 Inherited
onSkinnedControlResize(event:Event):void
Event handler for when the UIControl is applied as a Skin and the control it is skinning is resized.
UIControl
  
Event listener for when the vertical scrollbar is used.
UIContainer
  
UIContainer
  
Event listener for the vertical scrollbar's creation and validation event.
UIContainer
  
UIContainer
  
UIContainer
Events
 EventSummaryDefined by
 Inherited  UIControl
 Inherited  MeasurableControl
 Inherited  MeasurableControl
 Inherited  MeasurableControl
 Inherited  MeasurableControl
 Inherited  MeasurableControl
 Inherited  MeasurableControl
 Inherited  MeasurableControl
 Inherited  MeasurableControl
Property detail
_clipContentproperty
protected var _clipContent:Boolean = true
clipContentproperty 
clipContent:Boolean  [read-write]Implementation
    public function get clipContent():Boolean
    public function set clipContent(value:Boolean):void
_contentHeightproperty 
protected var _contentHeight:Number = 0
contentHeightproperty 
contentHeight:Number  [read-only]Implementation
    public function get contentHeight():Number
contentPaneproperty 
protected var contentPane:UIControl
_contentWidthproperty 
protected var _contentWidth:Number = 0
contentWidthproperty 
contentWidth:Number  [read-only]Implementation
    public function get contentWidth():Number
explicitlyAllocatedHeightproperty 
explicitlyAllocatedHeight:Number  [read-write]

This property are modified by IContainerMeasurementHelpers. which most container layouts implement.

Implementation
    public function get explicitlyAllocatedHeight():Number
    public function set explicitlyAllocatedHeight(value:Number):void

See also

explicitlyAllocatedWidthproperty 
explicitlyAllocatedWidth:Number  [read-write]

This property are modified by IContainerMeasurementHelpers. which most container layouts implement.

Implementation
    public function get explicitlyAllocatedWidth():Number
    public function set explicitlyAllocatedWidth(value:Number):void

See also

_horizontalScrollBarproperty 
protected var _horizontalScrollBar:ScrollBar
horizontalScrollBarproperty 
horizontalScrollBar:ScrollBar  [read-only]

Returns The instance of the created horizontal or null if it was never created or is not visible. Note that this function does cannot be used to detect if the scrollbar was created or not, since scrollbars once created are never distroyed, even if a subsequent change in the container's layout does not require the scrollbar anymore.

Implementation
    public function get horizontalScrollBar():ScrollBar
horizontalScrollIncrementproperty 
horizontalScrollIncrement:Number  [read-write]Implementation
    public function get horizontalScrollIncrement():Number
    public function set horizontalScrollIncrement(value:Number):void
_horizontalScrollPolicyproperty 
protected var _horizontalScrollPolicy:Boolean = true
horizontalScrollPolicyproperty 
horizontalScrollPolicy:Boolean  [read-write]Implementation
    public function get horizontalScrollPolicy():Boolean
    public function set horizontalScrollPolicy(value:Boolean):void
horizontalScrollPositionproperty 
horizontalScrollPosition:Number  [read-write]Implementation
    public function get horizontalScrollPosition():Number
    public function set horizontalScrollPosition(value:Number):void
_layoutproperty 
protected var _layout:ILayout
layoutproperty 
layout:ILayout  [read-write]

Containers can be assigned different layouts which control the positioning of the different controls.

Implementation
    public function get layout():ILayout
    public function set layout(value:ILayout):void

See also

layoutChildrenproperty 
layoutChildren:Array  [read-only]

Returns an Array of displayObjects whose positions are controlled by the ILayout object. These do not include, for example, the scrollbars.

Implementation
    public function get layoutChildren():Array

See also

layoutInvalidatedproperty 
protected var layoutInvalidated:Boolean = true
mouseOverDisabledproperty 
public static var mouseOverDisabled:Boolean = false
needsHorizontalScrollBarproperty 
protected var needsHorizontalScrollBar:Boolean = false
needsVerticalScrollBarproperty 
protected var needsVerticalScrollBar:Boolean = false
scrollBarsChangedproperty 
protected var scrollBarsChanged:Boolean = false
scrollHeightproperty 
scrollHeight:Number  [read-only]

scrollHeight is the max height a vertical scrollbar needs to scroll

Implementation
    public function get scrollHeight():Number
scrollWidthproperty 
scrollWidth:Number  [read-only]

scrollWidth is the max width a horizontal scrollbar needs to scroll

Implementation
    public function get scrollWidth():Number
scrollXproperty 
protected var scrollX:Number = 0
scrollYproperty 
protected var scrollY:Number = 0
_verticalScrollBarproperty 
protected var _verticalScrollBar:ScrollBar
verticalScrollBarproperty 
verticalScrollBar:ScrollBar  [read-write]

Returns The instance of the created verticalScrollBar or null if it was never created or is not visible. Note that this function does cannot be used to detect if the scrollbar was created or not, since scrollbars once created are never distroyed, even if a subsequent change in the container's layout does not require the scrollbar anymore.

Implementation
    public function get verticalScrollBar():ScrollBar
    public function set verticalScrollBar(value:ScrollBar):void
verticalScrollIncrementproperty 
verticalScrollIncrement:Number  [read-write]Implementation
    public function get verticalScrollIncrement():Number
    public function set verticalScrollIncrement(value:Number):void
_verticalScrollPolicyproperty 
protected var _verticalScrollPolicy:Boolean = true
verticalScrollPolicyproperty 
verticalScrollPolicy:Boolean  [read-write]Implementation
    public function get verticalScrollPolicy():Boolean
    public function set verticalScrollPolicy(value:Boolean):void
verticalScrollPositionproperty 
verticalScrollPosition:Number  [read-write]Implementation
    public function get verticalScrollPosition():Number
    public function set verticalScrollPosition(value:Number):void
Constructor detail
UIContainer()constructor
public function UIContainer()
Method detail
addChild()method
public override function addChild(child:DisplayObject):DisplayObjectParameters
child:DisplayObject

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

Returns
DisplayObject
checkNeedsHScrollBar()method 
protected function checkNeedsHScrollBar():void
checkNeedsVScrollBar()method 
protected function checkNeedsVScrollBar():void
checkRevalidation()method 
protected function checkRevalidation():void
createHScrollBar()method 
protected function createHScrollBar():void
createVScrollBar()method 
protected function createVScrollBar():void
doChildBasedValidation()method 
protected override function doChildBasedValidation():void
doLayoutChildren()method 
public override function doLayoutChildren():void

Lays out the layoutChildren based ILayout object.

See also

getChildByName()method 
public override function getChildByName(name:String):DisplayObjectParameters
name:String

Returns
DisplayObject
handleMouseWheel()method 
protected function handleMouseWheel(event:MouseEvent):voidParameters
event:MouseEvent
heightForMeasurement()method 
public override function heightForMeasurement():Number

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

Returns
Number
hideHScrollBar()method 
protected function hideHScrollBar():void
hideVScrollBar()method 
protected function hideVScrollBar():void
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.

onHorizontalScroll()method 
protected function onHorizontalScroll(event:ScrollEvent):void

Event listener for when the horizontal scrollbar is used.

Parameters
event:ScrollEvent
onHorizontalScrollBarSizeValidated()method 
protected function onHorizontalScrollBarSizeValidated(event:PyroEvent):voidParameters
event:PyroEvent
onHScrollBarUpdateComplete()method 
protected function onHScrollBarUpdateComplete(event:PyroEvent):void

Event listener for the horizontal scrollbar's creation and validation event.

Parameters
event:PyroEvent
onVerticalScroll()method 
protected function onVerticalScroll(event:ScrollEvent):void

Event listener for when the vertical scrollbar is used.

Parameters
event:ScrollEvent
onVerticalScrollBarSizeValidated()method 
protected function onVerticalScrollBarSizeValidated(event:PyroEvent):voidParameters
event:PyroEvent
onVScrollBarUpdateComplete()method 
protected function onVScrollBarUpdateComplete(event:PyroEvent):void

Event listener for the vertical scrollbar's creation and validation event.

Parameters
event:PyroEvent
removeAllChildren()method 
public function removeAllChildren():void
removeChild()method 
public override function removeChild(child:DisplayObject):DisplayObjectParameters
child:DisplayObject

Returns
DisplayObject
setContentMask()method 
protected function setContentMask():void
setVerticalScrollBar()method 
protected function setVerticalScrollBar():void
updateDisplayList()method 
public override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

Unlike UIControls, UIContainers do not apply a skin directly on themselves but interpret the skin file and apply them to the different children. So updateDisplayList here does not call super.updateDisplayList() 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
validateSize()method 
public override function validateSize():void

The validateSize function is called in response to a component declaring its size invalid (usually by calling invalidateSize()). The job of this method is to compute the final width and height (whether by calling measure if an explicit w/h is not declared or not if an explicit w & h is declared)

widthForMeasurement()method 
public override function widthForMeasurement():Number

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

Returns
Number