|
| | ToggleGroup () |
| | ToggleGroup (const ToggleGroup &)=delete |
| | ~ToggleGroup () |
| 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 |
| bool | isOn (const std::string &key) const |
| void | onAnyToggled (std::function< void(const std::string &, bool)> callback) |
| ToggleGroup & | operator= (const ToggleGroup &)=delete |
| 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) |
A vertical group of toggle switches.
Lays out multiple toggles vertically with consistent spacing. Supports PillToggle, SegmentToggle, and ButtonToggle items. All toggles are independent — multiple can be on simultaneously.
Toggles created via addToggle() inherit the group's default style for that type. Set defaults before adding, or call applySettingsToAll() / applyThemeToAll() / applyStyleToAll() to update existing toggles.
settings.
addToggle(
"Dark mode",
"dark_mode",
true);
settings.
addToggle(
"Subtitles",
"subtitles");
settings.
addToggle(
"Fullscreen",
"fullscreen");
std::cout << key << ": " << on << "\n";
});
addComponent(settings);
A vertical group of toggle switches.
void onAnyToggled(std::function< void(const std::string &, bool)> callback)
void setPosition(const sf::Vector2f &position) override
PillToggle & addToggle(const std::string &label, const std::string &key, bool on=false)
Create and add a new PillToggle with a right label.
- See also
- PillToggle, SegmentToggle, ButtonToggle, PillStyle
Definition at line 60 of file ToggleGroup.h.