VSTGUI: GridLayoutProperties Struct Reference

VSTGUI 4.10 Graphical User Interface Framework not only for VST plugins

Loading...
Searching...
No Matches
Classes | Public Types | Public Attributes | List of all members
GridLayoutProperties Struct Reference
New classes » Version 4.15

Properties for configuring a grid layout, compatible with CSS Grid Layout. More...

`#include <gridlayouter.h>`

## Classes
struct | Auto
struct | GridArea
struct | Percentage

## Public Types
enum class | AlignItems { Start , Center , End , Stretch }
enum class | JustifyItems { Start , Center , End , Stretch }
enum class | AlignContent { Start , Center , End , Stretch , SpaceBetween , SpaceAround }
enum class | JustifyContent { Start , Center , End , Stretch , SpaceBetween , SpaceAround }
using | SizeSpec = std::variant<Auto, CCoord, Percentage>

## Public Attributes
size_t | rows {1}
size_t | columns {1}
std::vector< SizeSpec > | autoRows
std::vector< SizeSpec > | autoColumns
CCoord | rowGap {0.0}
CCoord | columnGap {0.0}
AlignItems | alignItems {AlignItems::Stretch}
JustifyItems | justifyItems {JustifyItems::Stretch}
AlignContent | alignContent {AlignContent::Stretch}
JustifyContent | justifyContent {JustifyContent::Stretch}
std::vector< GridArea > | gridAreas

## Detailed Description

Properties for configuring a grid layout, compatible with CSS Grid Layout.

The GridProperties struct allows you to define a grid layout similar to CSS Grid.

- rows: Number of grid rows (default: 1).
- columns: Number of grid columns (default: 1).
- autoRows: Defines the height of each row, similar to 'grid-template-rows' in CSS.
- autoColumns: Defines the width of each column, similar to 'grid-template-columns' in CSS.
- rowGap: Space between rows, equivalent to 'row-gap' in CSS.
- columnGap: Space between columns, equivalent to 'column-gap' in CSS.
- alignItems: Controls alignment of items within their grid area (CSS: 'align-items'). Options: Start, Center, End, Stretch.
- justifyItems: Controls horizontal alignment of items within their grid area (CSS: 'justify-items'). Options: Start, Center, End, Stretch.
- alignContent: Controls vertical alignment of the grid as a whole (CSS: 'align-content'). Options: Start, Center, End, Stretch, SpaceBetween, SpaceAround.
- justifyContent: Controls horizontal alignment of the grid as a whole (CSS: 'justify-content'). Options: Start, Center, End, Stretch, SpaceBetween, SpaceAround.

- gridAreas: Optional. Defines the grid area (row, column, rowSpan, colSpan) for each child/view. If provided, each child can span multiple rows/columns, similar to CSS grid-area. If not provided, each child is placed in a single cell by default.

  Note: justify-content is ignored when grid areas are used and the grid tracks exactly fit the content (no extra free space). If grid areas are used and the grid is smaller than the container, justify-content can affect the grid's position within the container.

This struct is designed to be compatible with the CSS Grid Layout specification: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout

## Member Typedef Documentation

## ◆ SizeSpec

using SizeSpec = std::variant<Auto, CCoord, Percentage>

## Member Enumeration Documentation

## ◆ AlignContent

enum class AlignContent
| strong

Enumerator
Start |
Center |
End |
Stretch |
SpaceBetween |
SpaceAround |

## ◆ AlignItems

enum class AlignItems
| strong

Enumerator
Start |
Center |
End |
Stretch |

## ◆ JustifyContent

enum class JustifyContent
| strong

Enumerator
Start |
Center |
End |
Stretch |
SpaceBetween |
SpaceAround |

## ◆ JustifyItems

enum class JustifyItems
| strong

Enumerator
Start |
Center |
End |
Stretch |

## Member Data Documentation

## ◆ alignContent

AlignContent alignContent {AlignContent::Stretch}

## ◆ alignItems

AlignItems alignItems {AlignItems::Stretch}

## ◆ autoColumns

std::vector<SizeSpec> autoColumns

## ◆ autoRows

std::vector<SizeSpec> autoRows

## ◆ columnGap

CCoord columnGap {0.0}

## ◆ columns

size_t columns {1}

## ◆ gridAreas

std::vector<GridArea> gridAreas

## ◆ justifyContent

JustifyContent justifyContent {JustifyContent::Stretch}

## ◆ justifyItems

JustifyItems justifyItems {JustifyItems::Stretch}

## ◆ rowGap

CCoord rowGap {0.0}

## ◆ rows

size_t rows {1}

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

- gridlayouter.h