stmm-games-doc  0.32.0
Public Member Functions | Protected Member Functions | List of all members
stmg::ActionsBoxThWidget Class Reference
Inheritance diagram for stmg::ActionsBoxThWidget:
Inheritance graph
[legend]

Public Member Functions

 ActionsBoxThWidget (ActionsBoxThWidgetFactory *p1Owner, const shared_ptr< GameWidget > &refGameWidget, ActionsBoxWidget *p0BoxWidget, const std::vector< shared_ptr< ThemeWidget > > &aChildTW, double fTileWHRatio) noexcept
 
void reInit (ActionsBoxThWidgetFactory *p1Owner, const shared_ptr< GameWidget > &refGameWidget, ActionsBoxWidget *p0BoxWidget, const std::vector< shared_ptr< ThemeWidget > > &aChildTW, double fTileWHRatio) noexcept
 
void dump (int32_t nIndentSpaces, bool bHeader) const noexcept override
 Writes object contents to std::cout. More...
 
bool handleXYInput (const shared_ptr< stmi::Event > &refXYEvent, int32_t nTeam, int32_t nMate) noexcept override
 Handles the XYEvent input. More...
 
- Public Member Functions inherited from stmg::BoxThemeWidget< ActionsBoxThWidgetFactory, ActionsBoxThWidget, ActionsBoxWidget >
 BoxThemeWidget (ActionsBoxThWidgetFactory *p1Owner, const shared_ptr< GameWidget > &refGameWidget, ActionsBoxWidget *p0BoxWidget, const std::vector< shared_ptr< ThemeWidget > > &aChildTW, double fTileWHRatio) noexcept
 Constructor. More...
 
void reInit (ActionsBoxThWidgetFactory *p1Owner, const shared_ptr< GameWidget > &refGameWidget, ActionsBoxWidget *p0BoxWidget, const std::vector< shared_ptr< ThemeWidget > > &aChildTW, double fTileWHRatio) noexcept
 Reinitialization. More...
 
bool canChange () const noexcept override
 Whether the widget's appearance (or one of its parents) can change. More...
 
NSize getSize () const noexcept override
 The size of the widget. More...
 
NPoint getPos () const noexcept override
 The position of the widget. More...
 
bool drawIfChanged (const Cairo::RefPtr< Cairo::Context > &refCc) noexcept override
 Deep draws a widget if it changed. More...
 
void draw (const Cairo::RefPtr< Cairo::Context > &refCc) noexcept override
 Draws a widget. More...
 
const std::pair< SegmentedFunction, SegmentedFunction > & getSizeFunctions (int32_t nLayoutConfig) const noexcept override
 Gets the width and height functions that take the tile width as parameter. More...
 
void placeAndMaybeResizeIn (const NRect &oRect) noexcept override
 Places and possibly resizes the widget within the given area. More...
 
void dump (int32_t nIndentSpaces, bool bHeader) const noexcept override
 Writes object contents to std::cout. More...
 
- Public Member Functions inherited from stmg::ThemeContainerWidget
const std::vector< shared_ptr< ThemeWidget > > & getChildren () const noexcept
 The child ThemeWidget vector of the container. More...
 
- Public Member Functions inherited from stmg::ThemeWidget
virtual ~ThemeWidget () noexcept=default
 
virtual void drawDeep (const Cairo::RefPtr< Cairo::Context > &refCc) noexcept
 Deep draws a widget. More...
 
bool isContainer () const noexcept
 Tells Whether the widget is a container. More...
 
const shared_ptr< GameWidget > & getModel () const noexcept
 The game widget used to generate the theme widget. More...
 
ThemeContainerWidgetgetParent () const noexcept
 The parent container of the widget. More...
 
void dump (int32_t nIndentSpaces) const noexcept
 Writes object contents to std::cout (header included). More...
 
void dump () const noexcept
 Writes contents to std::cout without indentation. More...
 
- Public Member Functions inherited from stmg::ThemeWidgetInteractive
virtual ~ThemeWidgetInteractive () noexcept=default
 
bool isInteractive () const noexcept
 Tells whether the widget should really be interactive. More...
 
ThemeWidgetgetThemeWidget () noexcept
 The pointer to the interface's theme widget. More...
 
void dump (int32_t nIndentSpaces) const noexcept
 

Protected Member Functions

void sizeAndConfig (int32_t nTileW, int32_t nLayoutConfig) noexcept override
 Sets the tile size of the widget and its configuration. More...
 
void calcGrid () noexcept
 
