Drag[en]gine Script Module DragonScript
1.23
|
Lays out widgets in a 2-column grid with the right column consuming extra space. More...
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... | |
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.
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.
void Dragengine.Gui.Layouts.FormLayout.doLayout | ( | Container | container | ) |
Layout widgets.
Implements Dragengine.Gui.Layout.
int Dragengine.Gui.Layouts.FormLayout.getGapColumns | ( | ) |
Gap between coumns.
int Dragengine.Gui.Layouts.FormLayout.getGapRows | ( | ) |
Gap between rows.
Minimal size required for layout in container.
Implements Dragengine.Gui.Layout.
|
protected |
Minimum size required for child widgets.
Minimum size of layout using reference widget height and variable width.
Implements Dragengine.Gui.Layout.
Minimum size of layout using reference width and variable height.
Implements Dragengine.Gui.Layout.
|
protected |
Minimum size required for the non-stretching column widgets.
|
protected |
Number of rows requiring stretching.
bool Dragengine.Gui.Layouts.FormLayout.getStretchRightColumn | ( | ) |
Stretch right column.
FormLayout Dragengine.Gui.Layouts.FormLayout.new | ( | ) |
Create form layout stretching the right column with no gap between child widgets.
FormLayout Dragengine.Gui.Layouts.FormLayout.new | ( | bool | stretchRightColumn, |
int | gapColumn, | ||
int | gapRow | ||
) |
Create form layout.
void Dragengine.Gui.Layouts.FormLayout.removeWidget | ( | Widget | widget | ) |
Remove widget from layout.
Implements Dragengine.Gui.Layout.
void Dragengine.Gui.Layouts.FormLayout.setGapColumns | ( | int | gap | ) |
Set gap between columns.
void Dragengine.Gui.Layouts.FormLayout.setGapRows | ( | int | gap | ) |
Set gap between rows.
void Dragengine.Gui.Layouts.FormLayout.setStretchRightColumn | ( | bool | stretchRightColumn | ) |
Set stretch right column.