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

Arrange widgets in box formation along X or Y axis at minimum size. More...

Inheritance diagram for CentrizedBoxLayout:
BoxLayout Layout

Public Member Functions

void doLayout (Container container)
 Layout widgets in container. More...
 
CentrizedBoxLayout new (int axis)
 Create layout with 0 gap. More...
 
CentrizedBoxLayout new (int axis, int gap)
 Create layout. More...
 
- Public Member Functions inherited from BoxLayout
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...
 

Additional Inherited Members

- Public Attributes inherited from BoxLayout
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 inherited from BoxLayout
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 at minimum size.

Widgets are resized to fit their requested minimum size. Extra space is distributed equally around all laid out widgets to center them in the container. In contrary to BoxLayout the widgets are not forced to equal size nor are the stretched.

Instances of this layout can be shared by multiple widgets.

Member Function Documentation

§ doLayout()

void doLayout ( Container  container)

Layout widgets in container.

Implements Layout.

§ new() [1/2]

CentrizedBoxLayout new ( int  axis)

Create layout with 0 gap.

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

§ new() [2/2]

CentrizedBoxLayout new ( int  axis,
int  gap 
)

Create layout.

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

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