Loading...
Searching...
No Matches
ml::TextInputWith< MANIFEST > Class Template Reference

#include <Malena/Graphics/Text/TextInput.h>

Inheritance diagram for ml::TextInputWith< MANIFEST >:
[legend]

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

TextInputThemeapplyFrom (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::FontgetFont () 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
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)
virtual void setPosition (const sf::Vector2f &position) override
void setRadius (float r)
void setReadOnly (bool readonly)
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)
virtual void setSize (const sf::Vector2f &size)
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)
 TextInput (const sf::Font &font=FontManager<>::getDefault())
void unlockSettings ()
 Allow applySettings() to take effect again.
void unlockTheme ()
 Resume reacting to global theme changes.

Public Attributes

sf::Color bgDisabled = sf::Color(30, 30, 30)
sf::Color bgFocused = sf::Color(50, 50, 50)
sf::Color bgIdle = sf::Color(40, 40, 40)
sf::Color borderDisabled = sf::Color(60, 60, 60)
sf::Color borderError = sf::Color(220, 70, 70)
sf::Color borderFocused = sf::Color(70, 130, 230)
sf::Color borderIdle = sf::Color(100, 100, 100)
float borderThickness = 1.5f
sf::Color cursorColor = sf::Color::White
sf::Color disabledColor = sf::Color(60, 60, 60)
sf::Color disabledTextColor = sf::Color(120, 120, 120)
sf::Color errorColor = sf::Color(220, 70, 70)
sf::Color fillColor = sf::Color(40, 40, 40)
sf::Color focusColor = sf::Color(100, 60, 200)
const sf::Fontfont = &FontManager<>::getDefault()
unsigned int fontSize = 14
unsigned int fontSizeSmall = 11
sf::Color hoverColor = sf::Color(70, 130, 230)
std::size_t maxLength = 0
 0 = unlimited
sf::Color mutedColor = sf::Color(120, 120, 120)
sf::Color outlineColor = sf::Color(100, 100, 100)
float outlineThickness = 1.5f
float padding = 8.f
char32_t passwordChar = U'\u2022'
 Bullet •
bool passwordMode = false
sf::Color placeholderColor = sf::Color(120, 120, 120)
float radius = 8.f
sf::Color selectionColor = sf::Color(70, 130, 230, 120)
sf::Vector2f size = {200.f, 36.f}
sf::Color textColor = sf::Color::White

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)
virtual std::size_t hitTest (const sf::Vector2f &worldPos) const
virtual void onRebuildComplete ()
void onThemeApplied (const Theme &theme) override
 Called by ThemeManager when the active theme changes.
void rebuild ()
virtual void rebuildAndScroll ()
virtual void reflow ()
void syncColors ()
virtual void syncPlaceholder ()

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}
bool _prevMouseDown = false
RichTextRenderer _renderer
float _scrollX = 0.f
bool _showPlaceholder = true
bool _waitingDouble = false

Detailed Description

template<typename MANIFEST>
class ml::TextInputWith< MANIFEST >

Definition at line 185 of file TextInput.h.

Member Typedef Documentation

◆ Flag

Definition at line 50 of file TextInput.h.

◆ manifest_type

using ml::Customizable< MANIFEST >::manifest_type
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.

◆ State

Definition at line 51 of file TextInput.h.

Member Function Documentation

◆ applyFrom()

TextInputTheme & ml::TextInputTheme::applyFrom ( const Theme & t)
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.

◆ applySettings()

template<typename S>
void ml::TextInput::applySettings ( const S & s)
inlineinherited

Definition at line 98 of file TextInput.h.

◆ applyStyle()

template<typename St>
void ml::TextInput::applyStyle ( const St & s)
inlineinherited

Definition at line 118 of file TextInput.h.

◆ applyTheme()

template<typename T>
void ml::TextInput::applyTheme ( const T & t)
inlineinherited

Definition at line 109 of file TextInput.h.

◆ clear()

void ml::TextInput::clear ( )
inherited

◆ draw()

void ml::TextInput::draw ( sf::RenderTarget & target,
sf::RenderStates states ) const
overrideprotectedinherited

