//------------------------------------------------------------------------ void CTextLabel::drawStyleChanged () { if (textTruncateMode != kTruncateNone) { calculateTruncatedText (); } CParamDisplay::drawStyleChanged (); }
//------------------------------------------------------------------------ void CTextLabel::setTextTruncateMode (TextTruncateMode mode) { if (textTruncateMode != mode) { textTruncateMode = mode; calculateTruncatedText (); } }
//------------------------------------------------------------------------ void CTextLabel::setViewSize (const CRect& rect, bool invalid) { CRect current (getViewSize ()); CParamDisplay::setViewSize (rect, invalid); if (textTruncateMode != kTruncateNone && current.getWidth () != getWidth ()) { calculateTruncatedText (); } }
//------------------------------------------------------------------------ void CTextLabel::setText (UTF8StringPtr txt) { if (txt && UTF8StringView (txt) == text) return; text = txt; if (textTruncateMode != kTruncateNone) calculateTruncatedText (); setDirty (true); }
//------------------------------------------------------------------------ void CTextLabel::setText (UTF8StringPtr txt) { if (text && txt && strcmp (text, txt) == 0) return; freeText (); if (txt) { text = (UTF8StringBuffer)malloc (strlen (txt)+1); strcpy (text, txt); } else { text = (UTF8StringBuffer)malloc (1); text[0] = 0; } if (textTruncateMode != kTruncateNone) calculateTruncatedText (); setDirty (true); }