mirror of
https://github.com/edubart/otclient.git
synced 2025-11-30 23:26:51 +01:00
Fix to setText method.
This commit is contained in:
@@ -492,7 +492,7 @@ public:
|
|||||||
void resizeToText() { setSize(getTextSize()); }
|
void resizeToText() { setSize(getTextSize()); }
|
||||||
void clearText() { setText(""); }
|
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 setTextAlign(Fw::AlignmentFlag align) { m_textAlign = align; updateText(); }
|
||||||
void setTextOffset(const Point& offset) { m_textOffset = offset; updateText(); }
|
void setTextOffset(const Point& offset) { m_textOffset = offset; updateText(); }
|
||||||
void setTextWrap(bool textWrap) { m_textWrap = textWrap; updateText(); }
|
void setTextWrap(bool textWrap) { m_textWrap = textWrap; updateText(); }
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ void UIWidget::onFontChange(const std::string& font)
|
|||||||
callLuaField("onFontChange", font);
|
callLuaField("onFontChange", font);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UIWidget::setText(std::string text, bool fireLuaCall)
|
void UIWidget::setText(std::string text, bool dontFireLuaCall)
|
||||||
{
|
{
|
||||||
if(m_textOnlyUpperCase)
|
if(m_textOnlyUpperCase)
|
||||||
stdext::toupper(text);
|
stdext::toupper(text);
|
||||||
@@ -126,7 +126,7 @@ void UIWidget::setText(std::string text, bool fireLuaCall)
|
|||||||
|
|
||||||
text = m_text;
|
text = m_text;
|
||||||
|
|
||||||
if(fireLuaCall) {
|
if(!dontFireLuaCall) {
|
||||||
onTextChange(text, oldText);
|
onTextChange(text, oldText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user