SDK/TextAreaWidget: Make Write public
This commit is contained in:
@@ -82,6 +82,25 @@ namespace Ndk
|
||||
m_textSprite->Update(m_drawer);
|
||||
}
|
||||
|
||||
void TextAreaWidget::Write(const Nz::String& text)
|
||||
{
|
||||
if (m_cursorPosition >= m_drawer.GetGlyphCount())
|
||||
{
|
||||
AppendText(text);
|
||||
m_cursorPosition = m_drawer.GetGlyphCount();
|
||||
}
|
||||
else
|
||||
{
|
||||
Nz::String currentText = m_drawer.GetText();
|
||||
currentText.Insert(currentText.GetCharacterPosition(m_cursorPosition), text);
|
||||
SetText(currentText);
|
||||
|
||||
m_cursorPosition += text.GetLength();
|
||||
}
|
||||
|
||||
RefreshCursor();
|
||||
}
|
||||
|
||||
void TextAreaWidget::RefreshCursor()
|
||||
{
|
||||
std::size_t lineCount = m_drawer.GetLineCount();
|
||||
@@ -219,23 +238,4 @@ namespace Ndk
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TextAreaWidget::Write(const Nz::String& text)
|
||||
{
|
||||
if (m_cursorPosition >= m_drawer.GetGlyphCount())
|
||||
{
|
||||
AppendText(text);
|
||||
m_cursorPosition = m_drawer.GetGlyphCount();
|
||||
}
|
||||
else
|
||||
{
|
||||
Nz::String currentText = m_drawer.GetText();
|
||||
currentText.Insert(currentText.GetCharacterPosition(m_cursorPosition), text);
|
||||
SetText(currentText);
|
||||
|
||||
m_cursorPosition += text.GetLength();
|
||||
}
|
||||
|
||||
RefreshCursor();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user