mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 01:11:12 +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 },
|
{ "new", CLuaInstance::CWindowNew },
|
||||||
{ "paint", CLuaInstance::CWindowPaint },
|
{ "paint", CLuaInstance::CWindowPaint },
|
||||||
{ "hide", CLuaInstance::CWindowHide },
|
{ "hide", CLuaInstance::CWindowHide },
|
||||||
|
{ "setCaption", CLuaInstance::CWindowSetCaption },
|
||||||
|
{ "paintHeader", CLuaInstance::CWindowPaintHeader },
|
||||||
{ "header_height", CLuaInstance::CWindowGetHeaderHeight },
|
{ "header_height", CLuaInstance::CWindowGetHeaderHeight },
|
||||||
{ "footer_height", CLuaInstance::CWindowGetFooterHeight },
|
{ "footer_height", CLuaInstance::CWindowGetFooterHeight },
|
||||||
{ "__gc", CLuaInstance::CWindowDelete },
|
{ "__gc", CLuaInstance::CWindowDelete },
|
||||||
@@ -1426,6 +1428,32 @@ int CLuaInstance::CWindowHide(lua_State *L)
|
|||||||
return 0;
|
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)
|
int CLuaInstance::CWindowGetHeaderHeight(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaCWindow *m = CWindowCheck(L, 1);
|
CLuaCWindow *m = CWindowCheck(L, 1);
|
||||||
|
@@ -202,6 +202,8 @@ private:
|
|||||||
static CLuaCWindow *CWindowCheck(lua_State *L, int n);
|
static CLuaCWindow *CWindowCheck(lua_State *L, int n);
|
||||||
static int CWindowPaint(lua_State *L);
|
static int CWindowPaint(lua_State *L);
|
||||||
static int CWindowHide(lua_State *L);
|
static int CWindowHide(lua_State *L);
|
||||||
|
static int CWindowSetCaption(lua_State *L);
|
||||||
|
static int CWindowPaintHeader(lua_State *L);
|
||||||
static int CWindowGetHeaderHeight(lua_State *L);
|
static int CWindowGetHeaderHeight(lua_State *L);
|
||||||
static int CWindowGetFooterHeight(lua_State *L);
|
static int CWindowGetFooterHeight(lua_State *L);
|
||||||
static int CWindowDelete(lua_State *L);
|
static int CWindowDelete(lua_State *L);
|
||||||
|
Reference in New Issue
Block a user