Packagecom.soundstep.ui.layouts
Classpublic class VBoxUI
InheritanceVBoxUI Inheritance CanvasUI Inheritance flash.display.MovieClip

Author: Romuald Quantin - www.soundstep.com
Class version: 3.0.1
Actionscript version: 3.0
Copyright: Mozilla Public License 1.1 (MPL 1.1)
http://www.opensource.org/licenses/mozilla1.1.php
You can use BaseUI in any flash site, except to include/distribute it in another framework, application, template, component or structure that is meant to build, scaffold or generate source files.

Date: 08-2008
Usage:
HBox is a subclass of CanvasUI that lays out the children vertically in the box.
You can set additional properties like verticalGap, padding, alignChildren and horizontalCenterChildren.


Example
  var vbox:VBoxUI = new VBoxUI();
  addChildUI(vbox);
  vbox.alignChildren = VBoxUI.ALIGN_CENTER;
  vbox.horizontalCenterChildren = 40;
  vbox.padding = new Padding(10, 25, 10, 10);
  vbox.name = "vbox";
  vbox.reference = this;
  vbox.percentWidth = "50%";
  vbox.height = 200;
  vbox.right = 20;
  vbox.bottom = 20;
  vbox.canvasAlpha = .4;
  



Public Properties
 PropertyDefined by
  alignChildren : String
alignment of the children, can be VBoxUI.ALIGN_LEFT, VBoxUI.ALIGN_CENTER or VBoxUI.ALIGN_RIGHT
VBoxUI
 InheritedalignX : String
horizontal alignment when the property ratio is set to ElementUI.RATIO_IN or ElementUI.RATIO_OUT
can accept ElementUI.ALIGN_LEFT, ElementUI.ALIGN_RIGHT, ElementUI.ALIGN_CENTER
CanvasUI
 InheritedalignY : String
vertical alignment when the property ratio is set to ElementUI.RATIO_IN or ElementUI.RATIO_OUT
can accept ElementUI.ALIGN_CENTER, ElementUI.ALIGN_TOP, ElementUI.ALIGN_BOTTOM
CanvasUI
 InheritedbaseUI : BaseUI
get the instance of the BaseUI class, used for the children added with addChild or addChildUI
CanvasUI
 Inheritedbottom : Number
bottom value (from the reference), Number or String
CanvasUI
 InheritedbuttonMode : Boolean
Specifies the button mode of this sprite
CanvasUI
 InheritedbypassSize : Boolean
whether or not the DisplayObject will be resized (not working with ratio set to RATIO_IN or RATIO_OUT)
CanvasUI
 InheritedcanvasAlpha : Number
background alpha of the canvas
CanvasUI
 InheritedcanvasColor : uint
background color of the canvas
CanvasUI
 Inheritedcontainer : Sprite
get the instance of the container, it contains the children added with addChild and addChildUI
CanvasUI
 InheritedforceReferenceHeight : Number
force the height of the reference
CanvasUI
 InheritedforceReferenceWidth : Number
force the width of the reference
CanvasUI
 Inheritedheight : Number
height of the canvas
CanvasUI
 InheritedhorizontalCenter : Number
horizontal center value (from the reference), Number or String
CanvasUI
  horizontalCenterChildren : Number
horizontal alignment value of the children if alignChildren has been set to VBoxUI.ALIGN_CENTER
VBoxUI
 InheritedinitialWidth : Number
width of the DisplayObject when added to the BaseUI instance
CanvasUI
 InheritedkeepOnScreen : Boolean
keep a DisplayObject in the screen
CanvasUI
 InheritedlayoutMask : Mask
get the instance of the mask
CanvasUI
 Inheritedleft : Number
left value (from the reference), Number or String
CanvasUI
 InheritedmouseChildren : Boolean
Determines whether or not the children of the object are mouse enabled
CanvasUI
 InheritednumChildren : int
