qnx.fuse.ui.core.Container

Container

Properties | Methods | Events


Packageqnx.fuse.ui.core
Classpublic class Container
InheritanceContainer Inheritance UIComponent Inheritance flash.display.MovieClip
Implements IContainer

An implementation of IContainer that includes scroll support.

Class information:
PlayBook Tablet OS Version:   1.0.6

See also

layouts



Public Properties

 PropertyDefined By
  allowScrollPastEdge : Boolean
Determines if the container can scroll content past the bounds.
Container
  background : DisplayObject
Gets or sets the background of the Container.
Container
  contentHeight : Number
[read-only] Gets the height of the content.
Container
  contentWidth : Number
[read-only] Gets the width of the content.
Container
  enableShadows : Boolean
Enable or disable scroll shadows.
Container
 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
  hAutoScroll : Boolean
Gets or sets the horizontal auto-scrolling state.
Container
  hAutoScrollDuration : Number
Gets or sets the duration, in seconds, of horizontal auto-scrolling.
Container
  height : Number
[override] Sets the height of the container (in pixels).
Container
  hScrollVisible : Boolean
Gets or sets the visiblity of the horizontal scroll bar.
Container
 InheritedincludeInLayout : Boolean
Specifies whether or not the component should be included in its parent container's layout.
UIComponent
  layout : ILayout
Gets or sets the layout for the container.
Container
 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
  numChildren : int
[override] [read-only] Returns the number of children (DisplayObject) in the container.
Container
  scrollBarColor : uint
Gets or sets the color of the scroll bars.
Container
  scrollDirection : String
Gets or sets the scroll direction of the container.
Container
  scrollX : Number
Gets or sets the horizontal scroll position.
Container
  scrollY : Number
Gets or sets the vertical scroll position.
Container
  vAutoScroll : Boolean
Gets or sets the horizontal auto-scrolling state.
Container
  vAutoScrollDuration : Number
Gets or sets the duration, in seconds, of vertical auto-scrolling.
Container
  visibilityCullType : String
Gets or sets the visbility cull type.
Container
  vScrollVisible : Boolean
Sets the visiblity of the vertical scroll bar.
Container

Public Methods

 MethodDefined By
  
Creates a Container instance.
Container
  
addChild(child:DisplayObject):DisplayObject
[override] Adds a child to the Container.
Container
  
addChildAt(child:DisplayObject, index:int):DisplayObject
[override] Adds a child to the container at a given index.
Container
 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
  
destroy():void
[override] Call this method when you want to have your object collected by the garbage collector.
Container
  
getChildAt(index:int):DisplayObject
[override] Gets the child at the given index.
Container
  
[override] Returns the size options for the given control.
Container
 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
  
removeChild(child:DisplayObject):DisplayObject
[override] Removes a child (DisplayObject) from the container.
Container
  
removeChildAt(index:int):DisplayObject
[override] Removes a child (DisplayObject) from the container, given the index of the child.
Container
  
scrollIntoView(displayObject:DisplayObject):void
Scrolls the specified object into view.
Container
  
scrollToX(position:Number, duration:Number):void
Sets the horizontal scroll position.
Container
  
scrollToY(position:Number, duration:Number):void
Sets the vertical scroll position.
Container
  
setActualSize(w:Number, h:Number):void
[override] Sets the width and height of the object without setting the explicitWidth and explicitHeight.
Container
  
setChildIndex(child:DisplayObject, index:int):void
[override] Sets the index of a given child (DisplayObject).
Container
 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
  
swapChildren(child1:DisplayObject, child2:DisplayObject):void
[override] Swaps the index values of two children.
Container
  
swapChildrenAt(index1:int, index2:int):void
[override] Swaps two children given the index of both children.
Container
 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
  
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
[override] Sets the size and position of the children of the component.
Container

Events

 Event Summary Defined By
   Dispatched when scrolling begins.Container
   Dispatched when scrolling ends.Container
   Dispatched when scrolling occurs.Container

Property Detail

allowScrollPastEdge


allowScrollPastEdge:Boolean

Determines if the container can scroll content past the bounds. If false, the scroll is halted immediately at the edge of the bounds.