◆ getBgDisabled()

sf::Color ml::InputTheme::getBgDisabled ( ) const
inlinenodiscardinherited

Definition at line 68 of file InputTheme.h.

◆ getBgFocused()

sf::Color ml::InputTheme::getBgFocused ( ) const
inlinenodiscardinherited

Definition at line 67 of file InputTheme.h.

◆ getBgIdle()

sf::Color ml::InputTheme::getBgIdle ( ) const
inlinenodiscardinherited

Definition at line 66 of file InputTheme.h.

◆ getBorderDisabled()

sf::Color ml::InputTheme::getBorderDisabled ( ) const
inlinenodiscardinherited

Definition at line 72 of file InputTheme.h.

◆ getBorderError()

sf::Color ml::InputTheme::getBorderError ( ) const
inlinenodiscardinherited

Definition at line 71 of file InputTheme.h.

◆ getBorderFocused()

sf::Color ml::InputTheme::getBorderFocused ( ) const
inlinenodiscardinherited

Definition at line 70 of file InputTheme.h.

◆ getBorderIdle()

sf::Color ml::InputTheme::getBorderIdle ( ) const
inlinenodiscardinherited

Definition at line 69 of file InputTheme.h.

◆ getBorderThickness()

float ml::InputTheme::getBorderThickness ( ) const
inlinenodiscardinherited

Definition at line 74 of file InputTheme.h.

◆ getCharacterSize()

unsigned int ml::TextInput::getCharacterSize ( ) const
nodiscardinherited

◆ getCursorColor()

sf::Color ml::TextInputTheme::getCursorColor ( ) const
inlinenodiscardinherited

Definition at line 52 of file TextInputTheme.h.

◆ getDisabledColor()

sf::Color ml::ControlTheme::getDisabledColor ( ) const
inlinenodiscardinherited

Definition at line 75 of file ControlTheme.h.

◆ getDisabledTextColor()

sf::Color ml::ControlTheme::getDisabledTextColor ( ) const
inlinenodiscardinherited

Definition at line 76 of file ControlTheme.h.

◆ getErrorColor()

sf::Color ml::ControlTheme::getErrorColor ( ) const
inlinenodiscardinherited

Definition at line 74 of file ControlTheme.h.

◆ getFillColor()

sf::Color ml::GraphicTheme::getFillColor ( ) const
inlinenodiscardinherited

Definition at line 67 of file GraphicTheme.h.

◆ getFocusColor()

sf::Color ml::ControlTheme::getFocusColor ( ) const
inlinenodiscardinherited

Definition at line 73 of file ControlTheme.h.

◆ getFont()

const sf::Font * ml::ControlTheme::getFont ( ) const
inlinenodiscardinherited

Definition at line 80 of file ControlTheme.h.

◆ getFontSize()

unsigned int ml::ControlTheme::getFontSize ( ) const
inlinenodiscardinherited

Definition at line 81 of file ControlTheme.h.

◆ getFontSizeSmall()

unsigned int ml::ControlTheme::getFontSizeSmall ( ) const
inlinenodiscardinherited

Definition at line 82 of file ControlTheme.h.

◆ getGlobalBounds()

sf::FloatRect ml::TextInput::getGlobalBounds ( ) const
overrideinherited

◆ getHoverColor()

sf::Color ml::ControlTheme::getHoverColor ( ) const
inlinenodiscardinherited

Definition at line 72 of file ControlTheme.h.

◆ getMaxLength()

std::size_t ml::InputSettings::getMaxLength ( ) const
inlinenodiscardinherited

Definition at line 44 of file InputSettings.h.

◆ getMutedColor()

sf::Color ml::ControlTheme::getMutedColor ( ) const
inlinenodiscardinherited

Definition at line 78 of file ControlTheme.h.

◆ getOutlineColor()

sf::Color ml::GraphicTheme::getOutlineColor ( ) const
inlinenodiscardinherited

Definition at line 68 of file GraphicTheme.h.

◆ getOutlineThickness()

float ml::GraphicTheme::getOutlineThickness ( ) const
inlinenodiscardinherited

Definition at line 69 of file GraphicTheme.h.

◆ getPadding()

float ml::ControlTheme::getPadding ( ) const
inlinenodiscardinherited

Definition at line 79 of file ControlTheme.h.

◆ getPasswordChar()

char32_t ml::InputSettings::getPasswordChar ( ) const
inlinenodiscardinherited

Definition at line 46 of file InputSettings.h.

◆ getPlaceholder()

std::string ml::TextInput::getPlaceholder ( ) const
nodiscardinherited

◆ getPlaceholderColor()

sf::Color ml::InputTheme::getPlaceholderColor ( ) const
inlinenodiscardinherited

Definition at line 73 of file InputTheme.h.

◆ getPosition()

sf::Vector2f ml::TextInput::getPosition ( ) const
overrideinherited

◆ getRadius()

float ml::GraphicTheme::getRadius ( ) const
inlinenodiscardinherited

Definition at line 70 of file GraphicTheme.h.

◆ getSelectedText()

std::string ml::TextInput::getSelectedText ( ) const
nodiscardinherited

◆ getSelectionColor()

sf::Color ml::TextInputTheme::getSelectionColor ( ) const
inlinenodiscardinherited

Definition at line 51 of file TextInputTheme.h.

◆ getSize()

sf::Vector2f ml::TextInput::getSize ( ) const
nodiscardinherited

◆ getState()

std::enable_if_t<!std::is_void_v< T >, T > ml::StateManager< extract_State< MANIFEST >::type >::getState ( ) const
inherited

Return the current state value.

Returns
The active StateEnum value.

◆ getTextColor()

sf::Color ml::ControlTheme::getTextColor ( ) const
inlinenodiscardinherited

Definition at line 77 of file ControlTheme.h.

◆ getValue()

std::string ml::TextInput::getValue ( ) const
nodiscardinherited

◆ handleChar()

void ml::TextInput::handleChar ( const sf::Event::TextEntered & te)
protectedinherited

◆ handleKey()

virtual void ml::TextInput::handleKey ( const sf::Event::KeyPressed & kp)
protectedvirtualinherited

◆ hasError()

bool ml::TextInput::hasError ( ) const
nodiscardinherited

◆ hitTest()

virtual std::size_t ml::TextInput::hitTest ( const sf::Vector2f & worldPos) const
protectedvirtualinherited

◆ isEnabled()

bool ml::TextInput::isEnabled ( ) const
nodiscardinherited

◆ isPasswordMode()

bool ml::InputSettings::isPasswordMode ( ) const
inlinenodiscardinherited

Definition at line 45 of file InputSettings.h.

◆ isReadOnly()

bool ml::TextInput::isReadOnly ( ) const
nodiscardinherited

◆ isSettingsLocked()

bool ml::Themeable::isSettingsLocked ( ) const
inlinenodiscardinherited

Return true if applySettings() is currently blocked.

Definition at line 115 of file Themeable.h.

◆ isState()

std::enable_if_t<!std::is_void_v< T >, bool > ml::StateManager< extract_State< MANIFEST >::type >::isState ( T state) const
inherited

Return true if currently in state.

Parameters
stateThe state value to compare against.
Returns
true if the current state equals state.

◆ isThemeLocked()

bool ml::Themeable::isThemeLocked ( ) const
inlinenodiscardinherited

Return true if this component ignores theme changes.

Definition at line 97 of file Themeable.h.

◆ lockSettings()

void ml::Themeable::lockSettings ( )
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.

◆ lockTheme()

void ml::Themeable::lockTheme ( )
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.

◆ onChange()

void ml::TextInput::onChange ( std::function< void(const std::string &)> callback)
inherited

◆ onRebuildComplete()

virtual void ml::TextInput::onRebuildComplete ( )
inlineprotectedvirtualinherited

Reimplemented in ml::TextArea.

Definition at line 79 of file TextInput.h.

◆ onStateEnter()

std::enable_if_t<!std::is_void_v< T > > ml::StateManager< extract_State< MANIFEST >::type >::onStateEnter ( std::function< void(T)> callback)
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.

Parameters
callbackFunction called with the new state after each transition.

◆ onStateExit()

std::enable_if_t<!std::is_void_v< T > > ml::StateManager< extract_State< MANIFEST >::type >::onStateExit ( std::function< void(T)> callback)
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.

Parameters
callbackFunction called with the old state before each transition.

◆ onSubmit()

void ml::TextInput::onSubmit ( std::function< void(const std::string &)> callback)
inherited

◆ onThemeApplied()

void ml::TextInput::onThemeApplied ( const Theme & theme)
overrideprotectedvirtualinherited

Called by ThemeManager when the active theme changes.

Override in your component to re-style from the new theme. Always check isThemeLocked() first:

void onThemeApplied(const Theme& theme) override
{
if (isThemeLocked()) return;
MySettings::applyTheme(theme);
syncFromSettings();
}
void onThemeApplied(const Theme &theme) override
Called by ThemeManager when the active theme changes.
bool isThemeLocked() const
Return true if this component ignores theme changes.
Definition Themeable.h:97
Universal design token set applied across all Themeable components.
Definition Theme.h:70
Parameters
themeThe newly active theme.

Implements ml::Themeable.

◆ rebuild()

void ml::TextInput::rebuild ( )
protectedinherited

◆ rebuildAndScroll()

virtual void ml::TextInput::rebuildAndScroll ( )
protectedvirtualinherited

◆ reflow()

virtual void ml::TextInput::reflow ( )
protectedvirtualinherited

Reimplemented in ml::TextArea.

◆ selectAll()

void ml::TextInput::selectAll ( )
inherited

◆ setBgDisabled()

void ml::InputTheme::setBgDisabled ( const sf::Color & c)
inlineinherited

Definition at line 78 of file InputTheme.h.

◆ setBgFocused()

void ml::InputTheme::setBgFocused ( const sf::Color & c)
inlineinherited

Definition at line 77 of file InputTheme.h.

◆ setBgIdle()

void ml::InputTheme::setBgIdle ( const sf::Color & c)
inlineinherited

Definition at line 76 of file InputTheme.h.

◆ setBorderDisabled()

void ml::InputTheme::setBorderDisabled ( const sf::Color & c)
inlineinherited

Definition at line 82 of file InputTheme.h.

◆ setBorderError()

void ml::InputTheme::setBorderError ( const sf::Color & c)
inlineinherited

Definition at line 81 of file InputTheme.h.

◆ setBorderFocused()

void ml::InputTheme::setBorderFocused ( const sf::Color & c)
inlineinherited

Definition at line 80 of file InputTheme.h.

◆ setBorderIdle()

void ml::InputTheme::setBorderIdle ( const sf::Color & c)
inlineinherited

Definition at line 79 of file InputTheme.h.

◆ setBorderThickness()

void ml::InputTheme::setBorderThickness ( float t)
inlineinherited

Definition at line 84 of file InputTheme.h.

◆ setCharacterSize()

virtual void ml::TextInput::setCharacterSize ( unsigned int size)
virtualinherited

◆ setCursorColor()

void ml::TextInputTheme::setCursorColor ( const sf::Color & c)
inlineinherited

Definition at line 55 of file TextInputTheme.h.

◆ setDisabledColor()

void ml::ControlTheme::setDisabledColor ( const sf::Color & c)
inlineinherited

Definition at line 87 of file ControlTheme.h.

◆ setDisabledTextColor()

void ml::ControlTheme::setDisabledTextColor ( const sf::Color & c)
inlineinherited

Definition at line 88 of file ControlTheme.h.

◆ setEnabled()

void ml::TextInput::setEnabled ( bool enabled)
inherited

◆ setError()

void ml::TextInput::setError ( bool error)
inherited

◆ setErrorColor()

void ml::ControlTheme::setErrorColor ( const sf::Color & c)
inlineinherited

Definition at line 86 of file ControlTheme.h.

◆ setFillColor()

void ml::GraphicTheme::setFillColor ( const sf::Color & c)
inlineinherited

Definition at line 72 of file GraphicTheme.h.

