|
|
@ -99,6 +99,7 @@ namespace NLGUI
|
|
|
|
|
|
|
|
|
|
|
|
_AutoClamp = false;
|
|
|
|
_AutoClamp = false;
|
|
|
|
_ClampRight = true; // clamp on the right of the text
|
|
|
|
_ClampRight = true; // clamp on the right of the text
|
|
|
|
|
|
|
|
_OverflowText = "...";
|
|
|
|
|
|
|
|
|
|
|
|
_LetterColors = NULL;
|
|
|
|
_LetterColors = NULL;
|
|
|
|
_Setuped= false;
|
|
|
|
_Setuped= false;
|
|
|
@ -1880,12 +1881,15 @@ namespace NLGUI
|
|
|
|
_Lines.back()->clear(*TextContext);
|
|
|
|
_Lines.back()->clear(*TextContext);
|
|
|
|
_Lines.pop_back();
|
|
|
|
_Lines.pop_back();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_Lines.pop_back();
|
|
|
|
if (_OverflowText.size() > 0)
|
|
|
|
CViewText::CLine *endLine = new CViewText::CLine;
|
|
|
|
{
|
|
|
|
CViewText::CWord w;
|
|
|
|
_Lines.pop_back();
|
|
|
|
w.build(string("..."), *TextContext, _Scale);
|
|
|
|
CViewText::CLine *endLine = new CViewText::CLine;
|
|
|
|
endLine->addWord(w, _FontWidth);
|
|
|
|
CViewText::CWord w;
|
|
|
|
_Lines.push_back(TLineSPtr(endLine));
|
|
|
|
w.build(_OverflowText, *TextContext, _Scale);
|
|
|
|
|
|
|
|
endLine->addWord(w, _FontWidth);
|
|
|
|
|
|
|
|
_Lines.push_back(TLineSPtr(endLine));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Calculate size
|
|
|
|
// Calculate size
|
|
|
@ -1947,10 +1951,20 @@ namespace NLGUI
|
|
|
|
UTextContext::CStringInfo si;
|
|
|
|
UTextContext::CStringInfo si;
|
|
|
|
ucstring ucCurrentLine;
|
|
|
|
ucstring ucCurrentLine;
|
|
|
|
ucCurrentLine.reserve(_Text.size());
|
|
|
|
ucCurrentLine.reserve(_Text.size());
|
|
|
|
|
|
|
|
|
|
|
|
// Append ... to the end of line
|
|
|
|
// Append ... to the end of line
|
|
|
|
si = TextContext->getStringInfo (ucstring("..."));
|
|
|
|
float dotWidth;
|
|
|
|
float dotWidth= si.StringWidth / _Scale;
|
|
|
|
if (_OverflowText.size() > 0)
|
|
|
|
float rWidthCurrentLine = 0, rWidthLetter;
|
|
|
|
{
|
|
|
|
|
|
|
|
si = TextContext->getStringInfo (ucstring(_OverflowText));
|
|
|
|
|
|
|
|
dotWidth = si.StringWidth / _Scale;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dotWidth = 0.0f;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float rWidthCurrentLine = 0, rWidthLetter;
|
|
|
|
// for all the text
|
|
|
|
// for all the text
|
|
|
|
if (_ClampRight)
|
|
|
|
if (_ClampRight)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1974,7 +1988,10 @@ namespace NLGUI
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Add the dots
|
|
|
|
// Add the dots
|
|
|
|
ucCurrentLine+= "...";
|
|
|
|
if (_OverflowText.size() > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ucCurrentLine += _OverflowText;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1998,7 +2015,10 @@ namespace NLGUI
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Add the dots
|
|
|
|
// Add the dots
|
|
|
|
ucCurrentLine = "..." + ucCurrentLine;
|
|
|
|
if (_OverflowText.size() > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ucCurrentLine = _OverflowText + ucCurrentLine;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// And so setup this trunc text
|
|
|
|
// And so setup this trunc text
|
|
|
|