|
|
|
@ -318,10 +318,10 @@ namespace NLGUI
|
|
|
|
|
sint32 height = style.Height;
|
|
|
|
|
sint32 maxw = style.MaxWidth;
|
|
|
|
|
sint32 maxh = style.MaxHeight;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sint32 imageWidth, imageHeight;
|
|
|
|
|
bool changed = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// get image texture size
|
|
|
|
|
// if image is being downloaded, then correct size is set after thats done
|
|
|
|
|
CCtrlButton *btn = dynamic_cast<CCtrlButton*>(view);
|
|
|
|
@ -346,14 +346,14 @@ namespace NLGUI
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if width/height is not requested, then use image size
|
|
|
|
|
// else recalculate missing value, keep image ratio
|
|
|
|
|
if (width == -1 && height == -1)
|
|
|
|
|
{
|
|
|
|
|
width = imageWidth;
|
|
|
|
|
height = imageHeight;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
changed = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -364,7 +364,7 @@ namespace NLGUI
|
|
|
|
|
else
|
|
|
|
|
height = width / ratio;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// apply max-width, max-height rules if asked
|
|
|
|
|
if (maxw > -1 || maxh > -1)
|
|
|
|
|
{
|
|
|
|
@ -1555,12 +1555,12 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "error_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return toString( ErrorColorGlobalColor );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "link_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return toString( LinkColorGlobalColor );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -1570,67 +1570,67 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h1_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return toString( H1ColorGlobalColor );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h2_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return toString( H2ColorGlobalColor );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h3_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return toString( H3ColorGlobalColor );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h4_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return toString( H4ColorGlobalColor );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h5_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return toString( H5ColorGlobalColor );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h6_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return toString( H6ColorGlobalColor );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "text_font_size" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return toString( TextFontSize );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h1_font_size" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return toString( H1FontSize );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h2_font_size" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return toString( H2FontSize );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h3_font_size" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return toString( H3FontSize );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h4_font_size" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return toString( H4FontSize );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h5_font_size" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return toString( H5FontSize );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h6_font_size" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return toString( H6FontSize );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -1839,7 +1839,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "error_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
bool b;
|
|
|
|
|
if( fromString( value, b ) )
|
|
|
|
|
ErrorColorGlobalColor = b;
|
|
|
|
@ -1847,7 +1847,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "link_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
bool b;
|
|
|
|
|
if( fromString( value, b ) )
|
|
|
|
|
LinkColorGlobalColor = b;
|
|
|
|
@ -1863,7 +1863,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h1_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
bool b;
|
|
|
|
|
if( fromString( value, b ) )
|
|
|
|
|
H1ColorGlobalColor = b;
|
|
|
|
@ -1871,7 +1871,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h2_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
bool b;
|
|
|
|
|
if( fromString( value, b ) )
|
|
|
|
|
H2ColorGlobalColor = b;
|
|
|
|
@ -1879,7 +1879,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h3_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
bool b;
|
|
|
|
|
if( fromString( value, b ) )
|
|
|
|
|
H3ColorGlobalColor = b;
|
|
|
|
@ -1887,7 +1887,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h4_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
bool b;
|
|
|
|
|
if( fromString( value, b ) )
|
|
|
|
|
H4ColorGlobalColor = b;
|
|
|
|
@ -1895,7 +1895,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h5_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
bool b;
|
|
|
|
|
if( fromString( value, b ) )
|
|
|
|
|
H5ColorGlobalColor = b;
|
|
|
|
@ -1903,7 +1903,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h6_color_global_color" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
bool b;
|
|
|
|
|
if( fromString( value, b ) )
|
|
|
|
|
H6ColorGlobalColor = b;
|
|
|
|
@ -1911,7 +1911,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "text_font_size" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
uint i;
|
|
|
|
|
if( fromString( value, i ) )
|
|
|
|
|
TextFontSize = i;
|
|
|
|
@ -1919,7 +1919,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h1_font_size" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
uint i;
|
|
|
|
|
if( fromString( value, i ) )
|
|
|
|
|
H1FontSize = i;
|
|
|
|
@ -1927,7 +1927,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h2_font_size" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
uint i;
|
|
|
|
|
if( fromString( value, i ) )
|
|
|
|
|
H2FontSize = i;
|
|
|
|
@ -1935,7 +1935,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h3_font_size" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
uint i;
|
|
|
|
|
if( fromString( value, i ) )
|
|
|
|
|
H3FontSize = i;
|
|
|
|
@ -1943,7 +1943,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h4_font_size" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
uint i;
|
|
|
|
|
if( fromString( value, i ) )
|
|
|
|
|
H4FontSize = i;
|
|
|
|
@ -1951,7 +1951,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h5_font_size" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
uint i;
|
|
|
|
|
if( fromString( value, i ) )
|
|
|
|
|
H5FontSize = i;
|
|
|
|
@ -1959,7 +1959,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( name == "h6_font_size" )
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
uint i;
|
|
|
|
|
if( fromString( value, i ) )
|
|
|
|
|
H6FontSize = i;
|
|
|
|
@ -2144,7 +2144,7 @@ namespace NLGUI
|
|
|
|
|
xmlSetProp( node, BAD_CAST "h4_color", BAD_CAST toString( H4Color ).c_str() );
|
|
|
|
|
xmlSetProp( node, BAD_CAST "h5_color", BAD_CAST toString( H5Color ).c_str() );
|
|
|
|
|
xmlSetProp( node, BAD_CAST "h6_color", BAD_CAST toString( H6Color ).c_str() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xmlSetProp( node, BAD_CAST "error_color_global_color",
|
|
|
|
|
BAD_CAST toString( ErrorColorGlobalColor ).c_str() );
|
|
|
|
|
xmlSetProp( node, BAD_CAST "link_color_global_color",
|
|
|
|
@ -2781,7 +2781,7 @@ namespace NLGUI
|
|
|
|
|
getParagraph()->addChild (buttonGroup);
|
|
|
|
|
paragraphChange ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -4529,14 +4529,14 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
int CGroupHTML::luaInsertText(CLuaState &ls)
|
|
|
|
|
int CGroupHTML::luaInsertText(CLuaState &ls)
|
|
|
|
|
{
|
|
|
|
|
const char *funcName = "insertText";
|
|
|
|
|
CLuaIHM::checkArgCount(ls, funcName, 3);
|
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
|
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING);
|
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 3, LUA_TBOOLEAN);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string name = ls.toString(1);
|
|
|
|
|
|
|
|
|
|
ucstring text;
|
|
|
|
@ -4639,6 +4639,11 @@ namespace NLGUI
|
|
|
|
|
renderHtmlString(html);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CGroupHTML::setHome(const std::string &home)
|
|
|
|
|
{
|
|
|
|
|
Home = home;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
void CGroupHTML::parseStylesheetFile(const std::string &fname)
|
|
|
|
|
{
|
|
|
|
@ -4940,7 +4945,7 @@ namespace NLGUI
|
|
|
|
|
css += "progress::-webkit-progress-value { background-color: rgb(0, 100, 180);}";
|
|
|
|
|
_Style.parseStylesheet(css);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
std::string CGroupHTML::HTMLOListElement::getListMarkerText() const
|
|
|
|
|
{
|
|
|
|
|