Drag[en]gine Script Module DragonScript  1.23
Dragengine.Gui.Layouts.FormLayout Class Reference

Lays out widgets in a 2-column grid with the right column consuming extra space. More...

Inheritance diagram for Dragengine.Gui.Layouts.FormLayout:
Dragengine.Gui.Layout

Classes

class  LayoutSettings
 Widget layout settings. More...
 

Public Member Functions

void addWidget (Widget widget, Object settings)
 Add Widget to Layout using settings of type LayoutSettings or null to use default. More...
 
void doLayout (Container container)
 Layout widgets. More...
 
int getGapColumns ()
 Gap between coumns. More...
 
int getGapRows ()
 Gap between rows. 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...
 
bool getStretchRightColumn ()
 Stretch right column. More...
 
FormLayout new ()
 Create form layout stretching the right column with no gap between child widgets. More...
 
FormLayout new (bool stretchRightColumn, int gapColumn, int gapRow)
 Create form layout. More...
 
void removeWidget (Widget widget)
 Remove widget from layout. More...
 
void setGapColumns (int gap)
 Set gap between columns. More...
 
void setGapRows (int gap)
 Set gap between rows. More...
 
void setStretchRightColumn (bool stretchRightColumn)
 Set stretch right column. More...
 

Protected Member Functions

Point getMinimumSizeFor (Container container, int width)
 Minimum size required for child widgets. More...
 
int getNoStretchColumnWidth (Container container, int width)
 Minimum size required for the non-stretching column widgets. More...
 
int getNumRowsStretch (Container container)
 Number of rows requiring stretching. More...
 

Detailed Description

Lays out widgets in a 2-column grid with the right column consuming extra space.

Simplifies laying out controls for configuration windows and other widgets where pairs of widgets are located under each other. The label widgets on the left side and the control widgets on the right side are aligned with their left and right edges. The label widget column consumes the minimal width required to show all labels. The right column stretches to fill the parent container.

Widgets can be assigned a constraint while adding to the layout. The default constraint stretches the widget to fill the entire cell it is located in. The constraint can be changed to not stretch the component to fill the cell in either direction. In addition the height of the row the widget belongs to can be set to consume extra space for example if the control widget is a text area. The row stretches in height if at least one of the widgets inside specifies the stretch constraint.

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

Member Function Documentation

◆ addWidget()

void Dragengine.Gui.Layouts.FormLayout.addWidget ( Widget  widget,
Object  settings 
)

Add Widget to Layout using settings of type LayoutSettings or null to use default.

Implements Dragengine.Gui.Layout.

◆ doLayout()

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

Layout widgets.

Implements Dragengine.Gui.Layout.

◆ getGapColumns()

int Dragengine.Gui.Layouts.FormLayout.getGapColumns ( )

Gap between coumns.

◆ getGapRows()

int Dragengine.Gui.Layouts.FormLayout.getGapRows ( )

Gap between rows.

◆ getMinimumSize()

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

Minimal size required for layout in container.

Implements Dragengine.Gui.Layout.

◆ getMinimumSizeFor()

Point Dragengine.Gui.Layouts.FormLayout.getMinimumSizeFor ( Container  container,
int  width 
)
protected

Minimum size required for child widgets.

◆ getMinimumSizeForHeight()

Point Dragengine.Gui.Layouts.FormLayout.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.FormLayout.getMinimumSizeForWidth ( Container  container,
int  width 
)

Minimum size of layout using reference width and variable height.

Implements Dragengine.Gui.Layout.

◆ getNoStretchColumnWidth()

int Dragengine.Gui.Layouts.FormLayout.getNoStretchColumnWidth ( Container  container,
int  width 
)
protected

Minimum size required for the non-stretching column widgets.

◆ getNumRowsStretch()

int Dragengine.Gui.Layouts.FormLayout.getNumRowsStretch ( Container  container)
protected

Number of rows requiring stretching.

◆ getStretchRightColumn()

bool Dragengine.Gui.Layouts.FormLayout.getStretchRightColumn ( )

Stretch right column.

◆ new() [1/2]

FormLayout Dragengine.Gui.Layouts.FormLayout.new ( )

Create form layout stretching the right column with no gap between child widgets.

◆ new() [2/2]

FormLayout Dragengine.Gui.Layouts.FormLayout.new ( bool  stretchRightColumn,
int  gapColumn,
int  gapRow 
)

Create form layout.

◆ removeWidget()

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

Remove widget from layout.

Implements Dragengine.Gui.Layout.

◆ setGapColumns()

void Dragengine.Gui.Layouts.FormLayout.setGapColumns ( int  gap)

Set gap between columns.

◆ setGapRows()

void Dragengine.Gui.Layouts.FormLayout.setGapRows ( int  gap)

Set gap between rows.

◆ setStretchRightColumn()

void Dragengine.Gui.Layouts.FormLayout.setStretchRightColumn ( bool  stretchRightColumn)

Set stretch right column.


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