Added: setBackground lua method for group_html

--HG--
branch : compatibility-develop
hg/compatibility-develop
ulukyn 7 years ago
parent 0f02701326
commit ed6e38b1f4

@ -258,6 +258,7 @@ namespace NLGUI
int luaShowDiv(CLuaState &ls); int luaShowDiv(CLuaState &ls);
int luaParseHtml(CLuaState &ls); int luaParseHtml(CLuaState &ls);
int luaRenderHtml(CLuaState &ls); int luaRenderHtml(CLuaState &ls);
int luaSetBackground(CLuaState &ls);
REFLECT_EXPORT_START(CGroupHTML, CGroupScrollText) REFLECT_EXPORT_START(CGroupHTML, CGroupScrollText)
REFLECT_LUA_METHOD("browse", luaBrowse) REFLECT_LUA_METHOD("browse", luaBrowse)
@ -271,6 +272,7 @@ namespace NLGUI
REFLECT_LUA_METHOD("showDiv", luaShowDiv) REFLECT_LUA_METHOD("showDiv", luaShowDiv)
REFLECT_LUA_METHOD("parseHtml", luaParseHtml) REFLECT_LUA_METHOD("parseHtml", luaParseHtml)
REFLECT_LUA_METHOD("renderHtml", luaRenderHtml) REFLECT_LUA_METHOD("renderHtml", luaRenderHtml)
REFLECT_LUA_METHOD("setBackground", luaSetBackground)
REFLECT_STRING("url", getURL, setURL) REFLECT_STRING("url", getURL, setURL)
REFLECT_STRING("html", getHTML, setHTML) REFLECT_STRING("html", getHTML, setHTML)
REFLECT_FLOAT("timeout", getTimeout, setTimeout) REFLECT_FLOAT("timeout", getTimeout, setTimeout)

@ -5827,6 +5827,23 @@ namespace NLGUI
return 0; return 0;
} }
// ***************************************************************************
int CGroupHTML::luaSetBackground(CLuaState &ls)
{
const char *funcName = "renderHtml";
CLuaIHM::checkArgCount(ls, funcName, 3);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TBOOLEAN);
CLuaIHM::checkArgType(ls, funcName, 3, LUA_TBOOLEAN);
std::string image = ls.toString(1);
bool scale = ls.toBoolean(2);
bool repeat = ls.toBoolean(3);
setBackground(image, scale, repeat);
return 0;
}
// *************************************************************************** // ***************************************************************************
int CGroupHTML::luaInsertText(CLuaState &ls) int CGroupHTML::luaInsertText(CLuaState &ls)
{ {

Loading…
Cancel
Save