◆ setFocusColor()

void ml::ControlTheme::setFocusColor ( const sf::Color & c)
inlineinherited

Definition at line 85 of file ControlTheme.h.

◆ setFont() [1/2]

void ml::TextInput::setFont ( const sf::Font && )
deleteinherited

◆ setFont() [2/2]

virtual void ml::TextInput::setFont ( const sf::Font & font)
virtualinherited

◆ setFontSize()

void ml::ControlTheme::setFontSize ( unsigned int s)
inlineinherited

Definition at line 94 of file ControlTheme.h.

◆ setFontSizeSmall()

void ml::ControlTheme::setFontSizeSmall ( unsigned int s)
inlineinherited

Definition at line 95 of file ControlTheme.h.

◆ setHoverColor()

void ml::ControlTheme::setHoverColor ( const sf::Color & c)
inlineinherited

Definition at line 84 of file ControlTheme.h.

◆ setMaxLength()

void ml::InputSettings::setMaxLength ( std::size_t n)
inlineinherited

Definition at line 49 of file InputSettings.h.

◆ setMutedColor()

void ml::ControlTheme::setMutedColor ( const sf::Color & c)
inlineinherited

Definition at line 90 of file ControlTheme.h.

◆ setOutlineColor()

void ml::GraphicTheme::setOutlineColor ( const sf::Color & c)
inlineinherited

Definition at line 73 of file GraphicTheme.h.

◆ setOutlineThickness()

void ml::GraphicTheme::setOutlineThickness ( float t)
inlineinherited

Definition at line 74 of file GraphicTheme.h.

◆ setPadding()

void ml::ControlTheme::setPadding ( float p)
inlineinherited

Definition at line 91 of file ControlTheme.h.

◆ setPasswordChar()

void ml::InputSettings::setPasswordChar ( char32_t c)
inlineinherited

Definition at line 51 of file InputSettings.h.

◆ setPasswordMode()

void ml::InputSettings::setPasswordMode ( bool b)
inlineinherited

Definition at line 50 of file InputSettings.h.

◆ setPlaceholder()

void ml::TextInput::setPlaceholder ( const std::string & text)
inherited

◆ setPlaceholderColor()

void ml::InputTheme::setPlaceholderColor ( const sf::Color & c)
inlineinherited

Definition at line 83 of file InputTheme.h.

◆ setPosition()

virtual void ml::TextInput::setPosition ( const sf::Vector2f & position)
overridevirtualinherited

Reimplemented in ml::TextArea.

◆ setRadius()

void ml::GraphicTheme::setRadius ( float r)
inlineinherited

Definition at line 75 of file GraphicTheme.h.

◆ setReadOnly()

void ml::TextInput::setReadOnly ( bool readonly)
inherited

◆ setSelection()

void ml::TextInput::setSelection ( std::size_t start,
std::size_t end )
inherited

◆ setSelectionBold()

void ml::TextInput::setSelectionBold ( bool bold)
inherited

◆ setSelectionCharSize()

void ml::TextInput::setSelectionCharSize ( unsigned int size)
inherited

◆ setSelectionColor()

void ml::TextInput::setSelectionColor ( const sf::Color & color)
inherited

◆ setSelectionFont()

void ml::TextInput::setSelectionFont ( const sf::Font & font)
inherited

◆ setSelectionItalic()

void ml::TextInput::setSelectionItalic ( bool italic)
inherited

◆ setSelectionUnderline()

void ml::TextInput::setSelectionUnderline ( bool underline)
inherited

◆ setSize()

virtual void ml::TextInput::setSize ( const sf::Vector2f & size)
virtualinherited

Reimplemented in ml::TextArea.

◆ setState()

std::enable_if_t<!std::is_void_v< T > > ml::StateManager< extract_State< MANIFEST >::type >::setState ( T newState)
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.

Parameters
newStateThe state to transition into.

◆ setTextColor()

void ml::ControlTheme::setTextColor ( const sf::Color & c)
inlineinherited

Definition at line 89 of file ControlTheme.h.

◆ setValue()

void ml::TextInput::setValue ( const std::string & value)
inherited

◆ syncColors()

void ml::TextInput::syncColors ( )
protectedinherited

◆ syncPlaceholder()

virtual void ml::TextInput::syncPlaceholder ( )
protectedvirtualinherited

Reimplemented in ml::TextArea.

◆ TextInput()

template<typename MANIFEST>
ml::TextInput::TextInput ( const sf::Font & font = FontManager<>::getDefault())
explicit

◆ unlockSettings()

void ml::Themeable::unlockSettings ( )
inlineinherited

Allow applySettings() to take effect again.

Definition at line 112 of file Themeable.h.

◆ unlockTheme()

void ml::Themeable::unlockTheme ( )
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.

Member Data Documentation

◆ _background

sf::RectangleShape ml::TextInput::_background
protectedinherited

Definition at line 58 of file TextInput.h.

◆ _buffer

RichTextBuffer ml::TextInput::_buffer
protectedinherited

Definition at line 54 of file TextInput.h.

◆ _canvas

sf::RenderTexture ml::TextInput::_canvas
mutableprotectedinherited

Definition at line 56 of file TextInput.h.

◆ _clickClock

sf::Clock ml::TextInput::_clickClock
protectedinherited

Definition at line 71 of file TextInput.h.

◆ _cursorClock

sf::Clock ml::TextInput::_cursorClock
mutableprotectedinherited

Definition at line 65 of file TextInput.h.

◆ _cursorVisible

bool ml::TextInput::_cursorVisible = false
mutableprotectedinherited

Definition at line 66 of file TextInput.h.

◆ _dragAnchor

std::size_t ml::TextInput::_dragAnchor = 0
protectedinherited

Definition at line 70 of file TextInput.h.

◆ _dragging

bool ml::TextInput::_dragging = false
protectedinherited

Definition at line 68 of file TextInput.h.

◆ _lastClick

sf::Vector2f ml::TextInput::_lastClick = {}
protectedinherited

Definition at line 72 of file TextInput.h.

◆ _onChange

std::function<void(const std::string&)> ml::TextInput::_onChange
protectedinherited

Definition at line 75 of file TextInput.h.

◆ _onSubmit

std::function<void(const std::string&)> ml::TextInput::_onSubmit
protectedinherited

Definition at line 76 of file TextInput.h.

◆ _placeholder

sf::Text ml::TextInput::_placeholder
protectedinherited

Definition at line 62 of file TextInput.h.

◆ _position

sf::Vector2f ml::TextInput::_position = {0.f, 0.f}
protectedinherited

Definition at line 59 of file TextInput.h.

◆ _prevMouseDown

bool ml::TextInput::_prevMouseDown = false
protectedinherited

Definition at line 69 of file TextInput.h.

◆ _renderer

RichTextRenderer ml::TextInput::_renderer
protectedinherited

Definition at line 55 of file TextInput.h.

◆ _scrollX

float ml::TextInput::_scrollX = 0.f
protectedinherited

Definition at line 60 of file TextInput.h.

◆ _showPlaceholder

bool ml::TextInput::_showPlaceholder = true
protectedinherited

Definition at line 63 of file TextInput.h.

◆ _waitingDouble

bool ml::TextInput::_waitingDouble = false
protectedinherited

Definition at line 73 of file TextInput.h.

◆ bgDisabled

sf::Color ml::InputTheme::bgDisabled = sf::Color(30, 30, 30)
inherited

Definition at line 28 of file InputTheme.h.

◆ bgFocused

sf::Color ml::InputTheme::bgFocused = sf::Color(50, 50, 50)
inherited

Definition at line 27 of file InputTheme.h.

◆ bgIdle

sf::Color ml::InputTheme::bgIdle = sf::Color(40, 40, 40)
inherited

Definition at line 26 of file InputTheme.h.

◆ borderDisabled

sf::Color ml::InputTheme::borderDisabled = sf::Color(60, 60, 60)
inherited

Definition at line 32 of file InputTheme.h.

◆ borderError

sf::Color ml::InputTheme::borderError = sf::Color(220, 70, 70)
inherited

