From 79edd0f657d1b6d4dc9cae11491d8c1d7475be23 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 17 Sep 2014 20:46:43 +0200 Subject: [PATCH] luainstance/cwindow: Add funktion setWindowColor Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/57ffa12e6b80845f052b3025645ca4992029f99e Author: Michael Liebmann Date: 2014-09-17 (Wed, 17 Sep 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/luainstance.cpp | 24 ++++++++++++++++++++++++ src/gui/luainstance.h | 1 + 2 files changed, 25 insertions(+) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 3066a6b04..95a0d2ba0 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -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); diff --git a/src/gui/luainstance.h b/src/gui/luainstance.h index 1da6f5c12..8c926c4e7 100644 --- a/src/gui/luainstance.h +++ b/src/gui/luainstance.h @@ -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);