qnx.fuse.ui.layouts.LayoutData

LayoutData

Properties | Methods


Packageqnx.fuse.ui.layouts
Classpublic class LayoutData
InheritanceLayoutData Inheritance Object
Subclasses GridData, RowData, StackData

The LayoutData class is used by layouts to arrange individual controls within a cell. This class is intended for subclassing by particular layouts and is not intended for use by clients.

Class information:
PlayBook Tablet OS Version:   1.0.6

See also

GridData
RowData
StackData



Public Properties

 PropertyDefined By
  expandHeight : Number = 0
Expands the preferred height of the control by the given number of pixels.
LayoutData
  expandWidth : Number = 0
Expands the preferred width of the control by the given number of pixels.
LayoutData
  hAlign : String
Indicates the horizontal alignment of the control.
LayoutData
  marginBottom : Number
Indicates the amount of blank space that appears between the bottom of the control and the outside of its cell.
LayoutData
  marginLeft : Number
Indicates the amount of blank space that appears between the left side of the control and the outside of its cell.
LayoutData
  marginRight : Number
Indicates the amount of blank space that appears between the right side of the control and the outside of its cell.
LayoutData
  marginTop : Number
Indicates the amount of blank space that appears between the top of the control and the outside of its cell.
LayoutData
  preferredHeight : Number = Infinity
Overridden preferred height of the control, or DefaultSize if the control should be asked for its preferred height.
LayoutData
  preferredWidth : Number = Infinity
Overridden preferred width of the control, or DefaultSize if the control should be asked for its preferred width.
LayoutData
  vAlign : String
Indicates the vertical alignment of the control.
LayoutData

Public Methods

 MethodDefined By
  
Creates a LayoutData instance.
LayoutData
  
computePositionWithinCell(element:ILayoutElement, cellBounds:Rectangle):Rectangle
Computes the position of the control within the cell.
LayoutData
  
getPreferredSize(element:ILayoutElement, cellWidthConstraint:Number, cellHeightConstraint:Number):Point
Computes the preferred size of the cell given one or both known dimensions of the cell.
LayoutData

Property Detail

expandHeight


public var expandHeight:Number = 0

Expands the preferred height of the control by the given number of pixels.

Unlike padding, the expandHeight() property makes the control itself bigger in addition to the cell. This still affects controls whose height has been overridden using the preferredHeight() attribute. That is, if both expandHeight() and preferredHeight() are set, then the control's preferred height will be the sum of the two.

The default value is 0.

expandWidth


public var expandWidth:Number = 0

Expands the preferred width of the control by the given number of pixels.

Unlike padding, the expandWidth() property makes the control itself bigger in addition to the cell. This still affects controls whose width has been overridden using the preferredWidth() attribute. That is, if both expandWidth() and preferredWidth() are set, then the control's preferred width will be the sum of the two.

The default value is 0.

hAlign


public var hAlign:String

Indicates the horizontal alignment of the control. May be set to one of the alignment constants from LayoutConstants:

  • BEGIN
  • END
  • CENTER
  • FILL

Controls set to FILL alignment may be stretched larger than their preferred size since they will always grow to fill the cell. Controls set to any other alignment will not grow larger than their preferred size and will insert black space to fill the cell if the cell grows larger than the control.

marginBottom


public var marginBottom:Number

Indicates the amount of blank space that appears between the bottom of the control and the outside of its cell.

The default value is 0.

marginLeft


public var marginLeft:Number

Indicates the amount of blank space that appears between the left side of the control and the outside of its cell.

The default value is 0.

marginRight


public var marginRight:Number

Indicates the amount of blank space that appears between the right side of the control and the outside of its cell.

The default value is 0.

marginTop


public var marginTop:Number

Indicates the amount of blank space that appears between the top of the control and the outside of its cell.

The default value is 0.

preferredHeight


public var preferredHeight:Number = Infinity

Overridden preferred height of the control, or DefaultSize if the control should be asked for its preferred height.

preferredWidth


public var preferredWidth:Number = Infinity

Overridden preferred width of the control, or DefaultSize if the control should be asked for its preferred width.

vAlign


public var vAlign:String

Indicates the vertical alignment of the control. May be set to one of the alignment constants from LayoutConstants:

  • BEGIN
  • END
  • CENTER
  • FILL

Controls set to FILL alignment may be stretched larger than their preferred size since they will always grow to fill the cell. Controls set to any other alignment will not grow larger than their preferred size and will insert black space to fill the cell if the cell grows larger than the control.

Constructor Detail

LayoutData()


public function LayoutData()

Creates a LayoutData instance.

Method Detail

computePositionWithinCell()


public final function computePositionWithinCell(element:ILayoutElement, cellBounds:Rectangle):Rectangle

Computes the position of the control within the cell.

Parameters

element:ILayoutElement — The element, for which to return the coordinates.
cellBounds:Rectangle — A rectangle, indicating the bounds of the cell.

Returns

Rectangle — A rectangle, indicating the position of the control within the bounds of the cell.

getPreferredSize()


public final function getPreferredSize(element:ILayoutElement, cellWidthConstraint:Number, cellHeightConstraint:Number):Point

Computes the preferred size of the cell given one or both known dimensions of the cell.

Parameters

element:ILayoutElement — The layout cell.
cellWidthConstraint:Number — The width of the cell.
cellHeightConstraint:Number — The height of the cell.

Returns

Point — The preferred size of the cell.