#include <Malena/Graphics/Text/TextArea.h>
Public Types | |
| using | Flag = TextInputManifest::Flag |
| using | manifest_type |
The manifest type, used by GatherFlags and GatherStates to locate this class's flag and state declarations. | |
| using | State = TextInputManifest::State |
Public Member Functions | |
| TextAreaTheme & | applyFrom (const Theme &t) |
| TextInputTheme & | applyFrom (const Theme &t) override |
Populate all fields from the global Theme token set. | |
| template<typename S> | |
| void | applySettings (const S &s) |
| template<typename St> | |
| void | applyStyle (const St &s) |
| template<typename T> | |
| void | applyTheme (const T &t) |
| void | clear () |
| sf::Color | getBgDisabled () const |
| sf::Color | getBgFocused () const |
| sf::Color | getBgIdle () const |
| sf::Color | getBorderDisabled () const |
| sf::Color | getBorderError () const |
| sf::Color | getBorderFocused () const |
| sf::Color | getBorderIdle () const |
| float | getBorderThickness () const |
| unsigned int | getCharacterSize () const |
| sf::Color | getCursorColor () const |
| sf::Color | getDisabledColor () const |
| sf::Color | getDisabledTextColor () const |
| sf::Color | getErrorColor () const |
| sf::Color | getFillColor () const |
| sf::Color | getFocusColor () const |
| const sf::Font * | getFont () const |
| unsigned int | getFontSize () const |
| unsigned int | getFontSizeSmall () const |
| sf::FloatRect | getGlobalBounds () const override |
| sf::Color | getHoverColor () const |
| std::size_t | getMaxLength () const |
| sf::Color | getMutedColor () const |
| sf::Color | getOutlineColor () const |
| float | getOutlineThickness () const |
| float | getPadding () const |
| char32_t | getPasswordChar () const |
| std::string | getPlaceholder () const |
| sf::Color | getPlaceholderColor () const |
| sf::Vector2f | getPosition () const override |
| float | getRadius () const |
| sf::Color | getScrollBarColor () const |
| sf::Color | getScrollBarTrackColor () const |
| float | getScrollBarWidth () const |
| std::string | getSelectedText () const |
| sf::Color | getSelectionColor () const |
| sf::Vector2f | getSize () const |
| std::enable_if_t<!std::is_void_v< T >, T > | getState () const |
| Return the current state value. | |
| sf::Color | getTextColor () const |
| std::string | getValue () const |
| bool | hasError () const |
| bool | isEnabled () const |
| bool | isPasswordMode () const |
| bool | isReadOnly () const |
| bool | isSettingsLocked () const |
Return true if applySettings() is currently blocked. | |
| std::enable_if_t<!std::is_void_v< T >, bool > | isState (T state) const |
Return true if currently in state. | |
| bool | isThemeLocked () const |
Return true if this component ignores theme changes. | |
| void | lockSettings () |
Prevent applySettings() from taking effect. | |
| void | lockTheme () |
| Prevent automatic re-styling when the global theme changes. | |
| void | onChange (std::function< void(const std::string &)> 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 > > | onStateExit (std::function< void(T)> callback) |
| Register a callback invoked before each state transition. | |
| void | onSubmit (std::function< void(const std::string &)> callback) |
| void | selectAll () |
| void | setBgDisabled (const sf::Color &c) |
| void | setBgFocused (const sf::Color &c) |
| void | setBgIdle (const sf::Color &c) |
| void | setBorderDisabled (const sf::Color &c) |
| void | setBorderError (const sf::Color &c) |
| void | setBorderFocused (const sf::Color &c) |
| void | setBorderIdle (const sf::Color &c) |
| void | setBorderThickness (float t) |
| virtual void | setCharacterSize (unsigned int size) |
| void | setCursorColor (const sf::Color &c) |
| void | setDisabledColor (const sf::Color &c) |
| void | setDisabledTextColor (const sf::Color &c) |
| void | setEnabled (bool enabled) |
| void | setError (bool error) |
| void | setErrorColor (const sf::Color &c) |
| void | setFillColor (const sf::Color &c) |
| void | setFocusColor (const sf::Color &c) |
| void | setFont (const sf::Font &&)=delete |
| virtual void | setFont (const sf::Font &font) |
| void | setFontSize (unsigned int s) |
| void | setFontSizeSmall (unsigned int s) |
| void | setHoverColor (const sf::Color &c) |
| void | setMaxLength (std::size_t n) |
| void | setMutedColor (const sf::Color &c) |
| void | setOutlineColor (const sf::Color &c) |
| void | setOutlineThickness (float t) |
| void | setPadding (float p) |
| void | setPasswordChar (char32_t c) |
| void | setPasswordMode (bool b) |
| void | setPlaceholder (const std::string &text) |
| void | setPlaceholderColor (const sf::Color &c) |
| void | setPosition (const sf::Vector2f &position) override |
| void | setRadius (float r) |
| void | setReadOnly (bool readonly) |
| void | setScrollBarColor (const sf::Color &color) |
| void | setScrollBarTrackColor (const sf::Color &color) |
| void | setScrollBarWidth (float width) |
| void | setSelection (std::size_t start, std::size_t end) |
| void | setSelectionBold (bool bold) |
| void | setSelectionCharSize (unsigned int size) |
| void | setSelectionColor (const sf::Color &color) |
| void | setSelectionFont (const sf::Font &font) |
| void | setSelectionItalic (bool italic) |
| void | setSelectionUnderline (bool underline) |
| void | setSize (const sf::Vector2f &size) override |
| std::enable_if_t<!std::is_void_v< T > > | setState (T newState) |
| Transition to a new state. | |
| void | setTextColor (const sf::Color &c) |
| void | setValue (const std::string &value) |
| TextArea (const sf::Font &font=FontManager<>::getDefault()) | |
| void | unlockSettings () |
Allow applySettings() to take effect again. | |
| void | unlockTheme () |
| Resume reacting to global theme changes. | |
Protected Member Functions | |
| void | draw (sf::RenderTarget &target, sf::RenderStates states) const override |
| void | handleChar (const sf::Event::TextEntered &te) |
| virtual void | handleKey (const sf::Event::KeyPressed &kp) |
| void | onRebuildComplete () override |
| Called after every rebuild(). Grows the canvas to full content height and updates ScrollPane's content height. | |
| void | onThemeApplied (const Theme &theme) override |
Called by ThemeManager when the active theme changes. | |
| void | rebuild () |
| void | reflow () override |
| Top-aligned reflow. Reads vertical scroll from ScrollPane. | |
| void | syncColors () |
| void | syncPlaceholder () override |
Protected Attributes | |
| sf::RectangleShape | _background |
| RichTextBuffer | _buffer |
| sf::RenderTexture | _canvas |
| sf::Clock | _clickClock |
| sf::Clock | _cursorClock |
| bool | _cursorVisible = false |
| std::size_t | _dragAnchor = 0 |
| bool | _dragging = false |
| sf::Vector2f | _lastClick = {} |
| std::function< void(const std::string &)> | _onChange |
| std::function< void(const std::string &)> | _onSubmit |
| sf::Text | _placeholder |
| sf::Vector2f | _position = {0.f, 0.f} |
| RichTextRenderer | _renderer |
| float | _scrollX = 0.f |
| bool | _showPlaceholder = true |
| bool | _waitingDouble = false |
Definition at line 119 of file TextArea.h.
|
inherited |
Definition at line 50 of file TextInput.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 51 of file TextInput.h.
|
inlineinherited |
Definition at line 37 of file TextAreaTheme.h.
|
inlineoverridevirtualinherited |
Populate all fields from the global Theme token set.
Subclasses call GraphicTheme::applyFrom(t) first, then apply their own token mappings.
Reimplemented from ml::InputTheme.
Definition at line 30 of file TextInputTheme.h.
|
inlineinherited |
Definition at line 98 of file TextInput.h.
|
inlineinherited |
Definition at line 90 of file TextArea.h.
|
inlineinherited |
Definition at line 78 of file TextArea.h.
|
inherited |
|
overrideprotectedinherited |
|
inlinenodiscardinherited |
Definition at line 68 of file InputTheme.h.
|
inlinenodiscardinherited |
Definition at line 67 of file InputTheme.h.
|
inlinenodiscardinherited |
Definition at line 66 of file InputTheme.h.
|
inlinenodiscardinherited |
Definition at line 72 of file InputTheme.h.
|
inlinenodiscardinherited |
Definition at line 71 of file InputTheme.h.
|
inlinenodiscardinherited |
Definition at line 70 of file InputTheme.h.
|
inlinenodiscardinherited |
Definition at line 69 of file InputTheme.h.
|
inlinenodiscardinherited |
Definition at line 74 of file InputTheme.h.
|
nodiscardinherited |
|
inlinenodiscardinherited |
Definition at line 52 of file TextInputTheme.h.
|
inlinenodiscardinherited |
Definition at line 75 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 76 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 74 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 67 of file GraphicTheme.h.
|
inlinenodiscardinherited |
Definition at line 73 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 80 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 81 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 82 of file ControlTheme.h.
|
overrideinherited |
|
inlinenodiscardinherited |
Definition at line 72 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 44 of file InputSettings.h.
|
inlinenodiscardinherited |
Definition at line 78 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 68 of file GraphicTheme.h.
|
inlinenodiscardinherited |
Definition at line 69 of file GraphicTheme.h.
|
inlinenodiscardinherited |
Definition at line 79 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 46 of file InputSettings.h.
|
nodiscardinherited |
|
inlinenodiscardinherited |
Definition at line 73 of file InputTheme.h.
|
overrideinherited |
|
inlinenodiscardinherited |
Definition at line 70 of file GraphicTheme.h.
|
inlinenodiscardinherited |
Definition at line 46 of file TextAreaTheme.h.
|
inlinenodiscardinherited |
Definition at line 47 of file TextAreaTheme.h.
|
inlinenodiscardinherited |
Definition at line 48 of file TextAreaTheme.h.
|
nodiscardinherited |
|
inlinenodiscardinherited |
Definition at line 51 of file TextInputTheme.h.
|
nodiscardinherited |
|
inherited |
Return the current state value.
StateEnum value.
|
inlinenodiscardinherited |
Definition at line 77 of file ControlTheme.h.
|
nodiscardinherited |
|
protectedinherited |
|
protectedvirtualinherited |
|
nodiscardinherited |
|
nodiscardinherited |
|
inlinenodiscardinherited |
Definition at line 45 of file InputSettings.h.
|
nodiscardinherited |
|
inlinenodiscardinherited |
Return true if applySettings() is currently blocked.
Definition at line 115 of file Themeable.h.
|
inherited |
Return true if currently in state.
| state | The state value to compare against. |
true if the current state equals state.
|
inlinenodiscardinherited |
Return true if this component ignores theme changes.
Definition at line 97 of file Themeable.h.
|
inlineinherited |
Prevent applySettings() from taking effect.
Explicit individual setter calls still work normally. Only blocks the batch applySettings() path.
Definition at line 107 of file Themeable.h.
|
inlineinherited |
Prevent automatic re-styling when the global theme changes.
The component keeps its current visual state. Explicit individual setter calls still work normally.
Definition at line 85 of file Themeable.h.
|
inherited |
|
overrideprotectedvirtualinherited |
Called after every rebuild(). Grows the canvas to full content height and updates ScrollPane's content height.
Reimplemented from ml::TextInput.
|
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 |
|
overrideprotectedvirtualinherited |
Called by ThemeManager when the active theme changes.
Override in your component to re-style from the new theme. Always check isThemeLocked() first:
| theme | The newly active theme. |
Implements ml::Themeable.
|
protectedinherited |
|
overrideprotectedvirtualinherited |
Top-aligned reflow. Reads vertical scroll from ScrollPane.
Reimplemented from ml::TextInput.
|
inherited |
|
inlineinherited |
Definition at line 78 of file InputTheme.h.
|
inlineinherited |
Definition at line 77 of file InputTheme.h.
|
inlineinherited |
Definition at line 76 of file InputTheme.h.
|
inlineinherited |
Definition at line 82 of file InputTheme.h.
|
inlineinherited |
Definition at line 81 of file InputTheme.h.
|
inlineinherited |
Definition at line 80 of file InputTheme.h.
|
inlineinherited |
Definition at line 79 of file InputTheme.h.
|
inlineinherited |
Definition at line 84 of file InputTheme.h.
|
virtualinherited |
|
inlineinherited |
Definition at line 55 of file TextInputTheme.h.
|
inlineinherited |
Definition at line 87 of file ControlTheme.h.
|
inlineinherited |
Definition at line 88 of file ControlTheme.h.
|
inherited |
|
inherited |
|
inlineinherited |
Definition at line 86 of file ControlTheme.h.
|
inlineinherited |
Definition at line 72 of file GraphicTheme.h.
|
inlineinherited |
Definition at line 85 of file ControlTheme.h.
|
deleteinherited |
|
virtualinherited |
|
inlineinherited |
Definition at line 94 of file ControlTheme.h.
|
inlineinherited |
Definition at line 95 of file ControlTheme.h.
|
inlineinherited |
Definition at line 84 of file ControlTheme.h.
|
inlineinherited |
Definition at line 49 of file InputSettings.h.
|
inlineinherited |
Definition at line 90 of file ControlTheme.h.
|
inlineinherited |
Definition at line 73 of file GraphicTheme.h.
|
inlineinherited |
Definition at line 74 of file GraphicTheme.h.
|
inlineinherited |
Definition at line 91 of file ControlTheme.h.
|
inlineinherited |
Definition at line 51 of file InputSettings.h.
|
inlineinherited |
Definition at line 50 of file InputSettings.h.
|
inherited |
|
inlineinherited |
Definition at line 83 of file InputTheme.h.
|
overridevirtualinherited |
Reimplemented from ml::TextInput.
|
inlineinherited |
Definition at line 75 of file GraphicTheme.h.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
overridevirtualinherited |
Reimplemented from ml::TextInput.
|
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. |
|
inlineinherited |
Definition at line 89 of file ControlTheme.h.
|
inherited |
|
protectedinherited |
|
overrideprotectedvirtualinherited |
Reimplemented from ml::TextInput.
|
explicit |
|
inlineinherited |
Allow applySettings() to take effect again.
Definition at line 112 of file Themeable.h.
|
inlineinherited |
Resume reacting to global theme changes.
Does NOT immediately re-apply the current theme — call ThemeManager::get() and pass it to onThemeApplied() manually if you want to re-sync immediately after unlocking.
Definition at line 94 of file Themeable.h.
|
protectedinherited |
Definition at line 58 of file TextInput.h.
|
protectedinherited |
Definition at line 54 of file TextInput.h.
|
mutableprotectedinherited |
Definition at line 56 of file TextInput.h.
|
protectedinherited |
Definition at line 71 of file TextInput.h.
|
mutableprotectedinherited |
Definition at line 65 of file TextInput.h.
|
mutableprotectedinherited |
Definition at line 66 of file TextInput.h.
|
protectedinherited |
Definition at line 70 of file TextInput.h.
|
protectedinherited |
Definition at line 68 of file TextInput.h.
|
protectedinherited |
Definition at line 72 of file TextInput.h.
|
protectedinherited |
Definition at line 75 of file TextInput.h.
|
protectedinherited |
Definition at line 76 of file TextInput.h.
|
protectedinherited |
Definition at line 62 of file TextInput.h.
|
protectedinherited |
Definition at line 59 of file TextInput.h.
|
protectedinherited |
Definition at line 55 of file TextInput.h.
|
protectedinherited |
Definition at line 60 of file TextInput.h.
|
protectedinherited |
Definition at line 63 of file TextInput.h.
|
protectedinherited |
Definition at line 73 of file TextInput.h.
Definition at line 28 of file InputTheme.h.
Definition at line 27 of file InputTheme.h.
Definition at line 26 of file InputTheme.h.
Definition at line 32 of file InputTheme.h.
Definition at line 31 of file InputTheme.h.
Definition at line 30 of file InputTheme.h.
Definition at line 29 of file InputTheme.h.
|
inherited |
Definition at line 34 of file InputTheme.h.
|
inherited |
Definition at line 26 of file TextInputTheme.h.
Definition at line 33 of file ControlTheme.h.
Definition at line 34 of file ControlTheme.h.
Definition at line 32 of file ControlTheme.h.
Definition at line 43 of file GraphicTheme.h.
Definition at line 31 of file ControlTheme.h.
|
inherited |
Definition at line 39 of file ControlTheme.h.
|
inherited |
Definition at line 40 of file ControlTheme.h.
|
inherited |
Definition at line 41 of file ControlTheme.h.
Definition at line 30 of file ControlTheme.h.
|
inherited |
0 = unlimited
Definition at line 29 of file InputSettings.h.
Definition at line 36 of file ControlTheme.h.
Definition at line 44 of file GraphicTheme.h.
|
inherited |
Definition at line 45 of file GraphicTheme.h.
|
inherited |
Definition at line 37 of file ControlTheme.h.
|
inherited |
Bullet •
Definition at line 31 of file InputSettings.h.
|
inherited |
Definition at line 30 of file InputSettings.h.
Definition at line 33 of file InputTheme.h.
|
inherited |
Definition at line 46 of file GraphicTheme.h.
Definition at line 31 of file TextAreaTheme.h.
Definition at line 32 of file TextAreaTheme.h.
|
inherited |
Definition at line 33 of file TextAreaTheme.h.
Definition at line 25 of file TextInputTheme.h.
|
inherited |
Definition at line 28 of file InputSettings.h.
|
inherited |
Definition at line 35 of file ControlTheme.h.