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
 

Public Types

enum  JustifyItems : int { JustifyItems::start = 0, JustifyItems::end, JustifyItems::center, JustifyItems::stretch }
 
enum  AlignItems : int { AlignItems::start = 0, AlignItems::end, AlignItems::center, AlignItems::stretch }
 
enum  JustifyContent {
  JustifyContent::start, JustifyContent::end, JustifyContent::center, JustifyContent::stretch,
  JustifyContent::spaceAround, JustifyContent::spaceBetween, JustifyContent::spaceEvenly
}
 
enum  AlignContent {
  AlignContent::start, AlignContent::end, AlignContent::center, AlignContent::stretch,
  AlignContent::spaceAround, AlignContent::spaceBetween, AlignContent::spaceEvenly
}
 
enum  AutoFlow { AutoFlow::row, AutoFlow::column, AutoFlow::rowDense, AutoFlow::columnDense }
 

Public Member Functions

 Grid () noexcept
 
 ~Grid () noexcept
 Destructor. More...
 
void setGap (Px sizeInPixels) noexcept
 
void performLayout (juce::Rectangle< int >)
 
int getNumberOfColumns () const noexcept
 
int getNumberOfRows () const noexcept
 

Public Attributes

JustifyItems justifyItems = JustifyItems::stretch
 
AlignItems alignItems = AlignItems::stretch
 
JustifyContent justifyContent = JustifyContent::stretch
 
AlignContent alignContent = AlignContent::stretch
 
AutoFlow autoFlow = AutoFlow::row
 
juce::Array< TrackInfotemplateColumns
 
juce::Array< TrackInfotemplateRows
 
juce::StringArray templateAreas
 Template areas. More...
 
TrackInfo autoRows
 
TrackInfo autoColumns
 
Px columnGap { 0 }
 
Px rowGap { 0 }
 
juce::Array< GridItemitems
 

Detailed Description

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/

See also
GridItem

Member Enumeration Documentation

◆ JustifyItems

enum Grid::JustifyItems : int
strong
Enumerator
start 
end 
center 
stretch 

◆ AlignItems

enum Grid::AlignItems : int
strong
Enumerator
start 
end 
center 
stretch 

◆ JustifyContent

enum Grid::JustifyContent
strong
Enumerator
start 
end 
center 
stretch 
spaceAround 
spaceBetween 
spaceEvenly 

◆ AlignContent

enum Grid::AlignContent
strong
Enumerator
start 
end 
center 
stretch 
spaceAround 
spaceBetween 
spaceEvenly 

◆ AutoFlow

enum Grid::AutoFlow
strong
Enumerator
row 
column 
rowDense 
columnDense 

Constructor & Destructor Documentation

◆ Grid()

Grid::Grid ( )
noexcept

◆ ~Grid()

Grid::~Grid ( )
noexcept

Destructor.

Member Function Documentation

◆ setGap()

void Grid::setGap ( Px  sizeInPixels)
noexcept

◆ performLayout()

void Grid::performLayout ( juce::Rectangle< int >  )

◆ getNumberOfColumns()

int Grid::getNumberOfColumns ( ) const
noexcept

◆ getNumberOfRows()

int Grid::getNumberOfRows ( ) const
noexcept

Member Data Documentation

◆ justifyItems

JustifyItems Grid::justifyItems = JustifyItems::stretch

◆ alignItems

AlignItems Grid::alignItems = AlignItems::stretch

◆ justifyContent

JustifyContent Grid::justifyContent = JustifyContent::stretch

◆ alignContent

AlignContent Grid::alignContent = AlignContent::stretch

◆ autoFlow

AutoFlow Grid::autoFlow = AutoFlow::row

◆ templateColumns

juce::Array<TrackInfo> Grid::templateColumns

◆ templateRows

juce::Array<TrackInfo> Grid::templateRows

◆ templateAreas

juce::StringArray Grid::templateAreas

Template areas.

◆ autoRows

TrackInfo Grid::autoRows

◆ autoColumns

TrackInfo Grid::autoColumns

◆ columnGap

Px Grid::columnGap { 0 }

◆ rowGap

Px Grid::rowGap { 0 }

◆ items

juce::Array<GridItem> Grid::items

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