GridLayout

Grid layout.

Widgets are arranged in a grid that has a fixed grid resolution resolution along one of the axes. The layout orientation indicates the fixed dimension; widgets are also appended on this axis. The spacing between items can be specified per axis. The horizontal/vertical alignment can be specified per row and column.

Constructors

this
this(Orientation orientation, int resolution, Alignment alignment, int margin, int spacing)

Create a 2-column grid layout by default.

Members

Functions

alignment
Alignment alignment(int axis, int item)

The Alignment of the specified axis (row or column number, depending on the Orientation) at the specified index of that row or column.

colAlignment
void colAlignment(Alignment value)

Sets the Alignment of the columns.

colAlignment
void colAlignment(Array!Alignment value)

Use this to set variable Alignment for columns.

computeLayout
void computeLayout(NVGContext nvg, Widget widget, Array!(int)[2] grid, Widget skipped)

Compute the maximum row and column sizes

margin
int margin()

The margin around this GridLayout.

margin
void margin(int margin)

Sets the margin of this GridLayout.

orientation
Orientation orientation()

The Orientation of this GridLayout.

orientation
void orientation(Orientation orientation)

Sets the Orientation of this GridLayout.

performLayout
void performLayout(NVGContext nvg, Widget widget)

See Layout.performLayout.

preferredSize
Vector2i preferredSize(NVGContext nvg, Widget widget, Widget skipped)

Implementation of the layout interface See Layout.preferredSize.

resolution
int resolution()

The number of rows or columns (depending on the Orientation) of this GridLayout.

resolution
void resolution(int resolution)

Sets the number of rows or columns (depending on the Orientation) of this GridLayout.

rowAlignment
void rowAlignment(Alignment value)

Sets the Alignment of the rows.

rowAlignment
void rowAlignment(Array!Alignment value)

Use this to set variable Alignment for rows.

spacing
int spacing(int axis)

The spacing at the specified axis (row or column number, depending on the Orientation).

spacing
void spacing(int axis, int spacing)

Sets the spacing for a specific axis.

spacing
void spacing(int spacing)

Sets the spacing for all axes.

Variables

mAlignment
Array!(Alignment)[2] mAlignment;

The actual Alignment being used.

mDefaultAlignment
Alignment[2] mDefaultAlignment;

The default Alignment for this GridLayout.

mMargin
int mMargin;

The margin around this GridLayout.

mOrientation
Orientation mOrientation;

The Orientation defining this GridLayout.

mResolution
int mResolution;

The number of rows or columns before starting a new one, depending on the Orientation.

mSpacing
Vector2i mSpacing;

The spacing used for each dimension.

Inherited Members

From Layout

performLayout
void performLayout(NVGContext nvg, Widget widget)

Performs any and all resizing applicable.

preferredSize
Vector2i preferredSize(NVGContext nvg, Widget widget, Widget skipped)

The preferred size for this layout.

Meta