luainstance/cwindow: Add funktion setWindowColor

This commit is contained in:
M. Liebmann
2014-09-17 20:46:43 +02:00
parent 7c5ab40468
commit 57ffa12e6b
2 changed files with 25 additions and 0 deletions

View File

@@ -1634,6 +1634,7 @@ void CLuaInstance::CWindowRegister(lua_State *L)
{ "paint", CLuaInstance::CWindowPaint },
{ "hide", CLuaInstance::CWindowHide },
{ "setCaption", CLuaInstance::CWindowSetCaption },
{ "setWindowColor", CLuaInstance::CWindowSetWindowColor },
{ "paintHeader", CLuaInstance::CWindowPaintHeader },
{ "headerHeight", CLuaInstance::CWindowGetHeaderHeight },
{ "footerHeight", CLuaInstance::CWindowGetFooterHeight },
@@ -1801,6 +1802,29 @@ int CLuaInstance::CWindowSetCaption(lua_State *L)
return 0;
}
int CLuaInstance::CWindowSetWindowColor(lua_State *L)
{
lua_assert(lua_istable(L,1));
CLuaCWindow *m = CWindowCheck(L, 1);
if (!m) return 0;
lua_Unsigned color;
if (tableLookup(L, "color_frame" , color)) {
checkMagicMask(color);
m->w->setColorFrame(color);
}
if (tableLookup(L, "color_body" , color)) {
checkMagicMask(color);
m->w->setColorBody(color);
}
if (tableLookup(L, "color_shadow" , color)) {
checkMagicMask(color);
m->w->setColorShadow(color);
}
return 0;
}
int CLuaInstance::CWindowPaintHeader(lua_State *L)
{
CLuaCWindow *m = CWindowCheck(L, 1);

View File

@@ -239,6 +239,7 @@ private:
static int CWindowPaint(lua_State *L);
static int CWindowHide(lua_State *L);
static int CWindowSetCaption(lua_State *L);
static int CWindowSetWindowColor(lua_State *L);
static int CWindowPaintHeader(lua_State *L);
static int CWindowGetHeaderHeight(lua_State *L);
static int CWindowGetFooterHeight(lua_State *L);