Implementation

public function get allowScrollPastEdge():Boolean
public function set allowScrollPastEdge(value:Boolean):void

background


background:DisplayObject

Gets or sets the background of the Container. The Container's background is scaled to the same width and height of the Container.


Implementation

public function get background():DisplayObject
public function set background(value:DisplayObject):void

contentHeight


contentHeight:Number  [read-only]

Gets the height of the content.


Implementation

public function get contentHeight():Number

contentWidth


contentWidth:Number  [read-only]

Gets the width of the content.


Implementation

public function get contentWidth():Number

enableShadows


enableShadows:Boolean

Enable or disable scroll shadows. If enabled, and content exists beyond the edges of the Container, shadows will appear at those edges.


Implementation

public function get enableShadows():Boolean
public function set enableShadows(value:Boolean):void

hAutoScroll


hAutoScroll:Boolean

Gets or sets the horizontal auto-scrolling state.


Implementation

public function get hAutoScroll():Boolean
public function set hAutoScroll(value:Boolean):void

hAutoScrollDuration


hAutoScrollDuration:Number

Gets or sets the duration, in seconds, of horizontal auto-scrolling.


Implementation

public function get hAutoScrollDuration():Number
public function set hAutoScrollDuration(value:Number):void

height


height:Number
[override]

Sets the height of the container (in pixels).


Implementation

public function get height():Number
public function set height(value:Number):void

hScrollVisible


hScrollVisible:Boolean

Gets or sets the visiblity of the horizontal scroll bar.


Implementation

public function get hScrollVisible():Boolean
public function set hScrollVisible(value:Boolean):void

layout


layout:ILayout

Gets or sets the layout for the container.

The layout defines how the UI controls are organized within the container. The following layout types are supported:

  • StackLayout
  • RowLayout
  • GridLayout


Implementation

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

See also

GridLayout
StackLayout
RowLayout

numChildren


numChildren:int  [read-only]
[override]

Returns the number of children (DisplayObject) in the container.


Implementation

public function get numChildren():int

scrollBarColor


scrollBarColor:uint

Gets or sets the color of the scroll bars.


Implementation

public function get scrollBarColor():uint
public function set scrollBarColor(value:uint):void

scrollDirection


scrollDirection:String

Gets or sets the scroll direction of the container.


Implementation

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

scrollX


scrollX:Number

Gets or sets the horizontal scroll position. The position is clamped to the bounds of our children.


Implementation

public function get scrollX():Number
public function set scrollX(value:Number):void

scrollY


scrollY:Number

Gets or sets the vertical scroll position. The position is clamped to the bounds of our children.


Implementation

public function get scrollY():Number
public function set scrollY(value:Number):void

vAutoScroll


vAutoScroll:Boolean

Gets or sets the horizontal auto-scrolling state.


Implementation

public function get vAutoScroll():Boolean
public function set vAutoScroll(value:Boolean):void

vAutoScrollDuration


vAutoScrollDuration:Number

Gets or sets the duration, in seconds, of vertical auto-scrolling.


Implementation

public function get vAutoScrollDuration():Number
public function set vAutoScrollDuration(value:Number):void

visibilityCullType


visibilityCullType:String

Gets or sets the visbility cull type.

Visibility culling optimizes render time by setting the visibility of masked children to false. Enabling visbility culling can have unintended side effects if child visibility is being set programmatically. Setting the visibility cull type can improve the scroll performance of containers drammatically.

This property has no affect on non-scrolling containers.

Supported values are:

  • VisibilityCullType.VISIBILITY_CULL_IMMEDIATE
  • VisibilityCullType.VISIBILITY_CULL_NONE


Implementation

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

Throws
ArgumentError — If the visibility cull type is not one of the types specified in VisiblityCullType.

See also

VisibilityCullType

vScrollVisible


vScrollVisible:Boolean

Sets the visiblity of the vertical scroll bar.


Implementation

public function get vScrollVisible():Boolean
public function set vScrollVisible(value:Boolean):void

Constructor Detail

Container()


public function Container()

Creates a Container instance.

Method Detail

addChild()


override public function addChild(child:DisplayObject):DisplayObject

