Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Gui.Layouts.BoxLayout Class Reference

Arrange widgets in box formation along X or Y axis enlarging them evenly. More...

Inheritance diagram for Dragengine.Gui.Layouts.BoxLayout:
Dragengine.Gui.Layout Dragengine.Gui.Layouts.CentrizedBoxLayout Dragengine.Gui.Layouts.FlowLayout Dragengine.Gui.Layouts.WeightLayout

Public Member Functions

void addWidget (Widget widget, Object settings)
 Add widget to layout using settings.
void doLayout (Container container)
 Layout widgets in container.
LayoutAxis getAxis ()
 Axis to arrange widgets along.
int getGap ()
 Gap between child widgets.
Point getMinimumSize (Container container)
 Minimal size required for layout in container.
Point getMinimumSizeForHeight (Container container, int height)
 Minimum size of layout using reference widget height and variable width.
Point getMinimumSizeForWidth (Container container, int width)
 Minimum size of layout using reference width and variable height.
BoxLayout new (LayoutAxis axis)
 Create layout with 0 gap.
BoxLayout new (LayoutAxis axis, int gap)
 Create layout.
void removeWidget (Widget widget)
 Remove widget from layout.
void setAxis (LayoutAxis axis)
 Set axis to arrange along.
void setGap (int gap)
 Set gap between child widgets.

Protected Member Functions

Point getMinimumSizeFor (Container container, int width, int height)
 Minimum size of layout using reference and variable size.

Detailed Description

Arrange widgets in box formation along X or Y axis enlarging them evenly.

Instances of this layout can be shared by multiple widgets.

Member Function Documentation

◆ addWidget()

void Dragengine.Gui.Layouts.BoxLayout.addWidget ( Widget widget,
Object settings )

Add widget to layout using settings.

Parameters
widgetWidget to add to layout.
settingsNot used.

Implements Dragengine.Gui.Layout.

Reimplemented in Dragengine.Gui.Layouts.WeightLayout.

Referenced by getMinimumSize().

◆ doLayout()

void Dragengine.Gui.Layouts.BoxLayout.doLayout ( Container container)

◆ getAxis()

LayoutAxis Dragengine.Gui.Layouts.BoxLayout.getAxis ( )

◆ getGap()

int Dragengine.Gui.Layouts.BoxLayout.getGap ( )

◆ getMinimumSize()

Point Dragengine.Gui.Layouts.BoxLayout.getMinimumSize ( Container container)

Minimal size required for layout in container.

Implements Dragengine.Gui.Layout.

References addWidget().

Referenced by getMinimumSizeFor().

◆ getMinimumSizeFor()

Point Dragengine.Gui.Layouts.BoxLayout.getMinimumSizeFor ( Container container,
int width,
int height )
protected

Minimum size of layout using reference and variable size.

If LayoutAxis.x is used height is the reference size. If LayoutAxis.y is used width is the reference size.

Reimplemented in Dragengine.Gui.Layouts.WeightLayout.

References getMinimumSize(), getMinimumSizeFor(), getMinimumSizeForHeight(), getMinimumSizeForWidth(), and new().

Referenced by Dragengine.Gui.Layouts.CentrizedBoxLayout.doLayout(), Dragengine.Gui.Layouts.FlowLayout.doLayout(), and getMinimumSizeFor().

◆ getMinimumSizeForHeight()

Point Dragengine.Gui.Layouts.BoxLayout.getMinimumSizeForHeight ( Container container,
int height )

Minimum size of layout using reference widget height and variable width.

Implements Dragengine.Gui.Layout.

References doLayout().

Referenced by Dragengine.Gui.Layouts.CentrizedBoxLayout.doLayout(), Dragengine.Gui.Layouts.FlowLayout.doLayout(), and getMinimumSizeFor().

◆ getMinimumSizeForWidth()

Point Dragengine.Gui.Layouts.BoxLayout.getMinimumSizeForWidth ( Container container,
int width )

Minimum size of layout using reference width and variable height.

Implements Dragengine.Gui.Layout.

References removeWidget().

Referenced by Dragengine.Gui.Layouts.CentrizedBoxLayout.doLayout(), Dragengine.Gui.Layouts.FlowLayout.doLayout(), and getMinimumSizeFor().

◆ new() [1/2]

BoxLayout Dragengine.Gui.Layouts.BoxLayout.new ( LayoutAxis axis)

◆ new() [2/2]

BoxLayout Dragengine.Gui.Layouts.BoxLayout.new ( LayoutAxis axis,
int gap )

Create layout.

Parameters
gapSize of gap between child widgets. Can be negative to overlap widgets.
Exceptions
EInvalidParamaxis is not LayoutAxis.x, LayoutAxis.y, LayoutAxis.inverseX or LayoutAxis.inverseY.

Reimplemented in Dragengine.Gui.Layouts.CentrizedBoxLayout, Dragengine.Gui.Layouts.FlowLayout, and Dragengine.Gui.Layouts.WeightLayout.

References new(), and setAxis().

◆ removeWidget()

void Dragengine.Gui.Layouts.BoxLayout.removeWidget ( Widget widget)

Remove widget from layout.

Implements Dragengine.Gui.Layout.

Reimplemented in Dragengine.Gui.Layouts.WeightLayout.

References setAxis().

Referenced by getMinimumSizeForWidth().

◆ setAxis()

void Dragengine.Gui.Layouts.BoxLayout.setAxis ( LayoutAxis axis)

Set axis to arrange along.

References getAxis(), and setGap().

Referenced by new(), new(), and removeWidget().

◆ setGap()

void Dragengine.Gui.Layouts.BoxLayout.setGap ( int gap)

Set gap between child widgets.

Can be negative to overlap widgets.

References getGap().

Referenced by getGap(), and setAxis().


The documentation for this class was generated from the following file: