LMMS
Loading...
Searching...
No Matches
juce::Grid Class Referencefinal

#include <juce_Grid.h>

Classes

struct  Px
struct  Fr
struct  TrackInfo
struct  SizeCalculation
struct  PlacementHelpers
struct  AutoPlacement
struct  BoxAlignment

Public Types

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

Public Member Functions

 Grid ()=default
 ~Grid () noexcept=default
void setGap (Px sizeInPixels) noexcept
void performLayout (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
Array< TrackInfotemplateColumns
Array< TrackInfotemplateRows
StringArray templateAreas
TrackInfo autoRows
TrackInfo autoColumns
Px columnGap { 0 }
Px rowGap { 0 }
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

@tags{GUI}

Member Enumeration Documentation

◆ AlignContent

enum class juce::Grid::AlignContent
strong

Possible values for the alignContent property.

Enumerator
start 

Items are aligned towards the top of the container.

end 

Items are aligned towards the bottom of the container.

center 

Items are aligned towards the center of the container.

stretch 

Items are stretched from top to bottom of the container.

spaceAround 

Items are evenly spaced along the column with spaces between them.

spaceBetween 

Items are evenly spaced along the column with spaces around them.

spaceEvenly 

Items are evenly spaced along the column with even amount of spaces between them.

◆ AlignItems

enum class juce::Grid::AlignItems : int
strong

Possible values for the alignItems property.

Enumerator
start 

Content inside the item is aligned towards the top.

end 

Content inside the item is aligned towards the bottom.

center 

Content inside the item is aligned towards the center.

stretch 

Content inside the item is stretched from top to bottom.

◆ AutoFlow

enum class juce::Grid::AutoFlow
strong

Possible values for the autoFlow property.

Enumerator
row 

Fills the grid by adding rows of items.

column 

Fills the grid by adding columns of items.

rowDense 

Fills the grid by adding rows of items and attempts to fill in gaps.

columnDense 

Fills the grid by adding columns of items and attempts to fill in gaps.

◆ JustifyContent

enum class juce::Grid::JustifyContent
strong

Possible values for the justifyContent property.

Enumerator
start 

Items are justified towards the left of the container.

end 

Items are justified towards the right of the container.

center 

Items are justified towards the center of the container.

stretch 

Items are stretched from left to right of the container.

spaceAround 

Items are evenly spaced along the row with spaces between them.

spaceBetween 

Items are evenly spaced along the row with spaces around them.

spaceEvenly 

Items are evenly spaced along the row with even amount of spaces between them.

◆ JustifyItems

enum class juce::Grid::JustifyItems : int
strong

Possible values for the justifyItems property.

Enumerator
start 

Content inside the item is justified towards the left.

end 

Content inside the item is justified towards the right.

center 

Content inside the item is justified towards the center.

stretch 

Content inside the item is stretched from left to right.

Constructor & Destructor Documentation

◆ Grid()

juce::Grid::Grid ( )
default

Creates an empty Grid container with default parameters.

◆ ~Grid()

juce::Grid::~Grid ( )
defaultnoexcept

Destructor

Member Function Documentation

◆ getNumberOfColumns()

int juce::Grid::getNumberOfColumns ( ) const
inlinenoexcept

Returns the number of columns.

◆ getNumberOfRows()

int juce::Grid::getNumberOfRows ( ) const
inlinenoexcept

Returns the number of rows.

◆ performLayout()

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

Lays-out the grid's items within the given rectangle.

◆ setGap()

void juce::Grid::setGap ( Px sizeInPixels)
inlinenoexcept

Sets the gap between rows and columns in pixels.

Member Data Documentation

◆ alignContent

AlignContent juce::Grid::alignContent = AlignContent::stretch

Specifies the alignment of items along the columns.

◆ alignItems

AlignItems juce::Grid::alignItems = AlignItems::stretch

Specifies the alignment of content inside the items along the columns.

◆ autoColumns

TrackInfo juce::Grid::autoColumns

The column track for auto dimension.

◆ autoFlow

AutoFlow juce::Grid::autoFlow = AutoFlow::row

Specifies how the auto-placement algorithm places items.

◆ autoRows

TrackInfo juce::Grid::autoRows

The row track for auto dimension.

◆ columnGap

Px juce::Grid::columnGap { 0 }

The gap in pixels between columns.

◆ items

Array<GridItem> juce::Grid::items

The set of items to lay-out.

◆ justifyContent

JustifyContent juce::Grid::justifyContent = JustifyContent::stretch

Specifies the alignment of items along the rows.

◆ justifyItems

JustifyItems juce::Grid::justifyItems = JustifyItems::stretch

Specifies the alignment of content inside the items along the rows.

◆ rowGap

Px juce::Grid::rowGap { 0 }

The gap in pixels between rows.

◆ templateAreas

StringArray juce::Grid::templateAreas

Template areas

◆ templateColumns

Array<TrackInfo> juce::Grid::templateColumns

The set of column tracks to lay out.

◆ templateRows

Array<TrackInfo> juce::Grid::templateRows

The set of row tracks to lay out.


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