A layout which arranges its widgets in a grid.

Hierarchy

Constructors

Properties

_box: null | IBoxSizing = null
_columnSizers: BoxSizer[] = ...
_columnSpacing: number = 4
_columnStarts: number[] = []
_dirty: boolean = false
_items: LayoutItem[] = []
_rowSizers: BoxSizer[] = ...
_rowSpacing: number = 4
_rowStarts: number[] = []

Accessors

  • get fitPolicy(): FitPolicy
  • Get the fit policy for the layout.

    Notes

    The fit policy controls the computed size constraints which are applied to the parent widget by the layout.

    Some layout implementations may ignore the fit policy.

    Returns FitPolicy

  • set fitPolicy(value: FitPolicy): void
  • Set the fit policy for the layout.

    Notes

    The fit policy controls the computed size constraints which are applied to the parent widget by the layout.

    Some layout implementations may ignore the fit policy.

    Changing the fit policy will clear the current size constraint for the parent widget and then re-fit the parent.

    Parameters

    Returns void

  • get parent(): null | Widget
  • Get the parent widget of the layout.

    Returns null | Widget

  • set parent(value: null | Widget): void
  • Set the parent widget of the layout.

    Notes

    This is set automatically when installing the layout on the parent widget. The parent widget should not be set directly by user code.

    Parameters

    Returns void

Methods

  • Update the layout position and size of the widgets.

    The parent offset dimensions should be -1 if unknown.

    Parameters

    • offsetWidth: number
    • offsetHeight: number

    Returns void

  • Get the stretch factor for a specific column.

    Returns

    The stretch factor for the column.

    Notes

    This returns -1 if the index is out of range.

    Parameters

    • index: number

      The column index of interest.

    Returns number

  • A message handler invoked on an 'after-attach' message.

    Notes

    The default implementation of this method forwards the message to all widgets. It assumes all widget nodes are attached to the parent widget node.

    This may be reimplemented by subclasses as needed.

    Parameters

    Returns void

  • A message handler invoked on an 'after-detach' message.

    Notes

    The default implementation of this method forwards the message to all widgets. It assumes all widget nodes are attached to the parent widget node.

    This may be reimplemented by subclasses as needed.

    Parameters

    Returns void

  • A message handler invoked on an 'after-hide' message.

    Notes

    The default implementation of this method forwards the message to all non-hidden widgets. It assumes all widget nodes are attached to the parent widget node.

    This may be reimplemented by subclasses as needed.

    Parameters

    Returns void

  • A message handler invoked on an 'after-show' message.

    Notes

    The default implementation of this method forwards the message to all non-hidden widgets. It assumes all widget nodes are attached to the parent widget node.

    This may be reimplemented by subclasses as needed.

    Parameters

    Returns void

  • A message handler invoked on a 'before-detach' message.

    Notes

    The default implementation of this method forwards the message to all widgets. It assumes all widget nodes are attached to the parent widget node.

    This may be reimplemented by subclasses as needed.

    Parameters

    Returns void

  • A message handler invoked on a 'before-hide' message.

    Notes

    The default implementation of this method forwards the message to all non-hidden widgets. It assumes all widget nodes are attached to the parent widget node.

    This may be reimplemented by subclasses as needed.

    Parameters

    Returns void

  • Remove a widget from the grid layout.

    Parameters

    • widget: Widget

      The widget to remove from the layout.

      Notes

      A widget is automatically removed from the layout when its parent is set to null. This method should only be invoked directly when removing a widget from a layout which has yet to be installed on a parent widget.

      This method does not modify the widget's parent.

    Returns void

  • Get the stretch factor for a specific row.

    Returns

    The stretch factor for the row.

    Notes

    This returns -1 if the index is out of range.

    Parameters

    • index: number

      The row index of interest.

    Returns number

  • Set the stretch factor for a specific column.

    Parameters

    • index: number

      The column index of interest.

    • value: number

      The stretch factor for the column.

      Notes

      This is a no-op if the index is out of range.

    Returns void

  • Set the stretch factor for a specific row.

    Parameters

    • index: number

      The row index of interest.

    • value: number

      The stretch factor for the row.

      Notes

      This is a no-op if the index is out of range.

    Returns void

Generated using TypeDoc