Loading...
Searching...
No Matches
juce::GridItem Class Reference

Detailed Description

Defines an item in a Grid.

See also
Grid

Classes

struct  Margin
 Represents a margin. More...
struct  Property
 Represents a property. More...
struct  Span
 Represents a span. More...
struct  StartAndEndProperty
 Represents start and end properties. More...

Public Types

enum class  Keyword { autoValue }
enum class  JustifySelf : int {
  start = 0 , end , center , stretch ,
  autoValue
}
 Possible values for the justifySelf property. More...
enum class  AlignSelf : int {
  start = 0 , end , center , stretch ,
  autoValue
}
 Possible values for the alignSelf property. More...
enum  { useDefaultValue = -2 , notAssigned = -1 }

Public Member Functions

 GridItem () noexcept
 Creates an item with default parameters.
 GridItem (Component &componentToUse) noexcept
 Creates an item with a given Component to use.
 GridItem (Component *componentToUse) noexcept
 Creates an item with a given Component to use.
void setArea (Property rowStart, Property columnStart, Property rowEnd, Property columnEnd)
 Short-hand.
void setArea (Property rowStart, Property columnStart)
 Short-hand, span of 1 by default.
void setArea (const String &areaName)
 Short-hand.
GridItem withArea (Property rowStart, Property columnStart, Property rowEnd, Property columnEnd) const noexcept
 Short-hand.
GridItem withArea (Property rowStart, Property columnStart) const noexcept
 Short-hand, span of 1 by default.
GridItem withArea (const String &areaName) const noexcept
 Short-hand.
GridItem withRow (StartAndEndProperty row) const noexcept
 Returns a copy of this object with a new row property.
GridItem withColumn (StartAndEndProperty column) const noexcept
 Returns a copy of this object with a new column property.
GridItem withAlignSelf (AlignSelf newAlignSelf) const noexcept
 Returns a copy of this object with a new alignSelf property.
GridItem withJustifySelf (JustifySelf newJustifySelf) const noexcept
 Returns a copy of this object with a new justifySelf property.
GridItem withWidth (float newWidth) const noexcept
 Returns a copy of this object with a new width.
GridItem withHeight (float newHeight) const noexcept
 Returns a copy of this object with a new height.
GridItem withSize (float newWidth, float newHeight) const noexcept
 Returns a copy of this object with a new size.
GridItem withMargin (Margin newMargin) const noexcept
 Returns a copy of this object with a new margin.
GridItem withOrder (int newOrder) const noexcept
 Returns a copy of this object with a new order.

Public Attributes

ComponentassociatedComponent = nullptr
 If this is non-null, it represents a Component whose bounds are controlled by this item.
int order = 0
 Determines the order used to lay out items in their grid container.
JustifySelf justifySelf = JustifySelf::autoValue
 This is the justify-self property of the item.
AlignSelf alignSelf = AlignSelf::autoValue
 This is the align-self property of the item.
StartAndEndProperty column = { Keyword::autoValue, Keyword::autoValue }
 These are the start and end properties of the column.
StartAndEndProperty row = { Keyword::autoValue, Keyword::autoValue }
 These are the start and end properties of the row.
String area
float width = notAssigned
float minWidth = 0.0f
float maxWidth = notAssigned
float height = notAssigned
float minHeight = 0.0f
float maxHeight = notAssigned
Margin margin
 The margin to leave around this item.
Rectangle< float > currentBounds
 The item's current bounds.

Member Enums

◆ Keyword

enum class juce::GridItem::Keyword
strong
Enumerator
autoValue 

◆ JustifySelf

enum class juce::GridItem::JustifySelf : int
strong

Possible values for the justifySelf 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.

autoValue 

Follows the Grid container's justifyItems property.

◆ AlignSelf

enum class juce::GridItem::AlignSelf : int
strong

Possible values for the alignSelf 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.

autoValue 

Follows the Grid container's alignItems property.

◆ anonymous enum

anonymous enum
Enumerator
useDefaultValue 
notAssigned 

Constructors and Destructors

◆ GridItem() [1/3]

juce::GridItem::GridItem ( )
noexcept

◆ GridItem() [2/3]

juce::GridItem::GridItem ( Component & componentToUse)
noexcept

Creates an item with a given Component to use.

References GridItem().

◆ GridItem() [3/3]

juce::GridItem::GridItem ( Component * componentToUse)
noexcept

Creates an item with a given Component to use.

References GridItem().

Member Functions

◆ setArea() [1/3]

