#include <Malena/Graphics/Controls/ToggleGroup.h>
Public Types | |
| using | Flag = ToggleGroupManifest::Flag |
| using | manifest_type |
The manifest type, used by GatherFlags and GatherStates to locate this class's flag and state declarations. | |
| using | State = ToggleGroupManifest::State |
Public Member Functions | |
| void | add (ButtonToggle &toggle, const std::string &key) |
| void | add (PillToggle &toggle, const std::string &key) |
| void | add (SegmentToggle &toggle, const std::string &key) |
| ButtonToggle & | addButtonToggle (const std::string &label, const std::string &key, bool on=false) |
Create and add a new ButtonToggle. | |
| SegmentToggle & | addSegmentToggle (const std::string &offLabel, const std::string &onLabel, const std::string &key, bool on=false) |
Create and add a new SegmentToggle. | |
| PillToggle & | addToggle (const std::string &label, const std::string &key, bool on=false) |
Create and add a new PillToggle with a right label. | |
| void | applySettingsToAll (const ButtonSettings &s) |
| void | applySettingsToAll (const PillSettings &s) |
| void | applySettingsToAll (const SegmentSettings &s) |
| void | applyStyleToAll (const ButtonStyle &s) |
| void | applyStyleToAll (const PillStyle &s) |
| void | applyStyleToAll (const SegmentStyle &s) |
| void | applyThemeToAll (const ButtonTheme &t) |
| void | applyThemeToAll (const PillTheme &t) |
| void | applyThemeToAll (const SegmentTheme &t) |
| void | clearToggles () |
| sf::FloatRect | getGlobalBounds () const override |
| std::vector< std::string > | getOnKeys () const |
| sf::Vector2f | getPosition () const override |
| 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 >, T > | getState () const |
| Return the current state value. | |
| bool | isOn (const std::string &key) const |
| 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 >, bool > | isState (T state) const |
Return true if currently in state. | |
| void | onAnyToggled (std::function< void(const std::string &, bool)> callback) |
| 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 > > | 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 > > | onStateExit (std::function< void(T)> callback) |
| Register a callback invoked before each state transition. | |
| void | setAllOff () |
| void | setAllOn () |
| void | setCharacterSize (unsigned int size) |
| Set character size on the default pill theme and all owned pills. | |
| void | setDefaultSettings (const ButtonSettings &s) |
| void | setDefaultSettings (const PillSettings &s) |
| Set the default settings applied to new owned PillToggles. | |
| void | setDefaultSettings (const SegmentSettings &s) |
| void | setDefaultStyle (const ButtonStyle &s) |
| void | setDefaultStyle (const PillStyle &s) |
| Set default settings and theme together. | |
| void | setDefaultStyle (const SegmentStyle &s) |
| void | setDefaultTheme (const ButtonTheme &t) |
| void | setDefaultTheme (const PillTheme &t) |
| Set the default theme applied to new owned PillToggles. | |
| void | setDefaultTheme (const SegmentTheme &t) |
| void | setFont (const sf::Font &&)=delete |
| void | setFont (const sf::Font &font) |
| Set font on the default pill theme and all owned pills. | |
| void | setOn (const std::string &key, bool on) |
| void | setPosition (const sf::Vector2f &position) override |
| void | setSpacing (float spacing) |
| std::enable_if_t<!std::is_void_v< T > > | setState (T newState) |
| Transition to a new state. | |
| std::enable_if_t<!std::is_void_v< T > > | setState (T newState) |
| Transition to a new state. | |
| ToggleGroup () | |
| ToggleGroup (const ToggleGroup &)=delete | |
Protected Member Functions | |
| void | draw (sf::RenderTarget &target, sf::RenderStates states) const override |
Definition at line 216 of file ToggleGroup.h.
|
inherited |
Definition at line 63 of file ToggleGroup.h.
|
inherited |
The manifest type, used by GatherFlags and GatherStates to locate this class's flag and state declarations.
Definition at line 65 of file Customizable.h.
|
inherited |
Definition at line 64 of file ToggleGroup.h.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Create and add a new ButtonToggle.
|
inherited |
Create and add a new SegmentToggle.
|
inherited |
Create and add a new PillToggle with a right label.
Inherits the current default PillSettings and PillTheme.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
overrideprotectedinherited |
|
overrideinherited |
|
nodiscardinherited |
|
overrideinherited |
|
inherited |
Return the current state value.
StateEnum value.
|
inherited |
Return the current state value.
StateEnum value.
|
nodiscardinherited |
|
inherited |
Return true if currently in state.
| state | The state value to compare against. |
true if the current state equals state.
|
inherited |
Return true if currently in state.
| state | The state value to compare against. |
true if the current state equals state.
|
inherited |
|
inherited |
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.
| callback | Function called with the new state after each transition. |
|
inherited |
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.
| callback | Function called with the new state after each transition. |
|
inherited |
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.
| callback | Function called with the old state before each transition. |
|
inherited |
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.
| callback | Function called with the old state before each transition. |
|
inherited |
|
inherited |
|
inherited |
Set character size on the default pill theme and all owned pills.
|
inherited |
|
inherited |
Set the default settings applied to new owned PillToggles.
|
inherited |
|
inherited |
|
inherited |
Set default settings and theme together.
|
inherited |
|
inherited |
|
inherited |
Set the default theme applied to new owned PillToggles.
|
inherited |
|
deleteinherited |
|
inherited |
Set font on the default pill theme and all owned pills.
|
inherited |
|
overrideinherited |
|
inherited |
|
inherited |
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.
| newState | The state to transition into. |
|
inherited |
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.
| newState | The state to transition into. |
|
explicit |
|
delete |