diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-03-02 11:28:55 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-02 11:28:55 +1100 |
commit | 3893151fe217a684aba77669bab6ca3b828943e7 (patch) | |
tree | 2616c70d9fa2ec2a2f01462327bc07b984579b26 /source/windowing/StarTextBoxWidget.cpp | |
parent | 3e89b9cabf9b56f337b6b953d2222b56969d7375 (diff) | |
parent | 63d8c8e8db0a80f9dc98f98e845bc4654060ada4 (diff) |
Merge pull request #203 from KrashV/new-widget-callbacks
Bring new widget callbacks
Diffstat (limited to 'source/windowing/StarTextBoxWidget.cpp')
-rw-r--r-- | source/windowing/StarTextBoxWidget.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/windowing/StarTextBoxWidget.cpp b/source/windowing/StarTextBoxWidget.cpp index 634a006..f438231 100644 --- a/source/windowing/StarTextBoxWidget.cpp +++ b/source/windowing/StarTextBoxWidget.cpp @@ -168,6 +168,22 @@ bool TextBoxWidget::setText(String const& text, bool callback, bool moveCursor) return true; } +String const& TextBoxWidget::getHint() const { + return m_hint; +} + +void TextBoxWidget::setHint(String const& hint) { + m_hint = hint; +} + +int const& TextBoxWidget::getCursorPosition() const { + return m_cursorOffset; +} + +void TextBoxWidget::setCursorPosition(int cursorPosition) { + m_cursorOffset = clamp(cursorPosition, 0, (int)m_text.size()); +} + bool TextBoxWidget::getHidden() const { return m_textHidden; } |