Returns the number of children of the CanvasUI container
CanvasUI
 InheritedonStage : Boolean
set the stage as a reference to calculate position ans sizes, if false the parent will be the reference
CanvasUI
  padding : Padding
space around the children
VBoxUI
 InheritedpercentHeight : *
set the height percentage (will accept Number or String, with or without the percentage character
CanvasUI
 InheritedpercentWidth : *
set the width percentage (will accept Number or String, with or without the percentage character
CanvasUI
 Inheritedproperties : Object
Object to get or set the CanvasUI properties, for example:
element.properties = {top:0, bottom:"20", onStage:false, width:"50%"};
CanvasUI
 Inheritedratio : String
type of ratio of the CanvasUI, can be ElementUI.RATIO_IN or ElementUI.RATIO_OUT
any other String will set the ratio to none
the following properties cannot be set or are not used a ratio has been specified:
x, y, width, height, horizontalCenter and verticalCenter
CanvasUI
 Inheritedreference : DisplayObjectContainer
specify a DisplayObjectContainer reference on which the size and position of the ElementUI will refer to
if not set, the onStage property value is the reference (onStage true = stage, onStage false = parent)
CanvasUI
 Inheritedright : Number
right value (from the reference), Number or String
CanvasUI
 InheritedscrollPane : *
get the instance of the scrollpane used for the scrollbars
you must cast the return: Scrollpane(canvas.scrollpane), the wild card has been used not to import the SCrollpane classes if not used
CanvasUI
 Inheritedtop : Number
top value (from the reference), Number or String
CanvasUI
 Inheritedui : ElementUI
get a the wrapper ElementUI instance
CanvasUI
 InheriteduseInitialSize : Boolean
use the size that has been recorded when the DisplayObject has been added to the BaseUI instance
useful when a mask or other DisplayObject can disturb the real size of the DisplayObject
CanvasUI
 InheritedverticalCenter : Number
vertical center value (from the reference), Number or String
CanvasUI
  verticalGap : Number
vertical space between each children
VBoxUI
 Inheritedwidth : Number
width of the canvas
CanvasUI
 Inheritedwrapper : Wrapper
get the instance of the wrapper
CanvasUI
 Inheritedx : Number
x position of the canvas, Number or String
CanvasUI
 Inheritedy : Number
y position of the canvas
CanvasUI
Public Methods
 MethodDefined by
  
VBoxUI(widthLayout:Number = 100, heightLayout:Number = 100, layoutScrollbar:Boolean = true, layoutMask:Boolean = true)
Constructor Create an instance of the VBoxUI class
VBoxUI
  
addChild(child:DisplayObject):DisplayObject
Adds a child DisplayObject instance to this VBox container, a ElementUI will be created
VBoxUI
 Inherited
addChildAt(child:DisplayObject, index:int):DisplayObject
Adds a child DisplayObject instance to the CanvasUI container
CanvasUI
  
addChildUI(child:DisplayObject):ElementUI
create an ElementUI instance and add the child to the display list
VBoxUI
 Inherited
contains(child:DisplayObject):Boolean
Determines whether or not the specified display object is a child of the CanvasUI container or the instance itself
CanvasUI
 Inherited
forceSizeContainer(width:Number, height:Number):void
function to force the size of the container (will update the scrollbars if used)
CanvasUI
 Inherited
getChildAt(index:int):DisplayObject
Returns the child display object instance that exists at the specified index
CanvasUI
 Inherited
getChildByName(name:String):DisplayObject
Returns the child display object that exists with the specified name
CanvasUI
 Inherited
getChildIndex(child:DisplayObject):int
Returns the index position of a child DisplayObject instance
CanvasUI
 Inherited
getChildUI(child:DisplayObject):ElementUI
get a child ElementUI instance
CanvasUI
 Inherited
get a child ElementUI instance using the name
CanvasUI
  
refresh(e:BaseEventUI = null):void
refresh the box elements and its children position
VBoxUI
 Inherited
removeChild(child:DisplayObject):DisplayObject
Removes the specified child DisplayObject instance from the child list of the CanvasUI container
CanvasUI
 Inherited
removeChildAt(index:int):DisplayObject
Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer
CanvasUI
 Inherited
removeChildUI(child:DisplayObject):void
remove a child from the BaseUI instance
CanvasUI
 Inherited
setChildIndex(child:DisplayObject, index:int):void
Changes the position of an existing child in the CanvasUI container
CanvasUI
 Inherited
swapChildren(child1:DisplayObject, child2:DisplayObject):void
Swaps the z-order (front-to-back order) of the two specified child objects
CanvasUI
 Inherited
swapChildrenAt(index1:int, index2:int):void
Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child list.
CanvasUI
Public Constants
 ConstantDefined by
  ALIGN_CENTER : String = "center"
[static] static constant for the alignment (property alignChildren), the children are centered in the layout
VBoxUI
  ALIGN_LEFT : String = "left"
[static] static constant for the alignment (property alignChildren), the children are aligned top in the layout
VBoxUI
  ALIGN_RIGHT : String = "right"
[static] static constant for the alignment (property alignChildren), the children are aligned bottom in the layout
VBoxUI
Property detail
alignChildrenproperty
alignChildren:String  [read-write]

alignment of the children, can be VBoxUI.ALIGN_LEFT, VBoxUI.ALIGN_CENTER or VBoxUI.ALIGN_RIGHT

Implementation
    public function get alignChildren():String
    public function set alignChildren(value:String):void
horizontalCenterChildrenproperty 
horizontalCenterChildren:Number  [read-write]

horizontal alignment value of the children if alignChildren has been set to VBoxUI.ALIGN_CENTER

Implementation
    public function get horizontalCenterChildren():Number
    public function set horizontalCenterChildren(value:Number):void
paddingproperty 
padding:Padding  [read-write]

space around the children

Implementation
    public function get padding():Padding
    public function set padding(value:Padding):void
verticalGapproperty 
verticalGap:Number  [read-write]

vertical space between each children

Implementation
    public function get verticalGap():Number
    public function set verticalGap(value:Number):void
Constructor detail
VBoxUI()constructor
public function VBoxUI(widthLayout:Number = 100, heightLayout:Number = 100, layoutScrollbar:Boolean = true, layoutMask:Boolean = true)

Constructor Create an instance of the VBoxUI class

Parameters
widthLayout:Number (default = 100) — width of the box
 
heightLayout:Number (default = 100) — height of the box
 
layoutScrollbar:Boolean (default = true) — whether or not the canvas creates and uses a mask to show only the content within the box
 
layoutMask:Boolean (default = true) — whether or not the canvas creates and uses scrollbars if the content is bigger than the box (scrollpane instance)
Method detail
addChild()method
public override function addChild(child:DisplayObject):DisplayObject

Adds a child DisplayObject instance to this VBox container, a ElementUI will be created

Parameters
child:DisplayObject — DisplayObject

Returns
DisplayObject — DisplayObject
addChildUI()method 
public override function addChildUI(child:DisplayObject):ElementUI

create an ElementUI instance and add the child to the display list

Parameters
child:DisplayObject — DisplayObject

Returns
ElementUI — ElementUI
refresh()method 
public override function refresh(e:BaseEventUI = null):void

refresh the box elements and its children position

Parameters
e:BaseEventUI (default = null)
Constant detail
ALIGN_CENTERconstant
public static const ALIGN_CENTER:String = "center"

static constant for the alignment (property alignChildren), the children are centered in the layout

ALIGN_LEFTconstant 
public static const ALIGN_LEFT:String = "left"

static constant for the alignment (property alignChildren), the children are aligned top in the layout

ALIGN_RIGHTconstant 
public static const ALIGN_RIGHT:String = "right"

static constant for the alignment (property alignChildren), the children are aligned bottom in the layout