Exemple #1
0
//------------------------------------------------------------------------
void CTextLabel::drawStyleChanged ()
{
	if (textTruncateMode != kTruncateNone)
	{
		calculateTruncatedText ();
	}
	CParamDisplay::drawStyleChanged ();
}
Exemple #2
0
//------------------------------------------------------------------------
void CTextLabel::setTextTruncateMode (TextTruncateMode mode)
{
	if (textTruncateMode != mode)
	{
		textTruncateMode = mode;
		calculateTruncatedText ();
	}
}
Exemple #3
0
//------------------------------------------------------------------------
void CTextLabel::setViewSize (const CRect& rect, bool invalid)
{
	CRect current (getViewSize ());
	CParamDisplay::setViewSize (rect, invalid);
	if (textTruncateMode != kTruncateNone && current.getWidth () != getWidth ())
	{
		calculateTruncatedText ();
	}
}
Exemple #4
0
//------------------------------------------------------------------------
void CTextLabel::setText (UTF8StringPtr txt)
{
	if (txt && UTF8StringView (txt) == text)
		return;
	text = txt;
	if (textTruncateMode != kTruncateNone)
		calculateTruncatedText ();
	setDirty (true);
}
Exemple #5
0
//------------------------------------------------------------------------
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);
}