From e9a67335409ccc75a95cf1093bedb47abc17861a Mon Sep 17 00:00:00 2001 From: Vladimir Krasheninnikov Date: Sat, 1 Mar 2025 20:31:48 +0100 Subject: Bring new textbox callbacks --- source/windowing/StarTextBoxWidget.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source/windowing/StarTextBoxWidget.cpp') 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; } -- cgit v1.2.3