Drag[en]gine Script Module DragonScript  1.23
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

Public Member Functions

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

Protected Member Functions

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

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.

◆ doLayout()

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

◆ getAxis()

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

Axis to arrange widgets along.

◆ getGap()

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

Gap between child widgets.

◆ getMinimumSize()

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

Minimal size required for layout in container.

Implements Dragengine.Gui.Layout.

◆ 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.

◆ 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.

◆ 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.

◆ new() [1/2]

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

Create layout with 0 gap.

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

◆ 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.FlowLayout, and Dragengine.Gui.Layouts.CentrizedBoxLayout.

◆ removeWidget()

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

Remove widget from layout.

Implements Dragengine.Gui.Layout.

◆ setAxis()

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

Set axis to arrange along.

◆ setGap()

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

Set gap between child widgets.

Can be negative to overlap widgets.


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