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

Lay out widgets in a regular grid. More...

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

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

Detailed Description

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.

Member Function Documentation

◆ addWidget()

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

Add widget to Layout.

Implements Dragengine.Gui.Layout.

◆ doLayout()

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

Lay out widgets.

Implements Dragengine.Gui.Layout.

◆ getAxis()

LayoutAxis Dragengine.Gui.Layouts.GridLayout.getAxis ( )

Arrange direction if both row and column count is not 0.

◆ getColumnCount()

int Dragengine.Gui.Layouts.GridLayout.getColumnCount ( )

Number of columns or 0 to choose automatically.

◆ getGap()

int Dragengine.Gui.Layouts.GridLayout.getGap ( )

Size of gap between widgets.

◆ getMinimumCellSize()

Point Dragengine.Gui.Layouts.GridLayout.getMinimumCellSize ( Container  container,
int  width,
int  height 
)
protected

Minimal cell size.

◆ getMinimumSize()

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

Minimal size required for layout in container.

Implements Dragengine.Gui.Layout.

◆ getMinimumSizeFor()

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

Minimal size child widgets need.

◆ getMinimumSizeForHeight()

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

Minimum size of layout using reference width and variable height.

Implements Dragengine.Gui.Layout.

◆ getRequiredColumnCount()

int Dragengine.Gui.Layouts.GridLayout.getRequiredColumnCount ( Container  container)
protected

Required colunm count.

◆ getRequiredRowCount()

int Dragengine.Gui.Layouts.GridLayout.getRequiredRowCount ( Container  container)
protected

Required row count.

◆ getRowCount()

int Dragengine.Gui.Layouts.GridLayout.getRowCount ( )

Number of rows or 0 to choose automatically.

◆ layoutXAxis() [1/2]

void Dragengine.Gui.Layouts.GridLayout.layoutXAxis ( Container  container,
int  columnCount,
int  rowCount 
)
protected

◆ layoutXAxis() [2/2]

void Dragengine.Gui.Layouts.GridLayout.layoutXAxis ( Container  container,
int  columnCount,
int  rowCount,
bool  inverse 
)
protected

Lay out widgets columns first.

1.11

◆ layoutYAxis() [1/2]

void Dragengine.Gui.Layouts.GridLayout.layoutYAxis ( Container  container,
int  columnCount,
int  rowCount 
)
protected

◆ layoutYAxis() [2/2]

void Dragengine.Gui.Layouts.GridLayout.layoutYAxis ( Container  container,
int  columnCount,
int  rowCount,
bool  inverse 
)
protected

Lay out widgets rows first.

◆ new() [1/3]

GridLayout Dragengine.Gui.Layouts.GridLayout.new ( int  columnCount,
int  rowCount 
)

Create GridLayout with no gap between widgets.

◆ new() [2/3]

GridLayout Dragengine.Gui.Layouts.GridLayout.new ( int  columnCount,
int  rowCount,
int  gap 
)

Create GridLayout.

◆ new() [3/3]

GridLayout Dragengine.Gui.Layouts.GridLayout.new ( int  columnCount,
int  rowCount,
int  gap,
LayoutAxis  axis 
)

Create GridLayout.

◆ removeWidget()

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

Remove widget from layout.

Implements Dragengine.Gui.Layout.

◆ setAxis()

void Dragengine.Gui.Layouts.GridLayout.setAxis ( LayoutAxis  axis)

Set arrange direction if both row and column count is not 0.

◆ setColumnCount()

void Dragengine.Gui.Layouts.GridLayout.setColumnCount ( int  count)

Set number of columns or 0 to choose automatically.

◆ setGap()

void Dragengine.Gui.Layouts.GridLayout.setGap ( int  gap)

Set size of gap between widgets.

◆ setRowCount()

void Dragengine.Gui.Layouts.GridLayout.setRowCount ( int  count)

Set number of rows or 0 to choose automatically.

◆ updateUsedAxis()

void Dragengine.Gui.Layouts.GridLayout.updateUsedAxis ( )
protected

Determine the actual axis to use for layout.

Actual axis depends on row and column count before axis.


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