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

Arrange widgets to fill the entire container fully covering each other. More...

Inheritance diagram for StackLayout:
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...
 
int getAspectRatio ()
 Aspect ratio mode. 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...
 
StackLayout new ()
 Create layout with STRETCH aspect ratio mode. More...
 
StackLayout new (int aspectRatio)
 Create layout. More...
 
void removeWidget (Widget widget)
 Remove widget from layout. More...
 
void setAspectRatio (int aspectRatio)
 Set aspect ratio mode. More...
 

Public Attributes

final int CLIP = 2
 Protect aspect ratio clipping widget to fill available space. More...
 
final int FIT = 1
 Protect aspect ratio fitting widget into available space. More...
 
final int STRETCH = 0
 No aspect ratio protection. More...
 

Detailed Description

Arrange widgets to fill the entire container fully covering each other.

Widgets should be transparent for this layout to work best.

Instances of this layout can 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.
settingsNot used.
Exceptions
EInvalidParamwidget is null.

Implements Layout.

§ doLayout()

void doLayout ( Container  container)

Layout widgets in container.

Implements Layout.

§ getAspectRatio()

int getAspectRatio ( )

Aspect ratio mode.

§ getMinimumSize()

Point getMinimumSize ( Container  container)

Minimal size required for layout in container.

Implements Layout.

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

StackLayout new ( )

Create layout with STRETCH aspect ratio mode.

§ new() [2/2]

StackLayout new ( int  aspectRatio)

Create layout.

Parameters
aspectRatioAspect ratio mode. Has to be STRETCH, FIT or CLIP.
Exceptions
EInvalidParamaspectRatio is not STRETCH, FIT or CLIP.

§ removeWidget()

void removeWidget ( Widget  widget)

Remove widget from layout.

Implements Layout.

§ setAspectRatio()

void setAspectRatio ( int  aspectRatio)

Set aspect ratio mode.

Has to be STRETCH, FIT or CLIP.

Member Data Documentation

§ CLIP

final int CLIP = 2

Protect aspect ratio clipping widget to fill available space.

Widgets are guaranteed to keep their aspect ratio. The size and position is corrected in a way the widget entirely fills the container. This ensures no empty borders exist around widgets widgets but potentially clips widgets.

§ FIT

final int FIT = 1

Protect aspect ratio fitting widget into available space.

Widgets are guaranteed to keep their aspect ratio. The size and position is corrected in a way the widget fits entirely inside the container. This ensures widgets are not clipped and are fully visible but potentially introduces empty borders.

§ STRETCH

final int STRETCH = 0

No aspect ratio protection.

Widgets can turn out stretched loosing their aspect ratio.


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