ConvexButton with an attached manifest.
More...
#include <ConvexButton.h>
|
| std::enable_if_t<!std::is_void_v< T >, T > | getState () const |
| | Return the current state value.
|
| std::enable_if_t<!std::is_void_v< T >, bool > | isState (T state) const |
| | Return true if currently in state.
|
| std::enable_if_t<!std::is_void_v< T > > | onStateEnter (std::function< void(T)> callback) |
| | Register a callback invoked after each state transition.
|
| std::enable_if_t<!std::is_void_v< T > > | onStateExit (std::function< void(T)> callback) |
| | Register a callback invoked before each state transition.
|
| std::enable_if_t<!std::is_void_v< T > > | setState (T newState) |
| | Transition to a new state.
|
template<typename MANIFEST>
class ml::ConvexButtonWith< MANIFEST >
ConvexButton with an attached manifest.
- Template Parameters
-
| MANIFEST | A Manifest subclass declaring Flag/State enums. |
- See also
- ConvexButton, Customizable
Definition at line 53 of file ConvexButton.h.
◆ manifest_type
◆ getState()
Return the current state value.
- Returns
- The active
StateEnum value.
◆ isState()
Return true if currently in state.
- Parameters
-
| state | The state value to compare against. |
- Returns
true if the current state equals state.
◆ onStateEnter()
Register a callback invoked after each state transition.
The callback receives the newly entered state. Only one enter callback is active at a time; calling this again replaces it.
- Parameters
-
| callback | Function called with the new state after each transition. |
◆ onStateExit()
Register a callback invoked before each state transition.
The callback receives the state being left. Only one exit callback is active at a time; calling this again replaces it.
- Parameters
-
| callback | Function called with the old state before each transition. |
◆ setState()
Transition to a new state.
Fires the exit callback with the current state, updates the stored state to newState, then fires the enter callback with the new state. Either callback may be unset (nullptr), in which case it is skipped.
- Parameters
-
| newState | The state to transition into. |
The documentation for this class was generated from the following file: