Sdk/TextAreaWidget: Add SetTextColor
This commit is contained in:
parent
fd923ed58b
commit
14e327c603
|
|
@ -35,6 +35,7 @@ namespace Ndk
|
||||||
inline std::size_t GetCursorPosition() const;
|
inline std::size_t GetCursorPosition() const;
|
||||||
inline std::size_t GetLineCount() const;
|
inline std::size_t GetLineCount() const;
|
||||||
inline const Nz::String& GetText() const;
|
inline const Nz::String& GetText() const;
|
||||||
|
inline const Nz::Color& GetTextColor() const;
|
||||||
|
|
||||||
std::size_t GetHoveredGlyph(float x, float y) const;
|
std::size_t GetHoveredGlyph(float x, float y) const;
|
||||||
|
|
||||||
|
|
@ -47,7 +48,8 @@ namespace Ndk
|
||||||
|
|
||||||
inline void SetCursorPosition(std::size_t cursorPosition);
|
inline void SetCursorPosition(std::size_t cursorPosition);
|
||||||
inline void SetReadOnly(bool readOnly = true);
|
inline void SetReadOnly(bool readOnly = true);
|
||||||
void SetText(const Nz::String& text);
|
inline void SetText(const Nz::String& text);
|
||||||
|
inline void SetTextColor(const Nz::Color& text);
|
||||||
|
|
||||||
void Write(const Nz::String& text);
|
void Write(const Nz::String& text);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,11 @@ namespace Ndk
|
||||||
return m_drawer.GetText();
|
return m_drawer.GetText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline const Nz::Color& TextAreaWidget::GetTextColor() const
|
||||||
|
{
|
||||||
|
return m_drawer.GetColor();
|
||||||
|
}
|
||||||
|
|
||||||
inline bool Ndk::TextAreaWidget::IsMultilineEnabled() const
|
inline bool Ndk::TextAreaWidget::IsMultilineEnabled() const
|
||||||
{
|
{
|
||||||
return m_multiLineEnabled;
|
return m_multiLineEnabled;
|
||||||
|
|
@ -72,4 +77,18 @@ namespace Ndk
|
||||||
|
|
||||||
m_cursorEntity->Enable(!m_readOnly);
|
m_cursorEntity->Enable(!m_readOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void TextAreaWidget::SetText(const Nz::String& text)
|
||||||
|
{
|
||||||
|
m_drawer.SetText(text);
|
||||||
|
|
||||||
|
m_textSprite->Update(m_drawer);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void TextAreaWidget::SetTextColor(const Nz::Color& text)
|
||||||
|
{
|
||||||
|
m_drawer.SetColor(text);
|
||||||
|
|
||||||
|
m_textSprite->Update(m_drawer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,13 +77,6 @@ namespace Ndk
|
||||||
SetContentSize(Nz::Vector2f(m_textSprite->GetBoundingVolume().obb.localBox.GetLengths()));
|
SetContentSize(Nz::Vector2f(m_textSprite->GetBoundingVolume().obb.localBox.GetLengths()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextAreaWidget::SetText(const Nz::String& text)
|
|
||||||
{
|
|
||||||
m_drawer.SetText(text);
|
|
||||||
|
|
||||||
m_textSprite->Update(m_drawer);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TextAreaWidget::Write(const Nz::String& text)
|
void TextAreaWidget::Write(const Nz::String& text)
|
||||||
{
|
{
|
||||||
if (m_cursorPosition >= m_drawer.GetGlyphCount())
|
if (m_cursorPosition >= m_drawer.GetGlyphCount())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue