Drag[en]gine Script Module DragonScript
1.23
|
Lay out widgets in a regular grid. More...
Public Member Functions | |
void | addWidget (Widget widget, Object settings) |
Add widget to Layout. More... | |
void | doLayout (Container container) |
Lay out widgets. More... | |
LayoutAxis | getAxis () |
Arrange direction if both row and column count is not 0. More... | |
int | getColumnCount () |
Number of columns or 0 to choose automatically. More... | |
int | getGap () |
Size of gap between 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... | |
int | getRowCount () |
Number of rows or 0 to choose automatically. More... | |
GridLayout | new (int columnCount, int rowCount) |
Create GridLayout with no gap between widgets. More... | |
GridLayout | new (int columnCount, int rowCount, int gap) |
Create GridLayout. More... | |
GridLayout | new (int columnCount, int rowCount, int gap, LayoutAxis axis) |
Create GridLayout. More... | |
void | removeWidget (Widget widget) |
Remove widget from layout. More... | |
void | setAxis (LayoutAxis axis) |
Set arrange direction if both row and column count is not 0. More... | |
void | setColumnCount (int count) |
Set number of columns or 0 to choose automatically. More... | |
void | setGap (int gap) |
Set size of gap between widgets. More... | |
void | setRowCount (int count) |
Set number of rows or 0 to choose automatically. More... | |
Protected Member Functions | |
Point | getMinimumCellSize (Container container, int width, int height) |
Minimal cell size. More... | |
Point | getMinimumSizeFor (Container container, int width, int height) |
Minimal size child widgets need. More... | |
int | getRequiredColumnCount (Container container) |
Required colunm count. More... | |
int | getRequiredRowCount (Container container) |
Required row count. More... | |
void | layoutXAxis (Container container, int columnCount, int rowCount) |
void | layoutXAxis (Container container, int columnCount, int rowCount, bool inverse) |
Lay out widgets columns first. More... | |
void | layoutYAxis (Container container, int columnCount, int rowCount) |
void | layoutYAxis (Container container, int columnCount, int rowCount, bool inverse) |
Lay out widgets rows first. More... | |
void | updateUsedAxis () |
Determine the actual axis to use for layout. More... | |
Lay out widgets in a regular grid.
Either (but not both) column or row count can be 0 in which case the required column or row count is calculated depending on the visible number of widgets.
If row and column constraint are not 0 the axis defines if widgets are arranges first in rows (LayoutAxis.y or LayoutAxis.inverseY) or columns (LayoutAxis.x or LayoutAxis.inverseX). If row count is 0 axis is ignore and LayoutAxis.y or LayoutAxis.inverseY arrangement is used. If column count is 0 axis is ignored and LayoutAxis.x or LayoutAxis.inverseX arrangement is used. If reverse or not reverse is used depends on the layout axis set in the constructor.
Instances of this layout can be shared by multiple widgets.
void Dragengine.Gui.Layouts.GridLayout.addWidget | ( | Widget | widget, |
Object | settings | ||
) |
Add widget to Layout.
Implements Dragengine.Gui.Layout.
void Dragengine.Gui.Layouts.GridLayout.doLayout | ( | Container | container | ) |
Lay out widgets.
Implements Dragengine.Gui.Layout.
LayoutAxis Dragengine.Gui.Layouts.GridLayout.getAxis | ( | ) |
Arrange direction if both row and column count is not 0.
int Dragengine.Gui.Layouts.GridLayout.getColumnCount | ( | ) |
Number of columns or 0 to choose automatically.
int Dragengine.Gui.Layouts.GridLayout.getGap | ( | ) |
Size of gap between widgets.
|
protected |
Minimal cell size.
Minimal size required for layout in container.
Implements Dragengine.Gui.Layout.
|
protected |
Minimal size child widgets need.
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 |
Required colunm count.
|
protected |
Required row count.
int Dragengine.Gui.Layouts.GridLayout.getRowCount | ( | ) |
Number of rows or 0 to choose automatically.
|
protected |
|
protected |
Lay out widgets columns first.
1.11
|
protected |
|
protected |
Lay out widgets rows first.
GridLayout Dragengine.Gui.Layouts.GridLayout.new | ( | int | columnCount, |
int | rowCount | ||
) |
Create GridLayout with no gap between widgets.
GridLayout Dragengine.Gui.Layouts.GridLayout.new | ( | int | columnCount, |
int | rowCount, | ||
int | gap | ||
) |
Create GridLayout.
GridLayout Dragengine.Gui.Layouts.GridLayout.new | ( | int | columnCount, |
int | rowCount, | ||
int | gap, | ||
LayoutAxis | axis | ||
) |
Create GridLayout.
void Dragengine.Gui.Layouts.GridLayout.removeWidget | ( | Widget | widget | ) |
Remove widget from layout.
Implements Dragengine.Gui.Layout.
void Dragengine.Gui.Layouts.GridLayout.setAxis | ( | LayoutAxis | axis | ) |
Set arrange direction if both row and column count is not 0.
void Dragengine.Gui.Layouts.GridLayout.setColumnCount | ( | int | count | ) |
Set number of columns or 0 to choose automatically.
void Dragengine.Gui.Layouts.GridLayout.setGap | ( | int | gap | ) |
Set size of gap between widgets.
void Dragengine.Gui.Layouts.GridLayout.setRowCount | ( | int | count | ) |
Set number of rows or 0 to choose automatically.
|
protected |
Determine the actual axis to use for layout.
Actual axis depends on row and column count before axis.