JUCE

- Main Page
- Related Pages
- Topics
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
GridItem Class Reference
juce_gui_basics » layout

Defines an item in a Grid. More...

`#include <juce_GridItem.h>`

## 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
Component * | associatedComponent = 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.

## Detailed Description

Defines an item in a Grid.

See also
  Grid

## Member Enumeration Documentation

## ◆ Keyword

enum class GridItem::Keyword
| strong

Enumerator
autoValue |

## ◆ JustifySelf

enum class 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 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 |

## Constructor & Destructor Documentation

## ◆ GridItem() [1/3]

GridItem::GridItem | ( |  | ) |
| noexcept

Creates an item with default parameters.

## ◆ GridItem() [2/3]

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

Creates an item with a given Component to use.

## ◆ GridItem() [3/3]

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

Creates an item with a given Component to use.

## Member Function Documentation

## ◆ setArea() [1/3]

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

Short-hand.

## ◆ setArea() [2/3]

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

Short-hand, span of 1 by default.

## ◆ setArea() [3/3]

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

Short-hand.

## ◆ withArea() [1/3]

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

Short-hand.

## ◆ withArea() [2/3]

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

Short-hand, span of 1 by default.

## ◆ withArea() [3/3]

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

Short-hand.

## ◆ withRow()

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

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

## ◆ withColumn()

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

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

## ◆ withAlignSelf()

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

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

## ◆ withJustifySelf()

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

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

## ◆ withWidth()

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

Returns a copy of this object with a new width.

## ◆ withHeight()

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

Returns a copy of this object with a new height.

## ◆ withSize()

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

Returns a copy of this object with a new size.

## ◆ withMargin()

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

Returns a copy of this object with a new margin.

## ◆ withOrder()

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

Returns a copy of this object with a new order.

## Member Data Documentation

## ◆ associatedComponent

Component* GridItem::associatedComponent = nullptr

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

## ◆ order

int GridItem::order = 0

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

## ◆ justifySelf

JustifySelf 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 GridItem::alignSelf = AlignSelf::autoValue

This is the align-self property of the item.

This determines the alignment of the item along the column.

## ◆ column

StartAndEndProperty GridItem::column = { Keyword::autoValue, Keyword::autoValue }

These are the start and end properties of the column.

## ◆ row

StartAndEndProperty GridItem::row = { Keyword::autoValue, Keyword::autoValue }

These are the start and end properties of the row.

## ◆ area

String GridItem::area

## ◆ width

float GridItem::width = notAssigned

## ◆ minWidth

float GridItem::minWidth = 0.0f

## ◆ maxWidth

float GridItem::maxWidth = notAssigned

## ◆ height

float GridItem::height = notAssigned

## ◆ minHeight

float GridItem::minHeight = 0.0f

## ◆ maxHeight

float GridItem::maxHeight = notAssigned

## ◆ margin

Margin GridItem::margin

The margin to leave around this item.

## ◆ currentBounds

Rectangle<float> GridItem::currentBounds

The item's current bounds.

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

- juce_GridItem.h