From 3fa31ef44199ccef03bf46a86569af2e7339eb2e Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Sun, 2 Mar 2014 07:27:43 +0100 Subject: [PATCH] CLuaInstance: Add footer_height function --- src/gui/luainstance.cpp | 15 +++++++++++++++ src/gui/luainstance.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index f2891d96f..0b1dd8cb7 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -1293,6 +1293,7 @@ void CLuaInstance::CWindowRegister(lua_State *L) { "paint", CLuaInstance::CWindowPaint }, { "hide", CLuaInstance::CWindowHide }, { "header_height", CLuaInstance::CWindowGetHeaderHeight }, + { "footer_height", CLuaInstance::CWindowGetFooterHeight }, { "__gc", CLuaInstance::CWindowDelete }, { NULL, NULL } }; @@ -1415,6 +1416,20 @@ int CLuaInstance::CWindowGetHeaderHeight(lua_State *L) 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) { CLuaCWindow *m = CWindowCheck(L, 1); diff --git a/src/gui/luainstance.h b/src/gui/luainstance.h index 093fda100..7e5c31e51 100644 --- a/src/gui/luainstance.h +++ b/src/gui/luainstance.h @@ -199,6 +199,7 @@ private: static int CWindowPaint(lua_State *L); static int CWindowHide(lua_State *L); static int CWindowGetHeaderHeight(lua_State *L); + static int CWindowGetFooterHeight(lua_State *L); static int CWindowDelete(lua_State *L); static CLuaSignalBox *SignalBoxCheck(lua_State *L, int n);