Drag[en]gine Script Module DragonScript Script API  1.0
BoxLayout Class Reference

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

Inheritance diagram for BoxLayout:
Layout CentrizedBoxLayout 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...
 
int 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 (int axis)
 Create layout with 0 gap. More...
 
BoxLayout new (int axis, int gap)
 Create layout. More...
 
void removeWidget (Widget widget)
 Remove widget from layout. More...
 
void setAxis (int axis)
 Set axis to arrange along. More...
 
void setGap (int gap)
 Set gap between child widgets. More...
 

Public Attributes

final int X_AXIS = 0
 Arrange along X axis. More...
 
final int X_AXIS_NEG = 2
 Arrange along negative X axis. More...
 
final int Y_AXIS = 1
 Arrange along Y axis. More...
 
final int Y_AXIS_NEG = 3
 Arrange along negative Y axis. 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 addWidget ( Widget  widget,
Object  settings 
)

Add widget to layout using settings.

Parameters
widgetWidget to add to layout.
settingsNot used.

Implements Layout.

§ doLayout()

void doLayout ( Container  container)

Layout widgets in container.

Implements Layout.

§ getAxis()

int getAxis ( )

Axis to arrange widgets along.

§ getGap()

int getGap ( )

Gap between child widgets.

§ getMinimumSize()

Point getMinimumSize ( Container  container)

Minimal size required for layout in container.

Implements Layout.

§ getMinimumSizeFor()

Point getMinimumSizeFor ( Container  container,
int  width,
int  height 
)
protected

Minimum size of layout using reference and variable size.

If X_AXIS is used height is the reference size. If Y_AXIS is used widthis the reference size.

§ getMinimumSizeForHeight()

Point getMinimumSizeForHeight ( Container  container,
int  height 
)

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

Implements Layout.

§ getMinimumSizeForWidth()

Point getMinimumSizeForWidth ( Container  container,
int  width 
)

Minimum size of layout using reference width and variable height.

Implements Layout.

§ new() [1/2]

BoxLayout new ( int  axis)

Create layout with 0 gap.

Parameters
axisAxis to aling along. Has to be X_AXIS, Y_AXIS, X_AXIS_NEG or Y_AXIS_NEG.
Exceptions
EInvalidParamaxis is not X_AXIS, Y_AXIS, X_AXIS_NEG or Y_AXIS_NEG.

§ new() [2/2]

BoxLayout new ( int  axis,
int  gap 
)

Create layout.

Parameters
axisAxis to aling along. Has to be X_AXIS, Y_AXIS, X_AXIS_NEG or Y_AXIS_NEG.
gapSize of gap between child widgets. Can be negative to overlap widgets.
Exceptions
EInvalidParamaxis is not X_AXIS, Y_AXIS, X_AXIS_NEG or Y_AXIS_NEG.

§ removeWidget()

void removeWidget ( Widget  widget)

Remove widget from layout.

Implements Layout.

§ setAxis()

void setAxis ( int  axis)

Set axis to arrange along.

Parameters
axisAxis to aling along. Has to be X_AXIS, Y_AXIS, X_AXIS_NEG or Y_AXIS_NEG.
Exceptions
EInvalidParamaxis is not X_AXIS, Y_AXIS, X_AXIS_NEG or Y_AXIS_NEG.

§ setGap()

void setGap ( int  gap)

Set gap between child widgets.

Can be negative to overlap widgets.

Member Data Documentation

§ X_AXIS

final int X_AXIS = 0

Arrange along X axis.

§ X_AXIS_NEG

final int X_AXIS_NEG = 2

Arrange along negative X axis.

§ Y_AXIS

final int Y_AXIS = 1

Arrange along Y axis.

§ Y_AXIS_NEG

final int Y_AXIS_NEG = 3

Arrange along negative Y axis.


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