ProportionalLayout

public class
feathers.layout.ProportionalLayout

Description

Lay out along vertically or horizontally using a mix of pixel and percentage sizing information.

Assign this as the layout for a container, then set ProportionalLayoutData on all the children that you wish to be laid out using the algorithm.

This lays out vertically by default, but set isVertical to false and it will lay out horizontally.

API overview

Constructor

ProportionalLayout ()

Attributes

Public attributes

align: String

Controls alignment of controls on the secondary axis

gap: Number

Space in pixels to maintain between controls along the layout axis

isVertical: Boolean

If true, layout is done vertically (with alignment happening horizontally)

padding: Number write-only

Sets empty space in pixels around the laid out controls

paddingBottom: Number
paddingLeft: Number
paddingRight: Number
paddingTop: Number

Constants

Constants

CENTER: String static

Set align to CENTER to align controls to the center of the free space

LEFT: String static

Set align to LEFT to align controls to the left of the free space

RIGHT: String static

Set align to RIGHT to align controls to the right of the free space

Functions

Public functions

calculateAlignPadding ( itemWidth: Number , containerWidth: Number , type: String ): Number

Calculate the position to be aligned properly in the given space

Constructor

ProportionalLayout ()

Attributes

align: String

Controls alignment of controls on the secondary axis.

gap: Number

Space in pixels to maintain between controls along the layout axis.

isVertical: Boolean

If true, layout is done vertically (with alignment happening horizontally). If false, layout is done horizontally (with alignment happening vertically).

padding: Number

write-only

Sets empty space in pixels around the laid out controls.

paddingBottom: Number

paddingLeft: Number

paddingRight: Number

paddingTop: Number

Constants

CENTER: String

static

Set align to CENTER to align controls to the center of the free space.

LEFT: String

static

Set align to LEFT to align controls to the left of the free space.

RIGHT: String

static

Set align to RIGHT to align controls to the right of the free space.

Functions

addEventListener ( type: String , listener: Function ): Void
Inherited from EventDispatcher

Registers an event listener at a certain object.

Parameters

type: String
listener: Function


calculateAlignPadding ( itemWidth: Number , containerWidth: Number , type: String ): Number

Calculate the position to be aligned properly in the given space.

Parameters

itemWidth: Number
containerWidth: Number
type: String


dispatchEvent ( event: Event ): Void
Inherited from EventDispatcher

Dispatches an event to all objects that have registered listeners for its type. If an event with enabled 'bubble' property is dispatched to a display object, it will travel up along the line of parents, until it either hits the root object or someone stops its propagation manually.

Parameters

event: Event


dispatchEventWith ( type: String , bubbles: Boolean = false , data: Object = null ): Void
Inherited from EventDispatcher

Dispatches an event with the given parameters to all objects that have registered listeners for the given type. The method uses an internal pool of event objects to avoid allocations.

Parameters

type: String
bubbles: Boolean = false
data: Object = null


getFullTypeName (): String
Inherited from Object

native

Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.


Returns

String fully qualified type name of the Object.

getType (): Type
Inherited from Object

native

Gets the Type that describes the Object.


Returns

Type The Type that describes the object.

getTypeName (): String
Inherited from Object

native

Gets the type name of the Object.


Returns

String type name of the Object.

hasEventListener ( type: String ): Boolean
Inherited from EventDispatcher

Returns if there are listeners registered for a certain event type.

Parameters

type: String


removeEventListener ( type: String , listener: Function ): Void
Inherited from EventDispatcher

Removes an event listener from the object.

Parameters

type: String
listener: Function


removeEventListeners ( type: String = null ): Void
Inherited from EventDispatcher

Removes all event listeners with a certain type, or all of them if type is null. Be careful when removing all event listeners: you never know who else was listening.

Parameters

type: String = null


toString (): String
Inherited from Object

native

Returns a String that describes the Object. This can be overriden to provide extra details when printing objects using trace().


Returns

String String that described the Object.

: