mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-10 09:19:01 +00:00
Added: Lua function to render html string as new webpage
This commit is contained in:
parent
eff3820130
commit
5198501b82
2 changed files with 15 additions and 0 deletions
|
@ -253,6 +253,7 @@ namespace NLGUI
|
|||
int luaEndElement(CLuaState &ls);
|
||||
int luaShowDiv(CLuaState &ls);
|
||||
int luaParseHtml(CLuaState &ls);
|
||||
int luaRenderHtml(CLuaState &ls);
|
||||
|
||||
REFLECT_EXPORT_START(CGroupHTML, CGroupScrollText)
|
||||
REFLECT_LUA_METHOD("browse", luaBrowse)
|
||||
|
@ -265,6 +266,7 @@ namespace NLGUI
|
|||
REFLECT_LUA_METHOD("endElement", luaEndElement)
|
||||
REFLECT_LUA_METHOD("showDiv", luaShowDiv)
|
||||
REFLECT_LUA_METHOD("parseHtml", luaParseHtml)
|
||||
REFLECT_LUA_METHOD("renderHtml", luaRenderHtml)
|
||||
REFLECT_STRING("url", getURL, setURL)
|
||||
REFLECT_FLOAT("timeout", getTimeout, setTimeout)
|
||||
REFLECT_EXPORT_END
|
||||
|
|
|
@ -5500,6 +5500,19 @@ namespace NLGUI
|
|||
return 0;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
int CGroupHTML::luaRenderHtml(CLuaState &ls)
|
||||
{
|
||||
const char *funcName = "renderHtml";
|
||||
CLuaIHM::checkArgCount(ls, funcName, 1);
|
||||
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
|
||||
std::string html = ls.toString(1);
|
||||
|
||||
renderHtmlString(html);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
int CGroupHTML::luaInsertText(CLuaState &ls)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue