Added: setBackground lua method for group_html

--HG--
branch : patches-from-atys
hg/hotfix/patches-from-atys
ulukyn 7 years ago
parent 5c41e79ce0
commit fd458d5751

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

@ -4509,6 +4509,23 @@ namespace NLGUI
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)
{

Loading…
Cancel
Save