diff options
author | Vladimir Krasheninnikov <boba09@list.ru> | 2025-03-01 20:31:48 +0100 |
---|---|---|
committer | Vladimir Krasheninnikov <boba09@list.ru> | 2025-03-01 20:31:48 +0100 |
commit | e9a67335409ccc75a95cf1093bedb47abc17861a (patch) | |
tree | 4abe97bc7a6f43a8dd8f891d374d61a829cbfd33 /source/windowing/StarTextBoxWidget.cpp | |
parent | ec20848c4689e73090963255b6cf923d6859c1be (diff) |
Bring new textbox callbacks
Diffstat (limited to 'source/windowing/StarTextBoxWidget.cpp')
-rw-r--r-- | source/windowing/StarTextBoxWidget.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/windowing/StarTextBoxWidget.cpp b/source/windowing/StarTextBoxWidget.cpp index 634a006..e25e66a 100644 --- a/source/windowing/StarTextBoxWidget.cpp +++ b/source/windowing/StarTextBoxWidget.cpp @@ -168,6 +168,26 @@ 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 = cursorPosition; + if (m_cursorOffset < 0) + m_cursorOffset = 0; + if (m_cursorOffset > (int)m_text.size()) + m_cursorOffset = m_text.size(); +} + bool TextBoxWidget::getHidden() const { return m_textHidden; } |