qnx.fuse.ui.layouts.gridLayout.GridData

GridData

Properties | Methods


Packageqnx.fuse.ui.layouts.gridLayout
Classpublic final class GridData
InheritanceGridData Inheritance LayoutData Inheritance Object

Stores the per-control configuration information for GridLayout.

Class information:
BlackBerry 10 Version:   10.0.0

See also

GridLayout
GridRowData



Public Properties

 PropertyDefined By
 InheritedexpandHeight : Number = 0
Expands the preferred height of the control by the given number of pixels.
LayoutData
 InheritedexpandWidth : Number = 0
Expands the preferred width of the control by the given number of pixels.
LayoutData
 InheritedhAlign : String
Indicates the horizontal alignment of the control.
LayoutData
  hSpan : int
The horizontal span.
GridData
 InheritedmarginBottom : Number
Indicates the amount of blank space that appears between the bottom of the control and the outside of its cell.
LayoutData
 InheritedmarginLeft : Number
Indicates the amount of blank space that appears between the left side of the control and the outside of its cell.
LayoutData
 InheritedmarginRight : Number
Indicates the amount of blank space that appears between the right side of the control and the outside of its cell.
LayoutData
 InheritedmarginTop : Number
Indicates the amount of blank space that appears between the top of the control and the outside of its cell.
LayoutData
  overrideOptions : int
[read-only]
GridData
  overrideOptionsMask : int
[read-only]
GridData
 InheritedpreferredHeight : Number = Infinity
Overridden preferred height of the control, or DefaultSize if the control should be asked for its preferred height.
LayoutData
 InheritedpreferredWidth : Number = Infinity
Overridden preferred width of the control, or DefaultSize if the control should be asked for its preferred width.
LayoutData
 InheritedvAlign : String
Indicates the vertical alignment of the control.
LayoutData
  vSpan : int
The vertical span.
GridData

Public Methods

 MethodDefined By
  
GridData(hSpan:int = 1, vSpan:int = 1)
Creates a GridData instance given the grid coordinates of the control.
GridData
  
clearOptions(options:int):void
Clears any layout options from the GridData.
GridData
  
Creates a duplicate GridData instance.
GridData
 Inherited
computePositionWithinCell(element:ILayoutElement, cellBounds:Rectangle):Rectangle
Computes the position of the control within the cell.
LayoutData
 Inherited
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
  
getSizeOptions(control:ILayoutElement, colData:GridRowData, rowData:GridRowData):int
Returns a bitwise combination of SizeOptions GROWTH | SHRINK constants, indicating whether this control wants to grow or shrink in the given dimension.
GridData
  
setOptions(options:int):void
Indicates that the GridData should always return the given SizeOptions, regardless of the contents of the GridData.
GridData
  
useDefaultOptions(options:int):void
Indicates that the GridData should compute the given size options automatically based on the contents of the layout.
GridData

Property Detail

hSpan


public var hSpan:int

The horizontal span.

overrideOptions


overrideOptions:int  [read-only]


Implementation

public function get overrideOptions():int

overrideOptionsMask


overrideOptionsMask:int  [read-only]


Implementation

public function get overrideOptionsMask():int

vSpan


public var vSpan:int

The vertical span.

Constructor Detail

GridData()


public function GridData(hSpan:int = 1, vSpan:int = 1)

Creates a GridData instance given the grid coordinates of the control.

Parameters

hSpan:int (default = 1) — The horizontal coordinate.
vSpan:int (default = 1) — The vertical coordinate.

Method Detail

clearOptions()


public function clearOptions(options:int):void

Clears any layout options from the GridData.

Indicates that the GridData should never return any of the given SizeOptions, regardless of the contents of the control. You can use this method to override the default behaviors of the layout and to control the growth options directly. For example, calling clearOptions(SizeOptions.SHRINK_VERTICAL) will cause GridData to report to its parent that it cannot be shrunk vertically, even if the layout detects that its children support shrinking.

Parameters

options:int — A bitwise combination of constants from SizeOptions that should never be returned from getSizeOptions.

clone()


public function clone():GridData

Creates a duplicate GridData instance.

Returns

GridData — A duplicate GridData instance.

getSizeOptions()


public function getSizeOptions(control:ILayoutElement, colData:GridRowData, rowData:GridRowData):int

Returns a bitwise combination of SizeOptions GROWTH | SHRINK constants, indicating whether this control wants to grow or shrink in the given dimension.

The flags have the following meaning:

  • SizeOptions.GROW_HORIZONTAL - indicates that if the control were made wider than its preferred width, it would be able to utilize the extra space.
  • SizeOptions.SHRINK_HORIZONTAL - indicates that if the control were made narrower than its preferred width, it would still be usable.
  • SizeOptions.GROW_VERTICAL - indicates that if the control were made taller than its preferred height, it would be able to utilize the extra space.
  • SizeOptions.SHRINK_VERTICAL - indicates that if the control were made shorter than its preferred height, it would still be usable.

For example, a wrapping text label would return its unwrapped dimensions as its preferred size. It would return SizeOptions.SHRINK_HORIZONTAL as its only growth flag since its parent can compress it horizontally. Compressing the label horizontally will cause it to grow vertically, but since the vertical growth is initiated by the label itself and not its parent, it should not return the SizeOptions.GROW_VERTICAL flag.

A single-line editable text box would return both the SizeOptions.GROW_HORIZONTAL flag and the SizeOptions.SHRINK_HORIZONTAL flag, since the text box would still be usable with any horizontal size. It would not return any vertical flags since a one-line text box would always be exactly the height of one line of text.

Parameters

control:ILayoutElement
colData:GridRowData
rowData:GridRowData

Returns

int

setOptions()


public function setOptions(options:int):void

Indicates that the GridData should always return the given SizeOptions, regardless of the contents of the GridData. You can use this method to override the default behaviors of the layout and to control the growth options directly. For example, calling setOptions(SizeOptions.GROW_HORIZONTAL) will cause the GridData to always report itself as horizontally resizable even if it contains no horizontally resizable contents.

Parameters

options:int — A bitwise combination of constants from SizeOptions that should always be returned from getSizeOptions.

useDefaultOptions()


public function useDefaultOptions(options:int):void

Indicates that the GridData should compute the given size options automatically based on the contents of the layout. This is the default for all options. This method can be used to undo a previous call to setOptions or clearOptions.

Parameters

options:int — A bitwise combination of constants from SizeOptions that should be computed automatically from now on.





comments powered by Disqus