void juce::GridItem::setArea ( Property rowStart,
Property columnStart,
Property rowEnd,
Property columnEnd )

Short-hand.

References setArea().

Referenced by setArea(), setArea(), and setArea().

◆ setArea() [2/3]

void juce::GridItem::setArea ( Property rowStart,
Property columnStart )

Short-hand, span of 1 by default.

References setArea().

◆ setArea() [3/3]

void juce::GridItem::setArea ( const String & areaName)

Short-hand.

References setArea().

◆ withArea() [1/3]

GridItem juce::GridItem::withArea ( Property rowStart,
Property columnStart,
Property rowEnd,
Property columnEnd ) const
noexcept

Short-hand.

References GridItem(), and withArea().

Referenced by withArea(), withArea(), and withArea().

◆ withArea() [2/3]

GridItem juce::GridItem::withArea ( Property rowStart,
Property columnStart ) const
noexcept

Short-hand, span of 1 by default.

References GridItem(), and withArea().

◆ withArea() [3/3]

GridItem juce::GridItem::withArea ( const String & areaName) const
noexcept

Short-hand.

References GridItem(), and withArea().

◆ withRow()

GridItem juce::GridItem::withRow ( StartAndEndProperty row) const
noexcept

Returns a copy of this object with a new row property.

References GridItem(), row, and withRow().

Referenced by withRow().

◆ withColumn()

GridItem juce::GridItem::withColumn ( StartAndEndProperty column) const
noexcept

Returns a copy of this object with a new column property.

References column, GridItem(), and withColumn().

Referenced by withColumn().

◆ withAlignSelf()

GridItem juce::GridItem::withAlignSelf ( AlignSelf newAlignSelf) const
noexcept

Returns a copy of this object with a new alignSelf property.

References GridItem(), and withAlignSelf().

Referenced by withAlignSelf().

◆ withJustifySelf()

GridItem juce::GridItem::withJustifySelf ( JustifySelf newJustifySelf) const
noexcept

Returns a copy of this object with a new justifySelf property.

References GridItem(), and withJustifySelf().

Referenced by withJustifySelf().

◆ withWidth()

GridItem juce::GridItem::withWidth ( float newWidth) const
noexcept

Returns a copy of this object with a new width.

References GridItem(), and withWidth().

Referenced by withWidth().

◆ withHeight()

GridItem juce::GridItem::withHeight ( float newHeight) const
noexcept

Returns a copy of this object with a new height.

References GridItem(), and withHeight().

Referenced by withHeight().

◆ withSize()

GridItem juce::GridItem::withSize ( float newWidth,
float newHeight ) const
noexcept

Returns a copy of this object with a new size.

References GridItem(), and withSize().

Referenced by withSize().

◆ withMargin()

GridItem juce::GridItem::withMargin ( Margin newMargin) const
noexcept

Returns a copy of this object with a new margin.

References GridItem(), and withMargin().

Referenced by withMargin().

◆ withOrder()

GridItem juce::GridItem::withOrder ( int newOrder) const
noexcept

Returns a copy of this object with a new order.

References GridItem(), and withOrder().

Referenced by withOrder().

Member Data Documentation

◆ associatedComponent

Component* juce::GridItem::associatedComponent = nullptr

If this is non-null, it represents a Component whose bounds are controlled by this item.

◆ order

int juce::GridItem::order = 0

Determines the order used to lay out items in their grid container.

◆ justifySelf

JustifySelf juce::GridItem::justifySelf = JustifySelf::autoValue

This is the justify-self property of the item.

This determines the alignment of the item along the row.

◆ alignSelf

AlignSelf juce::GridItem::alignSelf = AlignSelf::autoValue

This is the align-self property of the item.

This determines the alignment of the item along the column.

◆ column

These are the start and end properties of the column.

Referenced by withColumn().

◆ row

These are the start and end properties of the row.

Referenced by withRow().

◆ area

String juce::GridItem::area

◆ width

float juce::GridItem::width = notAssigned

◆ minWidth

float juce::GridItem::minWidth = 0.0f

◆ maxWidth

float juce::GridItem::maxWidth = notAssigned

◆ height

float juce::GridItem::height = notAssigned

◆ minHeight

float juce::GridItem::minHeight = 0.0f

◆ maxHeight

float juce::GridItem::maxHeight = notAssigned

◆ margin

Margin juce::GridItem::margin

The margin to leave around this item.

◆ currentBounds

Rectangle<float> juce::GridItem::currentBounds

The item's current bounds.

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram