FTXUI  5.0.0
C++ functional terminal UI.
FlexboxConfig Struct Reference

Public Types

enum class  Direction { Row , RowInversed , Column , ColumnInversed }
 
enum class  Wrap { NoWrap , Wrap , WrapInversed }
 
enum class  JustifyContent {
  FlexStart , FlexEnd , Center , Stretch ,
  SpaceBetween , SpaceAround , SpaceEvenly
}
 
enum class  AlignItems { FlexStart , FlexEnd , Center , Stretch }
 
enum class  AlignContent {
  FlexStart , FlexEnd , Center , Stretch ,
  SpaceBetween , SpaceAround , SpaceEvenly
}
 

Public Member Functions

FlexboxConfigSet (FlexboxConfig::Direction)
 Set the flexbox direction. More...
 
FlexboxConfigSet (FlexboxConfig::Wrap)
 Set the flexbox wrap. More...
 
FlexboxConfigSet (FlexboxConfig::JustifyContent)
 Set the flexbox justify content. More...
 
FlexboxConfigSet (FlexboxConfig::AlignItems)
 Set the flexbox align items. More...
 
FlexboxConfigSet (FlexboxConfig::AlignContent)
 Set the flexbox align content. More...
 
FlexboxConfigSetGap (int gap_x, int gap_y)
 Set the flexbox flex direction. More...
 

Data Fields

Direction direction = Direction::Row
 
Wrap wrap = Wrap::Wrap
 
JustifyContent justify_content = JustifyContent::FlexStart
 
AlignItems align_items = AlignItems::FlexStart
 
AlignContent align_content = AlignContent::FlexStart
 
int gap_x = 0
 
int gap_y = 0
 

Detailed Description

Member Enumeration Documentation

◆ Direction

enum class Direction
strong

This establishes the main-axis, thus defining the direction flex items are placed in the flex container. Flexbox is (aside wrapping) single-direction layout concept. Think of flex items as primarily laying out either in horizontal rows or vertical columns.

Enumerator
Row 

Flex items are laid out in a row.

RowInversed 

Flex items are laid out in a row, but in reverse order.

Column 

Flex items are laid out in a column.

ColumnInversed 

Flex items are laid out in a column, but in reverse order.

Definition at line 20 of file flexbox_config.hpp.

◆ Wrap

enum class Wrap
strong

By default, flex items will all try to fit onto one line. You can change that and allow the items to wrap as needed with this property.

Enumerator
NoWrap 

Flex items will all try to fit onto one line.

Wrap 

Flex items will wrap onto multiple lines.

WrapInversed 

Flex items will wrap onto multiple lines, but in reverse order.

Definition at line 31 of file flexbox_config.hpp.

◆ JustifyContent

enum class JustifyContent
strong

This defines the alignment along the main axis. It helps distribute extra free space leftover when either all the flex items on a line are inflexible, or are flexible but have reached their maximum size. It also exerts some control over the alignment of items when they overflow the line.

Enumerator
FlexStart 

Items are aligned to the start of flexbox's direction.

FlexEnd 

Items are aligned to the end of flexbox's direction.

Center 

Items are centered along the line.

Stretch 

Items are stretched to fill the line.

SpaceBetween 

Items are evenly distributed in the line; first item is on the start.

SpaceAround 

Items are evenly distributed in the line with equal space around them. Note that visually the spaces aren’t equal, since all the items have equal space on both sides. The first item will have one unit of space against the container edge, but two units of space between the next item because that next item has its own spacing that applies.

SpaceEvenly 

Items are distributed so that the spacing between any two items (and the space to the edges) is equal.

Definition at line 44 of file flexbox_config.hpp.

◆ AlignItems

enum class AlignItems
strong

This defines the default behavior for how flex items are laid out along the cross axis on the current line. Think of it as the justify-content version for the cross-axis (perpendicular to the main-axis).

Enumerator
FlexStart 

items are placed at the start of the cross axis.

FlexEnd 

items are placed at the end of the cross axis.

Center 

items are centered along the cross axis.

Stretch 

items are stretched to fill the cross axis.

Definition at line 71 of file flexbox_config.hpp.

◆ AlignContent

enum class AlignContent
strong
Enumerator
FlexStart 

items are placed at the start of the cross axis.

FlexEnd 

items are placed at the end of the cross axis.

Center 

items are centered along the cross axis.

Stretch 

items are stretched to fill the cross axis.

SpaceBetween 

items are evenly distributed in the cross axis.

SpaceAround 

tems evenly distributed with equal space around each line.

SpaceEvenly 

items are evenly distributed in the cross axis with equal space around them.

Definition at line 82 of file flexbox_config.hpp.

Member Function Documentation

◆ Set() [1/5]

Set the flexbox direction.

Examples
examples/component/flexbox_gallery.cpp.

Definition at line 10 of file flexbox_config.cpp.

◆ Set() [2/5]

Set the flexbox wrap.

Definition at line 17 of file flexbox_config.cpp.

◆ Set() [3/5]

Set the flexbox justify content.

Definition at line 24 of file flexbox_config.cpp.

◆ Set() [4/5]

Set the flexbox align items.

Definition at line 31 of file flexbox_config.cpp.

◆ Set() [5/5]

Set the flexbox align content.

Definition at line 38 of file flexbox_config.cpp.

◆ SetGap()

FlexboxConfig & SetGap ( int  gap_x,
int  gap_y 
)

Set the flexbox flex direction.

Examples
examples/component/homescreen.cpp.

Definition at line 45 of file flexbox_config.cpp.

Field Documentation

◆ direction

Examples
examples/component/flexbox_gallery.cpp.

Definition at line 27 of file flexbox_config.hpp.

◆ wrap

Wrap wrap = Wrap::Wrap
Examples
examples/component/flexbox_gallery.cpp.

Definition at line 37 of file flexbox_config.hpp.

◆ justify_content

◆ align_items

◆ align_content

◆ gap_x

int gap_x = 0

Definition at line 95 of file flexbox_config.hpp.

◆ gap_y

int gap_y = 0

Definition at line 96 of file flexbox_config.hpp.


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