Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LayoutBox

An invisible element that contains another widget and adds size and layout information. The size properties do not have an effect when the LayoutBox is placed directly on a Canvas, because the size is already fixed by the coordinates on the Canvas.

Hierarchy

Index

Methods

getBottomPadding

  • getBottomPadding(): number
  • Return the number of padding pixels on the left of the child widget

    Returns number

getChild

  • getChild(): Widget | undefined
  • Return the child widget. Returns undefined if no child has been set for this LayoutBox

    Returns Widget | undefined

getHorizontalAlignment

  • getHorizontalAlignment(): number

getLeftPadding

  • getLeftPadding(): number
  • Return the number of padding pixels on the left of the child widget

    Returns number

getMaximumHeight

  • getMaximumHeight(): number
  • Return the maximum height that this box should get. Returns -1 if no maximum is set.

    Returns number

getMaximumWidth

  • getMaximumWidth(): number
  • Return the maximum width that this box should get. Returns -1 if no maximum is set.

    Returns number

getMinimumHeight

  • getMinimumHeight(): number
  • Return the minimum height that this box should get.

    Returns number

getMinimumWidth

  • getMinimumWidth(): number
  • Return the minimum width that this box should get.

    Returns number

getOverrideHeight

  • getOverrideHeight(): number
  • Return the exact height that this box should get. Returns -1 if no override is set.

    Returns number

getOverrideWidth

  • getOverrideWidth(): number
  • Return the exact width that this box should get. Returns -1 if no override is set.

    Returns number

getOwningObject

getParent

  • getParent(): Widget | undefined
  • Return the widget that contains this widget, for example a border that wraps a check box. Returns undefined if this object has no parent.

    Returns Widget | undefined

getRightPadding

  • getRightPadding(): number
  • Return the number of padding pixels on the left of the child widget

    Returns number

getTopPadding

  • getTopPadding(): number
  • Return the number of padding pixels on the left of the child widget

    Returns number

getVerticalAlignment

  • getVerticalAlignment(): number

isEnabled

  • isEnabled(): boolean

isVisible

  • isVisible(): boolean

setChild

  • Set the child widget. You can pass undefined to remove an existing child widget.

    Parameters

    Returns LayoutBox

setEnabled

  • setEnabled(enabled: boolean): this
  • Set whether the widget is enabled. When a widget is disabled, users can't interact with it and it is greyed out. When a widget that contains other widgets (like VerticalBox) is disabled, all its children behave as if disabled, too. By default, widgets are enabled.

    Parameters

    • enabled: boolean

      Whether to enable the widget.

    Returns this

setHorizontalAlignment

  • setHorizontalAlignment(alignment: number): LayoutBox

setMaximumHeight

  • setMaximumHeight(maximum: number): LayoutBox
  • Set the maximum height that this box should get. Use a negative value to disable the maximum (disabled by default).

    Parameters

    • maximum: number

    Returns LayoutBox

setMaximumWidth

  • setMaximumWidth(maximum: number): LayoutBox
  • Set the maximum width that this box should get. Use a negative value to disable the maximum (disabled by default).

    Parameters

    • maximum: number

    Returns LayoutBox

setMinimumHeight

  • setMinimumHeight(minimum: number): LayoutBox
  • Set the minimum height that this box should get (0 by default).

    Parameters

    • minimum: number

    Returns LayoutBox

setMinimumWidth

  • setMinimumWidth(minimum: number): LayoutBox
  • Set the minimum width that this box should get (0 by default).

    Parameters

    • minimum: number

    Returns LayoutBox

setOverrideHeight

  • setOverrideHeight(override: number): LayoutBox
  • Set the exact height that this box should get. Use a negative value to disable the override (disabled by default).

    Parameters

    • override: number

    Returns LayoutBox

setOverrideWidth

  • setOverrideWidth(override: number): LayoutBox
  • Set the exact width that this box should get. Use a negative value to disable the override (disabled by default).

    Parameters

    • override: number

    Returns LayoutBox

setPadding

  • setPadding(left?: number, right?: number, top?: number, bottom?: number): LayoutBox
  • Set how many pixels of padding to add around the child widget. No padding is added by default. You can use negative values to grow the widget beyond it's allotted size, or to reduce padding within parent widgets (like a ContentButton).

    Parameters

    • Optional left: number

      Padding on the left of the child widget. Default: 0

    • Optional right: number

      Padding on the right of the child widget. Default: 0

    • Optional top: number

      Padding above the child widget. Default: 0

    • Optional bottom: number

      Padding below the child widget. Default: 0

    Returns LayoutBox

setVerticalAlignment

  • setVerticalAlignment(alignment: number): LayoutBox

setVisible

  • setVisible(visible: boolean): Widget
  • Set whether the widget is visible. When a widget that contains other widgets (like VerticalBox) is invisible, all its children are invisible, too. The layout of widgets is updated when visibility changes, and invisible widgets are treated as if they don't exist.

    Parameters

    • visible: boolean

      Whether the widget is visible.

    Returns Widget