5#ifndef MALENA_CHECKBOX_H
6#define MALENA_CHECKBOX_H
30 enum class Flag { CHECKED, DISABLED };
59 std::string _labelStr;
62 void buildCheckmark();
63 void applyVisualState();
70 explicit Checkbox(
const std::string& label =
"",
78 static_assert(std::is_base_of_v<CheckboxSettings, S>,
79 "applySettings() requires a type derived from CheckboxSettings");
87 static_assert(std::is_base_of_v<CheckboxTheme, T>,
88 "applyTheme() requires a type derived from CheckboxTheme");
96 static_assert(std::is_base_of_v<CheckboxSettings, St> &&
97 std::is_base_of_v<CheckboxTheme, St>,
98 "applyStyle() requires a type derived from both CheckboxSettings and CheckboxTheme");
128 template<
typename MANIFEST>
sf::Vector2f getPosition() const override
Checkbox(const std::string &label="", const sf::Font &font=FontManager<>::getDefault())
void setEnabled(bool enabled)
void draw(sf::RenderTarget &target, sf::RenderStates states) const override
CheckboxManifest::Flag Flag
sf::FloatRect getGlobalBounds() const override
void applyStyle(const St &s)
std::string getLabel() const
void setPosition(const sf::Vector2f &position) override
void onThemeApplied(const Theme &theme) override
Called by ThemeManager when the active theme changes.
void setLabel(const std::string &label)
void applySettings(const S &s)
void applyTheme(const T &t)
CheckboxManifest::State State
Checkbox(const std::string &label="", const sf::Font &font=FontManager<>::getDefault())
static const sf::Font & getDefault()
Return the built-in Arial font.
Base class for all Malena manifests.
Trait that adds selection and deselection callbacks to any Core object.
Component< M, Traits... > ComponentWith
Alias for Component<M, Traits...>.
@ HOVERED
Mouse is currently over this component (set by HoverableDispatcher).
Vector2< float > Vector2f
Layout and behaviour settings for Checkbox.
Color and font tokens for Checkbox.
Universal design token set applied across all Themeable components.