stmm-games-doc  0.32.0
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
stmg::WidgetAxisFit Struct Reference

Widget alignment position and expansion behavior for one axis. More...

Public Types

enum  ALIGN { ALIGN_FILL = 0, ALIGN_START = 1, ALIGN_CENTER = 2, ALIGN_END = 3 }
 Widget alignment. More...
 

Public Member Functions

 WidgetAxisFit () noexcept
 Default constructor. More...
 
 WidgetAxisFit (bool bExpand, ALIGN eAlign) noexcept
 Constructor. More...
 
double getAlign () const noexcept
 Returns the align as a from 0 to 1 or -1 if ALIGN_FILL. More...
 
void dump (int32_t nIndentSpaces) const noexcept
 
void dump () const noexcept
 

Static Public Member Functions

static double getAlign (ALIGN eAlign) noexcept
 Returns the align as a from 0 to 1 or -1 if ALIGN_FILL. More...
 

Public Attributes

bool m_bExpand = false
 Whether the widgets claims a share of extra available space in the container. More...
 
ALIGN m_eAlign = ALIGN_CENTER
 The widget alignment. More...
 

Detailed Description

Widget alignment position and expansion behavior for one axis.

Member Enumeration Documentation

◆ ALIGN

Widget alignment.

Enumerator
ALIGN_FILL 

Widget should fill all the available space.

ALIGN_START 

Depending on direction place at top or left of available space.

ALIGN_CENTER 

Place at center of available space.

ALIGN_END 

Depending on direction place at bottom or right of available space.

Constructor & Destructor Documentation

◆ WidgetAxisFit() [1/2]

stmg::WidgetAxisFit::WidgetAxisFit ( )
inlinenoexcept

Default constructor.

◆ WidgetAxisFit() [2/2]

stmg::WidgetAxisFit::WidgetAxisFit ( bool  bExpand,
ALIGN  eAlign 
)
inlinenoexcept

Constructor.

Member Function Documentation

◆ dump() [1/2]

void stmg::WidgetAxisFit::dump ( int32_t  nIndentSpaces) const
noexcept

◆ dump() [2/2]

void stmg::WidgetAxisFit::dump ( ) const
noexcept

◆ getAlign() [1/2]

double stmg::WidgetAxisFit::getAlign ( ) const
inlinenoexcept

Returns the align as a from 0 to 1 or -1 if ALIGN_FILL.

Returns
The align as a number.

◆ getAlign() [2/2]

static double stmg::WidgetAxisFit::getAlign ( ALIGN  eAlign)
inlinestaticnoexcept

Returns the align as a from 0 to 1 or -1 if ALIGN_FILL.

Parameters
eAlignThe alignment. Must be valid.
Returns
The align as a number.

Member Data Documentation

◆ m_bExpand

bool stmg::WidgetAxisFit::m_bExpand = false

Whether the widgets claims a share of extra available space in the container.

Default: false.

◆ m_eAlign

ALIGN stmg::WidgetAxisFit::m_eAlign = ALIGN_CENTER

The widget alignment.

Default: ALIGN_CENTER.