|
|
@ -62,6 +62,7 @@ namespace NLGUI
|
|
|
|
CWidgetManager::getInstance()->getSystemOption( CWidgetManager::OptionAddCoefFont ).getValSInt32();
|
|
|
|
CWidgetManager::getInstance()->getSystemOption( CWidgetManager::OptionAddCoefFont ).getValSInt32();
|
|
|
|
_Color = CRGBA(255,255,255,255);
|
|
|
|
_Color = CRGBA(255,255,255,255);
|
|
|
|
_Shadow = false;
|
|
|
|
_Shadow = false;
|
|
|
|
|
|
|
|
_ShadowOutline = false;
|
|
|
|
_ShadowColor = CRGBA(0,0,0,255);
|
|
|
|
_ShadowColor = CRGBA(0,0,0,255);
|
|
|
|
|
|
|
|
|
|
|
|
_MultiLine = false;
|
|
|
|
_MultiLine = false;
|
|
|
@ -111,7 +112,7 @@ namespace NLGUI
|
|
|
|
///constructor
|
|
|
|
///constructor
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
CViewText:: CViewText (const std::string& id, const std::string Text, sint FontSize,
|
|
|
|
CViewText:: CViewText (const std::string& id, const std::string Text, sint FontSize,
|
|
|
|
NLMISC::CRGBA Color, bool Shadow)
|
|
|
|
NLMISC::CRGBA Color, bool Shadow, bool ShadowOutline)
|
|
|
|
:CViewBase(TCtorParam())
|
|
|
|
:CViewBase(TCtorParam())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_Id = id;
|
|
|
|
_Id = id;
|
|
|
@ -120,6 +121,7 @@ namespace NLGUI
|
|
|
|
_FontSize = FontSize + CWidgetManager::getInstance()->getSystemOption( CWidgetManager::OptionAddCoefFont).getValSInt32();
|
|
|
|
_FontSize = FontSize + CWidgetManager::getInstance()->getSystemOption( CWidgetManager::OptionAddCoefFont).getValSInt32();
|
|
|
|
_Color = Color;
|
|
|
|
_Color = Color;
|
|
|
|
_Shadow = Shadow;
|
|
|
|
_Shadow = Shadow;
|
|
|
|
|
|
|
|
_ShadowOutline = ShadowOutline;
|
|
|
|
setText(Text);
|
|
|
|
setText(Text);
|
|
|
|
computeFontSize ();
|
|
|
|
computeFontSize ();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -159,6 +161,7 @@ namespace NLGUI
|
|
|
|
_FontSize = vt._FontSize;
|
|
|
|
_FontSize = vt._FontSize;
|
|
|
|
_Color = vt._Color;
|
|
|
|
_Color = vt._Color;
|
|
|
|
_Shadow = vt._Shadow;
|
|
|
|
_Shadow = vt._Shadow;
|
|
|
|
|
|
|
|
_ShadowOutline = vt._ShadowOutline;
|
|
|
|
_ShadowColor = vt._ShadowColor;
|
|
|
|
_ShadowColor = vt._ShadowColor;
|
|
|
|
|
|
|
|
|
|
|
|
_MultiLine = false;
|
|
|
|
_MultiLine = false;
|
|
|
@ -225,6 +228,11 @@ namespace NLGUI
|
|
|
|
return toString( _Shadow );
|
|
|
|
return toString( _Shadow );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
if( name == "shadow_outline" )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return toString( _ShadowOutline );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
if( name == "shadow_color" )
|
|
|
|
if( name == "shadow_color" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return toString( _ShadowColor );
|
|
|
|
return toString( _ShadowColor );
|
|
|
@ -360,6 +368,14 @@ namespace NLGUI
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
if( name == "shadow_outline" )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bool b;
|
|
|
|
|
|
|
|
if( fromString( value, b ) )
|
|
|
|
|
|
|
|
_ShadowOutline = b;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
if( name == "shadow_color" )
|
|
|
|
if( name == "shadow_color" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CRGBA c;
|
|
|
|
CRGBA c;
|
|
|
@ -520,6 +536,7 @@ namespace NLGUI
|
|
|
|
).c_str() );
|
|
|
|
).c_str() );
|
|
|
|
|
|
|
|
|
|
|
|
xmlSetProp( node, BAD_CAST "shadow", BAD_CAST toString( _Shadow ).c_str() );
|
|
|
|
xmlSetProp( node, BAD_CAST "shadow", BAD_CAST toString( _Shadow ).c_str() );
|
|
|
|
|
|
|
|
xmlSetProp( node, BAD_CAST "shadow_outline", BAD_CAST toString( _ShadowOutline ).c_str() );
|
|
|
|
xmlSetProp( node, BAD_CAST "shadow_color", BAD_CAST toString( _ShadowColor ).c_str() );
|
|
|
|
xmlSetProp( node, BAD_CAST "shadow_color", BAD_CAST toString( _ShadowColor ).c_str() );
|
|
|
|
xmlSetProp( node, BAD_CAST "multi_line", BAD_CAST toString( _MultiLine ).c_str() );
|
|
|
|
xmlSetProp( node, BAD_CAST "multi_line", BAD_CAST toString( _MultiLine ).c_str() );
|
|
|
|
|
|
|
|
|
|
|
@ -604,6 +621,11 @@ namespace NLGUI
|
|
|
|
if (prop)
|
|
|
|
if (prop)
|
|
|
|
_Shadow = convertBool(prop);
|
|
|
|
_Shadow = convertBool(prop);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
prop = (char*) xmlGetProp( cur, (xmlChar*)"shadow_outline" );
|
|
|
|
|
|
|
|
_ShadowOutline = false;
|
|
|
|
|
|
|
|
if (prop)
|
|
|
|
|
|
|
|
_ShadowOutline = convertBool(prop);
|
|
|
|
|
|
|
|
|
|
|
|
prop= (char*) xmlGetProp( cur, (xmlChar*)"shadow_color" );
|
|
|
|
prop= (char*) xmlGetProp( cur, (xmlChar*)"shadow_color" );
|
|
|
|
_ShadowColor = CRGBA(0,0,0,255);
|
|
|
|
_ShadowColor = CRGBA(0,0,0,255);
|
|
|
|
if (prop)
|
|
|
|
if (prop)
|
|
|
@ -864,6 +886,7 @@ namespace NLGUI
|
|
|
|
|
|
|
|
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
|
|
|
|
TextContext->setShadeOutline (_ShadowOutline);
|
|
|
|
TextContext->setShadeColor (shcol);
|
|
|
|
TextContext->setShadeColor (shcol);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
|
|
|
|
|
|
|
@ -978,6 +1001,7 @@ namespace NLGUI
|
|
|
|
|
|
|
|
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
|
|
|
|
TextContext->setShadeOutline (_ShadowOutline);
|
|
|
|
TextContext->setShadeColor (shcol);
|
|
|
|
TextContext->setShadeColor (shcol);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
|
|
|
|
|
|
|
@ -1146,6 +1170,14 @@ namespace NLGUI
|
|
|
|
invalidateContent();
|
|
|
|
invalidateContent();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
|
|
|
void CViewText::setShadowOutline (bool bShadowOutline)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_ShadowOutline = bShadowOutline;
|
|
|
|
|
|
|
|
computeFontSize ();
|
|
|
|
|
|
|
|
invalidateContent();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
void CViewText::setShadowColor(const NLMISC::CRGBA & color)
|
|
|
|
void CViewText::setShadowColor(const NLMISC::CRGBA & color)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1647,6 +1679,7 @@ namespace NLGUI
|
|
|
|
|
|
|
|
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
|
|
|
|
TextContext->setShadeOutline (_ShadowOutline);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
|
|
|
|
|
|
|
|
// default state
|
|
|
|
// default state
|
|
|
@ -1958,6 +1991,7 @@ namespace NLGUI
|
|
|
|
NL3D::UTextContext *TextContext = CViewRenderer::getTextContext();
|
|
|
|
NL3D::UTextContext *TextContext = CViewRenderer::getTextContext();
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
|
|
|
|
TextContext->setShadeOutline (_ShadowOutline);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
// CViewRenderer &rVR = *CViewRenderer::getInstance();
|
|
|
|
// CViewRenderer &rVR = *CViewRenderer::getInstance();
|
|
|
|
height = getFontHeight();
|
|
|
|
height = getFontHeight();
|
|
|
@ -2089,6 +2123,7 @@ namespace NLGUI
|
|
|
|
// setup the text context
|
|
|
|
// setup the text context
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
|
|
|
|
TextContext->setShadeOutline (_ShadowOutline);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
// find the line where the character is
|
|
|
|
// find the line where the character is
|
|
|
|
// CViewRenderer &rVR = *CViewRenderer::getInstance();
|
|
|
|
// CViewRenderer &rVR = *CViewRenderer::getInstance();
|
|
|
@ -2363,6 +2398,7 @@ namespace NLGUI
|
|
|
|
NL3D::UTextContext *TextContext = CViewRenderer::getTextContext();
|
|
|
|
NL3D::UTextContext *TextContext = CViewRenderer::getTextContext();
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
|
|
|
|
TextContext->setShadeOutline (_ShadowOutline);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
|
|
|
|
|
|
|
|
TCharPos linePos = 0;
|
|
|
|
TCharPos linePos = 0;
|
|
|
@ -2447,6 +2483,7 @@ namespace NLGUI
|
|
|
|
NL3D::UTextContext *TextContext = CViewRenderer::getTextContext();
|
|
|
|
NL3D::UTextContext *TextContext = CViewRenderer::getTextContext();
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
|
|
|
|
TextContext->setShadeOutline (_ShadowOutline);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
|
|
|
|
|
|
|
|
// Current position in text
|
|
|
|
// Current position in text
|
|
|
@ -2498,12 +2535,13 @@ namespace NLGUI
|
|
|
|
NL3D::UTextContext *TextContext = CViewRenderer::getTextContext();
|
|
|
|
NL3D::UTextContext *TextContext = CViewRenderer::getTextContext();
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setHotSpot (UTextContext::BottomLeft);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
TextContext->setShaded (_Shadow);
|
|
|
|
|
|
|
|
TextContext->setShadeOutline (_ShadowOutline);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
TextContext->setFontSize (_FontSize);
|
|
|
|
|
|
|
|
|
|
|
|
// Letter size
|
|
|
|
// Letter size
|
|
|
|
UTextContext::CStringInfo si = TextContext->getStringInfo(ucstring("|")); // for now we can't now that directly from UTextContext
|
|
|
|
UTextContext::CStringInfo si = TextContext->getStringInfo(ucstring("|")); // for now we can't now that directly from UTextContext
|
|
|
|
_FontHeight = (uint) si.StringHeight + (_Shadow?1:0);
|
|
|
|
_FontHeight = (uint) si.StringHeight + (_Shadow?(_ShadowOutline?2:1):0);
|
|
|
|
_FontLegHeight = (uint) si.StringLine + (_Shadow?1:0);
|
|
|
|
_FontLegHeight = (uint) si.StringLine + (_Shadow?(_ShadowOutline?2:1):0);
|
|
|
|
|
|
|
|
|
|
|
|
// Space width
|
|
|
|
// Space width
|
|
|
|
si = TextContext->getStringInfo(ucstring(" "));
|
|
|
|
si = TextContext->getStringInfo(ucstring(" "));
|
|
|
@ -2960,6 +2998,7 @@ namespace NLGUI
|
|
|
|
f.serial(_SpaceWidth);
|
|
|
|
f.serial(_SpaceWidth);
|
|
|
|
f.serial(_Color);
|
|
|
|
f.serial(_Color);
|
|
|
|
f.serial(_Shadow);
|
|
|
|
f.serial(_Shadow);
|
|
|
|
|
|
|
|
f.serial(_ShadowOutline);
|
|
|
|
f.serialEnum(_CaseMode);
|
|
|
|
f.serialEnum(_CaseMode);
|
|
|
|
f.serial(_ShadowColor);
|
|
|
|
f.serial(_ShadowColor);
|
|
|
|
f.serial(_LineMaxW);
|
|
|
|
f.serial(_LineMaxW);
|
|
|
|