JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::GridItem Class Reference

Defines an item in a Grid. More...

#include <juce_GridItem.h>

Collaboration diagram for juce::GridItem:

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  {
  useDefaultValue = -2,
  notAssigned = -1
}
 
enum  AlignSelf : int {
  AlignSelf::start = 0,
  AlignSelf::end,
  AlignSelf::center,
  AlignSelf::stretch,
  AlignSelf::autoValue
}
 Possible values for the alignSelf property. More...
 
enum  JustifySelf : int {
  JustifySelf::start = 0,
  JustifySelf::end,
  JustifySelf::center,
  JustifySelf::stretch,
  JustifySelf::autoValue
}
 Possible values for the justifySelf property. More...
 
enum  Keyword { Keyword::autoValue }
 

Public Member Functions

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

Public Attributes

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

Detailed Description

Defines an item in a Grid.

See also
Grid

{GUI}

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
useDefaultValue 
notAssigned 

◆ AlignSelf

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.

◆ JustifySelf

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.

◆ Keyword

Enumerator
autoValue 

Constructor & Destructor Documentation

◆ GridItem() [1/3]

juce::GridItem::GridItem ( )
noexcept

Creates an item with default parameters.

◆ GridItem() [2/3]

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

Creates an item with a given Component to use.

◆ GridItem() [3/3]

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

Creates an item with a given Component to use.

◆ ~GridItem()

juce::GridItem::~GridItem ( )
noexcept

Destructor.

Member Function Documentation

◆ setArea() [1/3]

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

Short-hand.

◆ setArea() [2/3]

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

Short-hand, span of 1 by default.

◆ setArea() [3/3]

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

Short-hand.

◆ withAlignSelf()

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

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

◆ withArea() [1/3]

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

Short-hand.

◆ withArea() [2/3]

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

Short-hand, span of 1 by default.

◆ withArea() [3/3]

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

Short-hand.

◆ withColumn()

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

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

◆ withHeight()

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

Returns a copy of this object with a new height.

◆ withJustifySelf()

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

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

◆ withMargin()

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

Returns a copy of this object with a new margin.

◆ withOrder()

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

Returns a copy of this object with a new order.

◆ withRow()

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

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

◆ withSize()

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

Returns a copy of this object with a new size.

◆ withWidth()

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

Returns a copy of this object with a new width.

Member Data Documentation

◆ 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.

◆ area

juce::String juce::GridItem::area

◆ associatedComponent

juce::Component* juce::GridItem::associatedComponent = nullptr

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

◆ column

These are the start and end properties of the column.

◆ currentBounds

juce::Rectangle<float> juce::GridItem::currentBounds

The item's current bounds.

◆ height

float juce::GridItem::height = notAssigned

◆ 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.

◆ margin

Margin juce::GridItem::margin

The margin to leave around this item.

◆ maxHeight

float juce::GridItem::maxHeight = notAssigned

◆ maxWidth

float juce::GridItem::maxWidth = notAssigned

◆ minHeight

float juce::GridItem::minHeight = 0

◆ minWidth

float juce::GridItem::minWidth = 0

◆ order

int juce::GridItem::order = 0

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

◆ row

These are the start and end properties of the row.

◆ width

float juce::GridItem::width = notAssigned

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