- Protected Member Functions inherited from stmg::BoxThemeWidget< ActionsBoxThWidgetFactory, ActionsBoxThWidget, ActionsBoxWidget >
void onAssignedToLayout () noexcept override
 Signal that widget was added to a layout. More...
 
void onRecalcSizeFunctions (ThemeWidget *p0ReferenceThemeWidget) noexcept override
 Signal the widget should define its size functions. More...
 
void sizeAndConfig (int32_t nTileW, int32_t nLayoutConfig) noexcept override
 Sets the tile size of the widget and its configuration. More...
 
ActionsBoxWidgetgetBoxWidgetModel () noexcept
 The pointer to the model. More...
 
- Protected Member Functions inherited from stmg::ThemeContainerWidget
void setChildren (const std::vector< shared_ptr< ThemeWidget > > &aChildren) noexcept
 Sets the children of the container. More...
 
 ThemeContainerWidget (const shared_ptr< GameWidget > &refModel) noexcept
 Constructor. More...
 
void reInit (const shared_ptr< GameWidget > &refModel) noexcept
 Reinitialization. More...
 
virtual ~ThemeContainerWidget () noexcept
 
- Protected Member Functions inherited from stmg::ThemeWidget
ThemeLayoutthemeLayout () noexcept
 The theme layout. More...
 
const ThemeLayoutthemeLayout () const noexcept
 The constant theme layout. More...
 
 ThemeWidget (const shared_ptr< GameWidget > &refModel) noexcept
 Constructs the theme widget. More...
 
void reInit (const shared_ptr< GameWidget > &refModel) noexcept
 Reinitializes the theme widget. More...
 
- Protected Member Functions inherited from stmg::ThemeWidgetInteractive
 ThemeWidgetInteractive (ThemeWidget *p0TW, bool bInteractive) noexcept
 Constructor. More...
 
void reInit (ThemeWidget *p0TW, bool bInteractive) noexcept
 Reinitialization. More...
 

Constructor & Destructor Documentation

◆ ActionsBoxThWidget()

stmg::ActionsBoxThWidget::ActionsBoxThWidget ( ActionsBoxThWidgetFactory p1Owner,
const shared_ptr< GameWidget > &  refGameWidget,
ActionsBoxWidget p0BoxWidget,
const std::vector< shared_ptr< ThemeWidget > > &  aChildTW,
double  fTileWHRatio 
)
inlinenoexcept

Member Function Documentation

◆ calcGrid()

void stmg::ActionsBoxThWidget::calcGrid ( )
protectednoexcept

◆ dump()

void stmg::ActionsBoxThWidget::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.

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

Reimplemented from stmg::ThemeContainerWidget.

◆ handleXYInput()

bool stmg::ActionsBoxThWidget::handleXYInput ( const shared_ptr< stmi::Event > &  refXYEvent,
int32_t  nTeam,
int32_t  nMate 
)
overridevirtualnoexcept

Handles the XYEvent input.

It's safe to statically cast refXYEvent->get() to stmi::XYEvent*.

The team and mate parameters are not necessarily those of the widget but can also be determined by the stmi::Capability of the stmi::XYEvent, which is done by the caller of this function.

The interactive widget might not handle an event. For example when a new grab (see stmi::XYEvent::XY_GRAB) is initiated, the widget might return false because it already has an open grab. Another example: a key action widget needs the player to be defined (nMate >= 0).

Parameters
refXYEventReference to a stmi::XYEvent object. Cannot be null.
nTeamThe team or -1 if not set.
nMateThe mate of -1 if not set.
Returns
Whether the widget has handled the event.

Implements stmg::ThemeWidgetInteractive.

◆ reInit()

void stmg::ActionsBoxThWidget::reInit ( ActionsBoxThWidgetFactory p1Owner,
const shared_ptr< GameWidget > &  refGameWidget,
ActionsBoxWidget p0BoxWidget,
const std::vector< shared_ptr< ThemeWidget > > &  aChildTW,
double  fTileWHRatio 
)
inlinenoexcept

◆ sizeAndConfig()

void stmg::ActionsBoxThWidget::sizeAndConfig ( int32_t  nTileW,
int32_t  nLayoutConfig 
)
overrideprotectedvirtualnoexcept

Sets the tile size of the widget and its configuration.

The widget should evaluate and set the actual size of the widget through its size functions.

This function is called when the layout has determined the best tile size and layout config in order to maximize the tile size itself.

Parameters
nTileWThe tile width. Must be >0.
nLayoutConfigThe layout config.

Implements stmg::ThemeWidget.