Container that handles geometry for grid layouts (fixed columns and rows) using a set of declarative rules. More...
Classes | |
struct | Fr |
A fractional ratio integer. More... | |
struct | Px |
A size in pixels. More... | |
struct | TrackInfo |
Represents a track. More... | |
Public Types | |
enum class | JustifyItems : int { start = 0 , end , center , stretch } |
Possible values for the justifyItems property. More... | |
enum class | AlignItems : int { start = 0 , end , center , stretch } |
Possible values for the alignItems property. More... | |
enum class | JustifyContent { start , end , center , stretch , spaceAround , spaceBetween , spaceEvenly } |
Possible values for the justifyContent property. More... | |
enum class | AlignContent { start , end , center , stretch , spaceAround , spaceBetween , spaceEvenly } |
Possible values for the alignContent property. More... | |
enum class | AutoFlow { row , column , rowDense , columnDense } |
Possible values for the autoFlow property. More... | |
Public Member Functions | |
Grid ()=default | |
Creates an empty Grid container with default parameters. | |
void | setGap (Px sizeInPixels) noexcept |
Sets the gap between rows and columns in pixels. | |
void | performLayout (Rectangle< int >) |
Lays-out the grid's items within the given rectangle. | |
int | getNumberOfColumns () const noexcept |
Returns the number of columns. | |
int | getNumberOfRows () const noexcept |
Returns the number of rows. | |
Public Attributes | |
JustifyItems | justifyItems = JustifyItems::stretch |
Specifies the alignment of content inside the items along the rows. | |
AlignItems | alignItems = AlignItems::stretch |
Specifies the alignment of content inside the items along the columns. | |
JustifyContent | justifyContent = JustifyContent::stretch |
Specifies the alignment of items along the rows. | |
AlignContent | alignContent = AlignContent::stretch |
Specifies the alignment of items along the columns. | |
AutoFlow | autoFlow = AutoFlow::row |
Specifies how the auto-placement algorithm places items. | |
Array< TrackInfo > | templateColumns |
The set of column tracks to lay out. | |
Array< TrackInfo > | templateRows |
The set of row tracks to lay out. | |
StringArray | templateAreas |
Template areas. | |
TrackInfo | autoRows |
The row track for auto dimension. | |
TrackInfo | autoColumns |
The column track for auto dimension. | |
Px | columnGap { 0 } |
The gap in pixels between columns. | |
Px | rowGap { 0 } |
The gap in pixels between rows. | |
Array< GridItem > | items |
The set of items to lay-out. | |
Container that handles geometry for grid layouts (fixed columns and rows) using a set of declarative rules.
Implemented from the CSS Grid Layout
specification as described at: https://css-tricks.com/snippets/css/complete-guide-grid/
|
strong |
Possible values for the justifyItems property.
|
strong |
|
strong |
Possible values for the justifyContent property.
|
strong |
Possible values for the alignContent property.
|
strong |
Possible values for the autoFlow property.
|
default |
Creates an empty Grid container with default parameters.
|
noexcept |
void Grid::performLayout | ( | Rectangle< int > | ) |
Lays-out the grid's items within the given rectangle.
|
noexcept |
Returns the number of columns.
References templateColumns.
|
noexcept |
Returns the number of rows.
References templateRows.
JustifyItems Grid::justifyItems = JustifyItems::stretch |
Specifies the alignment of content inside the items along the rows.
AlignItems Grid::alignItems = AlignItems::stretch |
Specifies the alignment of content inside the items along the columns.
JustifyContent Grid::justifyContent = JustifyContent::stretch |
Specifies the alignment of items along the rows.
AlignContent Grid::alignContent = AlignContent::stretch |
Specifies the alignment of items along the columns.
AutoFlow Grid::autoFlow = AutoFlow::row |
Specifies how the auto-placement algorithm places items.
The set of column tracks to lay out.
Referenced by getNumberOfColumns().
The set of row tracks to lay out.
Referenced by getNumberOfRows().
StringArray Grid::templateAreas |
Template areas.
TrackInfo Grid::autoRows |
The row track for auto dimension.
TrackInfo Grid::autoColumns |
The column track for auto dimension.