Widgets/TextAreaWidget: Add a way to limit text length

This commit is contained in:
SirLynix
2024-01-26 16:15:53 +01:00
parent f10671ac2a
commit c931e9a509
7 changed files with 92 additions and 9 deletions

View File

@@ -22,7 +22,7 @@ namespace Nz
AbstractTextAreaWidget::AbstractTextAreaWidget(BaseWidget* parent) :
BaseWidget(parent),
m_characterFilter(),
m_maximumTextLength(0),
m_echoMode(EchoMode::Normal),
m_cursorPositionBegin(0U, 0U),
m_cursorPositionEnd(0U, 0U),
@@ -120,6 +120,11 @@ namespace Nz
return Vector2ui::Zero();
}
void AbstractTextAreaWidget::SetMaximumTextLength(std::size_t maximumLength)
{
m_maximumTextLength = maximumLength;
}
Color AbstractTextAreaWidget::GetCursorColor() const
{
if (m_cursorPositionBegin == m_cursorPositionEnd)