Sdk/TextAreaWidget: Add signals (allowing for controlling the cursor/keys)

This commit is contained in:
Lynix
2017-01-18 23:38:29 +01:00
parent 5d39d60f94
commit ec795269ad
3 changed files with 65 additions and 2 deletions

View File

@@ -66,6 +66,8 @@ namespace Ndk
inline void TextAreaWidget::SetCursorPosition(std::size_t cursorPosition)
{
OnTextAreaCursorMove(this, &cursorPosition);
m_cursorPosition = std::min(cursorPosition, m_drawer.GetGlyphCount());
RefreshCursor();
@@ -83,6 +85,8 @@ namespace Ndk
m_drawer.SetText(text);
m_textSprite->Update(m_drawer);
SetCursorPosition(m_cursorPosition); //< Refresh cursor position (prevent it from being outside of the text)
}
inline void TextAreaWidget::SetTextColor(const Nz::Color& text)