diff --git a/src/framework/ui/uiwidget.h b/src/framework/ui/uiwidget.h index c0228faa..72ca2c21 100644 --- a/src/framework/ui/uiwidget.h +++ b/src/framework/ui/uiwidget.h @@ -492,7 +492,7 @@ public: void resizeToText() { setSize(getTextSize()); } void clearText() { setText(""); } - void setText(std::string text, bool fireLuaCall = true); + void setText(std::string text, bool dontFireLuaCall = false); void setTextAlign(Fw::AlignmentFlag align) { m_textAlign = align; updateText(); } void setTextOffset(const Point& offset) { m_textOffset = offset; updateText(); } void setTextWrap(bool textWrap) { m_textWrap = textWrap; updateText(); } diff --git a/src/framework/ui/uiwidgettext.cpp b/src/framework/ui/uiwidgettext.cpp index b9569323..e0ad18c0 100644 --- a/src/framework/ui/uiwidgettext.cpp +++ b/src/framework/ui/uiwidgettext.cpp @@ -112,7 +112,7 @@ void UIWidget::onFontChange(const std::string& font) callLuaField("onFontChange", font); } -void UIWidget::setText(std::string text, bool fireLuaCall) +void UIWidget::setText(std::string text, bool dontFireLuaCall) { if(m_textOnlyUpperCase) stdext::toupper(text); @@ -126,7 +126,7 @@ void UIWidget::setText(std::string text, bool fireLuaCall) text = m_text; - if(fireLuaCall) { + if(!dontFireLuaCall) { onTextChange(text, oldText); } }