stmm-games-doc  0.32.0
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
stmg::ContainerWidget Class Reference

The base class for container widgets. More...

Inheritance diagram for stmg::ContainerWidget:
Inheritance graph
[legend]

Classes

struct  Init
 
struct  LocalInit
 

Public Member Functions

const std::vector< shared_ptr< GameWidget > > & getChildren () const noexcept
 The children widgets of the container. More...
 
void dump (int32_t nIndentSpaces, bool bHeader) const noexcept override
 Writes object contents to std::cout. More...
 
virtual ~ContainerWidget () noexcept
 
- Public Member Functions inherited from stmg::GameWidget
virtual ~GameWidget () noexcept=default
 
int32_t getViewWidgetNameIdx () const noexcept
 The type (name) that might be used to choose a ThemeWidget. More...
 
const std::string & getName () const noexcept
 The name of the widget. More...
 
int32_t getTeam () const noexcept
 The team the widget is assigned to. More...
 
int32_t getMate () const noexcept
 The mate the widget is assigned to. More...
 
WidgetAxisFit getWidgetHorizAxisFit (int32_t nLayoutConfig) const noexcept
 Widget alignment and expansion for the x axis. More...
 
WidgetAxisFit getWidgetVertAxisFit (int32_t nLayoutConfig) const noexcept
 Widget alignment and expansion for the y axis. More...
 
bool isAssignedToHuman () const noexcept
 Tells whether the widget is assigned to a human. More...
 
ContainerWidgetgetContainer () const noexcept
 The container to which this widget was added to. More...
 
void dump (int32_t nIndentSpaces) const noexcept
 Writes object contents to std::cout (header included). More...
 
void dump () const noexcept
 Writes object contents to std::cout (header included). More...
 

Static Public Member Functions

static bool getChildExpand (const std::vector< shared_ptr< GameWidget > > &aChildWidgets, int32_t nLayoutConfig, bool bHoriz) noexcept
 Tells whether any of a vector of game widgets expands. More...
 
static bool getChildFill (const std::vector< shared_ptr< GameWidget > > &aChildWidgets, int32_t nLayoutConfig, bool bHoriz) noexcept
 Tells whether any of a vector of game widgets fills. More...
 

Protected Member Functions

 ContainerWidget (Init &&oData) noexcept
 Constructor. More...
 
void reInit (Init &&oData) noexcept
 Reinitialization. More...
 
- Protected Member Functions inherited from stmg::GameWidget
 GameWidget (Init &&oData) noexcept
 Constructor. More...
 
void reInit (Init &&oData) noexcept
 Reinitialization. More...
 
Layoutlayout () noexcept
 The layout the widget belongs to. More...
 
const Layoutlayout () const noexcept
 The layout the widget belongs to. More...
 
GameProxygame () noexcept
 The game the widget belongs to. More...
 
const GameProxygame () const noexcept
 The game the widget belongs to. More...
 
virtual void onAddedToLayout () noexcept
 Signals widget was added to layout. More...
 
virtual void onAddedToGame () noexcept
 Signals widget was added to game. More...
 

Detailed Description

The base class for container widgets.

Constructor & Destructor Documentation

◆ ~ContainerWidget()

virtual stmg::ContainerWidget::~ContainerWidget ( )
virtualnoexcept

◆ ContainerWidget()

stmg::ContainerWidget::ContainerWidget ( Init &&  oData)
explicitprotectednoexcept

Constructor.

Parameters
oDataInitialization data.

Member Function Documentation

◆ dump()

void stmg::ContainerWidget::dump ( int32_t  nIndentSpaces,
bool  bHeader 
) const
overridevirtualnoexcept

Writes object contents to std::cout.

Should only do it in debug mode. The function is also exposed in release mode because it is virtual.

If bHeader is true this function should also output the type of the object and its address.

Parameters
nIndentSpacesNumber of spaces put in front of each output line.
bHeaderWhether the header of the object should be displayed.

Reimplemented from stmg::GameWidget.

Reimplemented in stmg::ActionsBoxWidget, stmg::BoxWidget, stmg::VolatileWidget, stmg::BackgroundWidget, and stmg::InputBoxWidget.

◆ getChildExpand()

static bool stmg::ContainerWidget::getChildExpand ( const std::vector< shared_ptr< GameWidget > > &  aChildWidgets,
int32_t  nLayoutConfig,
bool  bHoriz 
)
staticnoexcept

Tells whether any of a vector of game widgets expands.

Parameters
aChildWidgetsThe widgets. Can be empty.
nLayoutConfigThe layout config.
bHorizWhether horizontal axis (or vertical).
Returns
Whether any expands.

◆ getChildFill()

static bool stmg::ContainerWidget::getChildFill ( const std::vector< shared_ptr< GameWidget > > &  aChildWidgets,
int32_t  nLayoutConfig,
bool  bHoriz 
)
staticnoexcept

Tells whether any of a vector of game widgets fills.

Parameters
aChildWidgetsThe widgets. Can be empty.
nLayoutConfigThe layout config.
bHorizWhether horizontal axis (or vertical).
Returns
Whether any fills.

◆ getChildren()

const std::vector< shared_ptr<GameWidget> >& stmg::ContainerWidget::getChildren ( ) const
inlinenoexcept

The children widgets of the container.

Returns
The children widgets. Cannot be null.

◆ reInit()

void stmg::ContainerWidget::reInit ( Init &&  oData)
protectednoexcept

Reinitialization.

Parameters
oDataThe initialization data.