Definition at line 31 of file InputTheme.h.

◆ borderFocused

sf::Color ml::InputTheme::borderFocused = sf::Color(70, 130, 230)
inherited

Definition at line 30 of file InputTheme.h.

◆ borderIdle

sf::Color ml::InputTheme::borderIdle = sf::Color(100, 100, 100)
inherited

Definition at line 29 of file InputTheme.h.

◆ borderThickness

float ml::InputTheme::borderThickness = 1.5f
inherited

Definition at line 34 of file InputTheme.h.

◆ cursorColor

sf::Color ml::TextInputTheme::cursorColor = sf::Color::White
inherited

Definition at line 26 of file TextInputTheme.h.

◆ disabledColor

sf::Color ml::ControlTheme::disabledColor = sf::Color(60, 60, 60)
inherited

Definition at line 33 of file ControlTheme.h.

◆ disabledTextColor

sf::Color ml::ControlTheme::disabledTextColor = sf::Color(120, 120, 120)
inherited

Definition at line 34 of file ControlTheme.h.

◆ errorColor

sf::Color ml::ControlTheme::errorColor = sf::Color(220, 70, 70)
inherited

Definition at line 32 of file ControlTheme.h.

◆ fillColor

sf::Color ml::GraphicTheme::fillColor = sf::Color(40, 40, 40)
inherited

Definition at line 43 of file GraphicTheme.h.

◆ focusColor

sf::Color ml::ControlTheme::focusColor = sf::Color(100, 60, 200)
inherited

Definition at line 31 of file ControlTheme.h.

◆ font

const sf::Font* ml::ControlTheme::font = &FontManager<>::getDefault()
inherited

Definition at line 39 of file ControlTheme.h.

◆ fontSize

unsigned int ml::ControlTheme::fontSize = 14
inherited

Definition at line 40 of file ControlTheme.h.

◆ fontSizeSmall

unsigned int ml::ControlTheme::fontSizeSmall = 11
inherited

Definition at line 41 of file ControlTheme.h.

◆ hoverColor

sf::Color ml::ControlTheme::hoverColor = sf::Color(70, 130, 230)
inherited

Definition at line 30 of file ControlTheme.h.

◆ maxLength

std::size_t ml::InputSettings::maxLength = 0
inherited

0 = unlimited

Definition at line 29 of file InputSettings.h.

◆ mutedColor

sf::Color ml::ControlTheme::mutedColor = sf::Color(120, 120, 120)
inherited

Definition at line 36 of file ControlTheme.h.

◆ outlineColor

sf::Color ml::GraphicTheme::outlineColor = sf::Color(100, 100, 100)
inherited

Definition at line 44 of file GraphicTheme.h.

◆ outlineThickness

float ml::GraphicTheme::outlineThickness = 1.5f
inherited

Definition at line 45 of file GraphicTheme.h.

◆ padding

float ml::ControlTheme::padding = 8.f
inherited

Definition at line 37 of file ControlTheme.h.

◆ passwordChar

char32_t ml::InputSettings::passwordChar = U'\u2022'
inherited

Bullet •

Definition at line 31 of file InputSettings.h.

◆ passwordMode

bool ml::InputSettings::passwordMode = false
inherited

Definition at line 30 of file InputSettings.h.

◆ placeholderColor

sf::Color ml::InputTheme::placeholderColor = sf::Color(120, 120, 120)
inherited

Definition at line 33 of file InputTheme.h.

◆ radius

float ml::GraphicTheme::radius = 8.f
inherited

Definition at line 46 of file GraphicTheme.h.

◆ selectionColor

sf::Color ml::TextInputTheme::selectionColor = sf::Color(70, 130, 230, 120)
inherited

Definition at line 25 of file TextInputTheme.h.

◆ size

sf::Vector2f ml::InputSettings::size = {200.f, 36.f}
inherited

Definition at line 28 of file InputSettings.h.

◆ textColor

sf::Color ml::ControlTheme::textColor = sf::Color::White
inherited

Definition at line 35 of file ControlTheme.h.


The documentation for this class was generated from the following file: