implement line wrap for text messages

This commit is contained in:
Eduardo Bart
2012-01-24 22:50:30 -02:00
parent dd457b2b2f
commit 99ff5ce24c
8 changed files with 120 additions and 95 deletions

View File

@@ -434,6 +434,7 @@ protected:
public:
void resizeToText() { setSize(getTextSize()); }
void clearText() { setText(""); }
void wrapText();
void setText(const std::string& text);
void setTextAlign(Fw::AlignmentFlag align) { m_textAlign = align; m_textMustRecache = true; }

View File

@@ -84,6 +84,11 @@ void UIWidget::onFontChange(const std::string& font)
callLuaField("onFontChange", font);
}
void UIWidget::wrapText()
{
setText(m_font->wrapText(m_text, getWidth()));
}
void UIWidget::setText(const std::string& text)
{
if(m_text == text)