mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
CLuaInstance: Add setCaption & paintHeader function to cwindow
This commit is contained in:
@@ -1316,6 +1316,8 @@ void CLuaInstance::CWindowRegister(lua_State *L)
|
||||
{ "new", CLuaInstance::CWindowNew },
|
||||
{ "paint", CLuaInstance::CWindowPaint },
|
||||
{ "hide", CLuaInstance::CWindowHide },
|
||||
{ "setCaption", CLuaInstance::CWindowSetCaption },
|
||||
{ "paintHeader", CLuaInstance::CWindowPaintHeader },
|
||||
{ "header_height", CLuaInstance::CWindowGetHeaderHeight },
|
||||
{ "footer_height", CLuaInstance::CWindowGetFooterHeight },
|
||||
{ "__gc", CLuaInstance::CWindowDelete },
|
||||
@@ -1426,6 +1428,32 @@ int CLuaInstance::CWindowHide(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CLuaInstance::CWindowSetCaption(lua_State *L)
|
||||
{
|
||||
lua_assert(lua_istable(L,1));
|
||||
CLuaCWindow *m = CWindowCheck(L, 1);
|
||||
if (!m) return 0;
|
||||
|
||||
std::string name = "";
|
||||
tableLookup(L, "name", name) || tableLookup(L, "title", name) || tableLookup(L, "caption", name);
|
||||
|
||||
m->w->setWindowCaption(name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CLuaInstance::CWindowPaintHeader(lua_State *L)
|
||||
{
|
||||
CLuaCWindow *m = CWindowCheck(L, 1);
|
||||
if (!m) return 0;
|
||||
|
||||
CComponentsHeader* header = m->w->getHeaderObject();
|
||||
if (header)
|
||||
m->w->showHeader();
|
||||
header->paint();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CLuaInstance::CWindowGetHeaderHeight(lua_State *L)
|
||||
{
|
||||
CLuaCWindow *m = CWindowCheck(L, 1);
|
||||
|
Reference in New Issue
Block a user