A layout which arranges its widgets in a single row or column.

Hierarchy (view full)

Constructors

Properties

_alignment: BoxLayout.Alignment = 'start'
_box: null | IBoxSizing = null
_direction: BoxLayout.Direction = 'top-to-bottom'
_dirty: boolean = false
_fixed: number = 0
_items: LayoutItem[] = []
_sizers: BoxSizer[] = []
_spacing: number = 4

Accessors

  • get alignment(): BoxLayout.Alignment
  • Get the content alignment for the box layout.

    Notes

    This is the alignment of the widgets in the layout direction.

    The alignment has no effect if the widgets can expand to fill the entire box layout.

    Returns BoxLayout.Alignment

  • set alignment(value): void
  • Set the content alignment for the box layout.

    Notes

    This is the alignment of the widgets in the layout direction.

    The alignment has no effect if the widgets can expand to fill the entire box layout.

    Parameters

    Returns void

  • 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): 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 isDisposed(): boolean
  • Test whether the layout is disposed.

    Returns boolean

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

    Returns null | Widget

  • set parent(value): 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

  • Attach a widget to the parent's DOM node.

    Parameters

    • index: number

      The current index of the widget in the layout.

    • widget: Widget

      The widget to attach to the parent.

      Notes

      This is a reimplementation of the superclass method.

    Returns void

  • Detach a widget from the parent's DOM node.

    Parameters

    • index: number

      The previous index of the widget in the layout.

    • widget: Widget

      The widget to detach from the parent.

      Notes

      This is a reimplementation of the superclass method.

    Returns void

  • Insert a widget into the layout at the specified index.

    Parameters

    • index: number

      The index at which to insert the widget.

    • widget: Widget

      The widget to insert into the layout.

      Notes

      The index will be clamped to the bounds of the widgets.

      If the widget is already added to the layout, it will be moved.

      Undefined Behavior

      An index which is non-integral.

    Returns void

  • Move a widget in the parent's DOM node.

    Parameters

    • fromIndex: number

      The previous index of the widget in the layout.

    • toIndex: number

      The current index of the widget in the layout.

    • widget: Widget

      The widget to move in the parent.

      Notes

      This is a reimplementation of the superclass method.

    Returns void

  • 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

  • Process a message sent to the parent widget.

    Parameters

    • msg: Message

      The message sent to the parent widget.

      Notes

      This method is called by the parent widget to process a message.

      Subclasses may reimplement this method as needed.

    Returns void

  • Remove a widget from the 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

  • Remove the widget at a given index from the layout.

    Parameters

    • index: number

      The index of the widget to remove.

      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.

      Undefined Behavior

      An index which is non-integral.

    Returns void