Adds a child to the Container.

Parameters

child:DisplayObject — The child (DisplayObject) to add to the container.

Returns

DisplayObject — DisplayObject

addChildAt()


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

Adds a child to the container at a given index.

Parameters

child:DisplayObject — The child (DisplayObject) to add to the container.
index:int — The index at which to add the child.

Returns

DisplayObject — DisplayObject

destroy()


override public function destroy():void

Call this method when you want to have your object collected by the garbage collector.

NOTE: This method does not remove the object from memory. Instead, it enables your instance to clean up after itself internally so that it can be garbage-collected.

getChildAt()


override public function getChildAt(index:int):DisplayObject

Gets the child at the given index.

Parameters

index:int — The child (DisplayObject) to return.

Returns

DisplayObject — DisplayObject

getSizeOptions()


override public function getSizeOptions():int

Returns the size options for the given control. The size options determine the behaviour of the control during a resize operation.

Returns

int — A integer that defines a given size option.

removeChild()


override public function removeChild(child:DisplayObject):DisplayObject

Removes a child (DisplayObject) from the container.

Parameters

child:DisplayObject — The child to remove from the container.

Returns

DisplayObject — DisplayObject

removeChildAt()


override public function removeChildAt(index:int):DisplayObject

Removes a child (DisplayObject) from the container, given the index of the child.

Parameters

index:int — The child to remove from the container.

Returns

DisplayObject — DisplayObject

scrollIntoView()


public function scrollIntoView(displayObject:DisplayObject):void

Scrolls the specified object into view. If the specified object is not part of the container no scrolling will occur.

Parameters

displayObject:DisplayObject — The object to scroll into view.

scrollToX()


public function scrollToX(position:Number, duration:Number):void

Sets the horizontal scroll position. The position is clamped to the bounds of our children.

Parameters

position:Number — The position to scroll to.
duration:Number — The duration of the scroll.

scrollToY()


public function scrollToY(position:Number, duration:Number):void

Sets the vertical scroll position. The position is clamped to the bounds of our children.

Parameters

position:Number — The position to scroll to.
duration:Number — The duration of the scroll.

setActualSize()


override public function setActualSize(w:Number, h:Number):void

Sets the width and height of the object without setting the explicitWidth and explicitHeight. This allows the component to return to its previous size in a future layout call.

Parameters

w:Number
h:Number

setChildIndex()


override public function setChildIndex(child:DisplayObject, index:int):void

Sets the index of a given child (DisplayObject).

Parameters

child:DisplayObject — The child object for which to set the index.
index:int — The new index value of the child.

swapChildren()


override public function swapChildren(child1:DisplayObject, child2:DisplayObject):void

Swaps the index values of two children.

Parameters

child1:DisplayObject — The first child.
child2:DisplayObject — The second child.

swapChildrenAt()


override public function swapChildrenAt(index1:int, index2:int):void

Swaps two children given the index of both children.

Parameters

index1:int — The index of the first child.
index2:int — The index of the second child.

updateDisplayList()


override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

Sets the size and position of the children of the component. Component developers will want to subclass this method to adjust its children correctly.

If the component needs to do any drawing it should be done in this method as well.

This method should not be called directly as it is called by framework when its invalidateDisplayList() method is called.

Parameters

unscaledWidth:Number — The unscaled width of the component. Any drawing, sizing and positioning should be based on this value and not width.
unscaledHeight:Number — The unscaled height of the component. Any drawing, sizing, and positioning should be based on this value and not height.

Event Detail

scrollBegin


Event Object Type: qnx.fuse.ui.events.ScrollEvent
ScrollEvent.type property = qnx.ui.events.ScrollEvent.SCROLL_BEGIN

Dispatched when scrolling begins.

scrollEnded


Event Object Type: qnx.fuse.ui.events.ScrollEvent
ScrollEvent.type property = qnx.ui.events.ScrollEvent.SCROLL_END

Dispatched when scrolling ends.

scrollMove


Event Object Type: qnx.fuse.ui.events.ScrollEvent
ScrollEvent.type property = qnx.ui.events.ScrollEvent.SCROLL_MOVE

Dispatched when scrolling occurs.