|
stmm-games-doc
0.32.0
|
Optional interface for ThemeWidget. More...

Public Member Functions | |
| virtual | ~ThemeWidgetInteractive () noexcept=default |
| virtual bool | handleXYInput (const shared_ptr< stmi::Event > &refXYEvent, int32_t nTeam, int32_t nMate) noexcept=0 |
| Handles the XYEvent input. More... | |
| bool | isInteractive () const noexcept |
| Tells whether the widget should really be interactive. More... | |
| ThemeWidget * | getThemeWidget () noexcept |
| The pointer to the interface's theme widget. More... | |
| void | dump (int32_t nIndentSpaces) const noexcept |
Protected Member Functions | |
| ThemeWidgetInteractive (ThemeWidget *p0TW, bool bInteractive) noexcept | |
| Constructor. More... | |
| void | reInit (ThemeWidget *p0TW, bool bInteractive) noexcept |
| Reinitialization. More... | |
Optional interface for ThemeWidget.
This interface can only be acquired from a ThemeWidget instance (usually by the theme layout) through dynamic_cast or std::dynamic_pointer_cast.
|
virtualdefaultnoexcept |
|
protectednoexcept |
Constructor.
| p0TW | Pointer to the theme widget implementing this interface. Cannot be null. |
| bInteractive | Whether the widget is really interactive. |
|
noexcept |
|
inlinenoexcept |
The pointer to the interface's theme widget.
|
pure virtualnoexcept |
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).
| refXYEvent | Reference to a stmi::XYEvent object. Cannot be null. |
| nTeam | The team or -1 if not set. |
| nMate | The mate of -1 if not set. |
Implemented in stmg::InputBoxThWidget, and stmg::ActionsBoxThWidget.
|
inlinenoexcept |
Tells whether the widget should really be interactive.
When the widget's model refers to an AI player or a team, level, game that doesn't contain human players this may return false. Even widgets assigned to a human player might want to disable interactivity because the game only uses the keyboard as input.
|
protectednoexcept |
Reinitialization.
| p0TW | Pointer to the theme widget implementing this interface. Cannot be null. |
| bInteractive | Whether the widget is really interactive. |
1.8.13