|
stmm-games-doc
0.32.0
|
Template class for Box theme widgets. More...

Public Member Functions | |
| BoxThemeWidget (TOwnerFactory *p1Owner, const shared_ptr< GameWidget > &refGameWidget, TBoxWidget *p0BoxWidget, const std::vector< shared_ptr< ThemeWidget > > &aChildTW, double fTileWHRatio) noexcept | |
| Constructor. More... | |
| void | reInit (TOwnerFactory *p1Owner, const shared_ptr< GameWidget > &refGameWidget, TBoxWidget *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... | |
| void | dump (int32_t nIndentSpaces, bool bHeader) const noexcept override |
| Writes object contents to std::cout. 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... | |
| ThemeContainerWidget * | getParent () 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... | |
Protected Member Functions | |
| 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... | |
| TBoxWidget * | getBoxWidgetModel () 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 | |
| ThemeLayout & | themeLayout () noexcept |
| The theme layout. More... | |
| const ThemeLayout & | themeLayout () 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... | |
Template class for Box theme widgets.
Params: TOwnerFactory The class creating instances. TBoxThemeWidget The actual ThemeWidget subclassing this template. TBoxWidget The model box widget.
|
noexcept |
Constructor.
| p1Owner | The factory class creating instance. Cannot be null. |
| refGameWidget | The model. Cannot be null. |
| p0BoxWidget | The model. Must point to the same object as refGameWidget. |
| aChildTW | The children. |
| fTileWHRatio | The tile WH ratio. |
|
overridevirtualnoexcept |
Whether the widget's appearance (or one of its parents) can change.
This is a static property of the widget calculated when it is already inserted in its final layout and shouldn't change during its lifetime. If a call to drawIfChanged() might return true this function returns true, false otherwise.
Implements stmg::ThemeWidget.
|
overridevirtualnoexcept |
Draws a widget.
The draw is shallow, so it can assume that the parent was already drawn to the context.
When this function is called this instance can assume that the parent was modified. For mutable widgets this could for example mean they should invalidate their cache if they have one.
If a widget has no parents it must draw completely opaquely.
| refCc | The context to draw to. Cannot be null. |
Implements stmg::ThemeWidget.
|
overridevirtualnoexcept |
Deep draws a widget if it changed.
If this is a ThemeContainerWidget it doesn't draw the children, just itself possibly on top of its parent (clipped to this widget).
| refCc | The context to conditionally draw to. Cannot be null. |
Implements stmg::ThemeWidget.
|
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.
| nIndentSpaces | Number of spaces put in front of each output line. |
| bHeader | Whether the header of the object should be displayed. |
Reimplemented from stmg::ThemeWidget.
|
inlineprotectednoexcept |
The pointer to the model.
|
overridevirtualnoexcept |
The position of the widget.
Should only be called after the widget has been positioned.
Implements stmg::ThemeWidget.
|
overridevirtualnoexcept |
The size of the widget.
Should only be called after the widget has been positioned.
Implements stmg::ThemeWidget.
|
overridevirtualnoexcept |
Gets the width and height functions that take the tile width as parameter.
| nLayoutConfig | The layout config. |
Implements stmg::ThemeWidget.
|
overrideprotectedvirtualnoexcept |
Signal that widget was added to a layout.
When the theme widget tree is added to the theme layout this function is called for all its widgets. Container widgets don't need to call their children's onAssignedToLayout().
The default implementation does nothing.
Reimplemented from stmg::ThemeWidget.
|
overrideprotectedvirtualnoexcept |
Signal the widget should define its size functions.
The reference widget can be used to determine this widget's size functions.
Container widgets don't need to call their children's onRecalcSizeFunctions(), since it is done by the layout itself.
| p0ReferenceThemeWidget | The reference theme widget. Cannot be null. |
Reimplemented from stmg::ThemeWidget.
|
overridevirtualnoexcept |
Places and possibly resizes the widget within the given area.
The placement and resizing depends on align value returned by the model's functions GameWidget::getWidgetAxisFitHoriz() and GameWidget::getWidgetAxisFitVert().
The width and height should be bigger or equal the size of the widget as defined by its size functions with the parameters passed to sizeAndConfig().
Container widgets must recursively call the placeAndMaybeResizeIn() of their children (they are responsible for their positioning).
| oRect | The rectangle where the widget should be placed. |
Implements stmg::ThemeWidget.
|
noexcept |
Reinitialization.
See constructor.
|
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.
| nTileW | The tile width. Must be >0. |
| nLayoutConfig | The layout config. |
Implements stmg::ThemeWidget.
1.8.13