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

Divide container into 5 areas each with at most one widget inside. More...

Inheritance diagram for BorderLayout:
Layout

Public Member Functions

void addWidget (Widget widget, Object settings)
 Add widget to layout into area. More...
 
void doLayout (Container container)
 Layout widgets in container. More...
 
Widget getBottomWidget ()
 Widget in bottom area or null if empty. More...
 
Widget getContentWidget ()
 Widget in content area or null if empty. More...
 
int getGap ()
 Gap between areas in pixels. More...
 
Widget getLeftWidget ()
 Widget in left area or null if empty. 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...
 
Widget getRightWidget ()
 Widget in right area or null if empty. More...
 
Widget getTopWidget ()
 Widget in top area or null if empty. More...
 
BorderLayout new ()
 Create layout with 0 gap. More...
 
BorderLayout new (int gap)
 Create layout. More...
 
void removeWidget (Widget widget)
 Remove widget from layout. More...
 
void setGap (int gap)
 Set gap between areas in pixels. More...
 

Public Attributes

final int BOTTOM = 4
 Place widget in bottom border. More...
 
final int CONTENT = 0
 Place widget in content area. More...
 
final int LEFT = 1
 Place widget in left border. More...
 
final int RIGHT = 3
 Place widget in right border. More...
 
final int TOP = 2
 Place widget in top border. More...
 

Protected Member Functions

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

Detailed Description

Divide container into 5 areas each with at most one widget inside.

The top, right, bottom and left area are of fixed size fitting in width respectively height the minimum size of the widget inside if present. The center area is stretched to fill the remaining space.

Instances of this layout can not be shared by multiple widgets.

Member Function Documentation

§ addWidget()

void addWidget ( Widget  widget,
Object  settings 
)

Add widget to layout into area.

Parameters
widgetWidget to add to layout.
settingsArea to place widget in. Has to be CONTENT, LEFT, TOP, RIGHT or BOTTOM.
Exceptions
EInvalidParamwidget is null.
EInvalidParamsettings is not CONTENT, LEFT, TOP, RIGHT or BOTTOM.
EInvalidParamarea is not empty.

Implements Layout.

§ doLayout()

void doLayout ( Container  container)

Layout widgets in container.

Implements Layout.

§ getBottomWidget()

Widget getBottomWidget ( )

Widget in bottom area or null if empty.

§ getContentWidget()

Widget getContentWidget ( )

Widget in content area or null if empty.

§ getGap()

int getGap ( )

Gap between areas in pixels.

§ getLeftWidget()

Widget getLeftWidget ( )

Widget in left area or null if empty.

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

§ getRightWidget()

Widget getRightWidget ( )

Widget in right area or null if empty.

§ getTopWidget()

Widget getTopWidget ( )

Widget in top area or null if empty.

§ new() [1/2]

BorderLayout new ( )

Create layout with 0 gap.

§ new() [2/2]

BorderLayout new ( int  gap)

Create layout.

Parameters
gapGap in pixels between areas. Gap can be negative to overlap areas.

§ removeWidget()

void removeWidget ( Widget  widget)

Remove widget from layout.

Implements Layout.

§ setGap()

void setGap ( int  gap)

Set gap between areas in pixels.

Can be negative to overlap widgets.

Member Data Documentation

§ BOTTOM

final int BOTTOM = 4

Place widget in bottom border.

§ CONTENT

final int CONTENT = 0

Place widget in content area.

§ LEFT

final int LEFT = 1

Place widget in left border.

§ RIGHT

final int RIGHT = 3

Place widget in right border.

§ TOP

final int TOP = 2

Place widget in top border.


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