CLuaInstance: Add footer_height function

This commit is contained in:
M. Liebmann
2014-03-02 07:27:43 +01:00
parent 4b5242c254
commit 3fa31ef441
2 changed files with 16 additions and 0 deletions

View File

@@ -1293,6 +1293,7 @@ void CLuaInstance::CWindowRegister(lua_State *L)
{ "paint", CLuaInstance::CWindowPaint }, { "paint", CLuaInstance::CWindowPaint },
{ "hide", CLuaInstance::CWindowHide }, { "hide", CLuaInstance::CWindowHide },
{ "header_height", CLuaInstance::CWindowGetHeaderHeight }, { "header_height", CLuaInstance::CWindowGetHeaderHeight },
{ "footer_height", CLuaInstance::CWindowGetFooterHeight },
{ "__gc", CLuaInstance::CWindowDelete }, { "__gc", CLuaInstance::CWindowDelete },
{ NULL, NULL } { NULL, NULL }
}; };
@@ -1415,6 +1416,20 @@ int CLuaInstance::CWindowGetHeaderHeight(lua_State *L)
return 1; return 1;
} }
int CLuaInstance::CWindowGetFooterHeight(lua_State *L)
{
CLuaCWindow *m = CWindowCheck(L, 1);
if (!m)
return 0;
CComponentsFooter* footer = m->w->getFooterObject();
int fh = 0;
if (footer)
fh = footer->getHeight();
lua_pushinteger(L, fh);
return 1;
}
int CLuaInstance::CWindowDelete(lua_State *L) int CLuaInstance::CWindowDelete(lua_State *L)
{ {
CLuaCWindow *m = CWindowCheck(L, 1); CLuaCWindow *m = CWindowCheck(L, 1);

View File

@@ -199,6 +199,7 @@ private:
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 CWindowGetHeaderHeight(lua_State *L); static int CWindowGetHeaderHeight(lua_State *L);
static int CWindowGetFooterHeight(lua_State *L);
static int CWindowDelete(lua_State *L); static int CWindowDelete(lua_State *L);
static CLuaSignalBox *SignalBoxCheck(lua_State *L, int n); static CLuaSignalBox *SignalBoxCheck(lua_State *L, int n);