From a5e4d2be50ad50f639b7aabc6de7c115c435830e Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 2 Jan 2016 23:03:00 +0000 Subject: MirLua: - fixed m_schedule - massive function replace git-svn-id: http://svn.miranda-ng.org/main/trunk@16004 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_toptoolbar.cpp | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'plugins/MirLua/src/m_toptoolbar.cpp') diff --git a/plugins/MirLua/src/m_toptoolbar.cpp b/plugins/MirLua/src/m_toptoolbar.cpp index f53f728774..310243e734 100644 --- a/plugins/MirLua/src/m_toptoolbar.cpp +++ b/plugins/MirLua/src/m_toptoolbar.cpp @@ -17,60 +17,49 @@ static TTBButton* MakeTBButton(lua_State *L) TTBButton *tbb = (TTBButton*)mir_calloc(sizeof(TTBButton)); tbb->dwFlags = TTBBF_ISLBUTTON; - lua_pushliteral(L, "Name"); - lua_gettable(L, -2); + lua_getfield(L, -1, "Name"); tbb->name = mir_utf8decodeA(luaL_checkstring(L, -1)); lua_pop(L, 1); - lua_pushliteral(L, "Service"); - lua_gettable(L, -2); + lua_getfield(L, -1, "Service"); tbb->pszService = (char*)lua_tostring(L, -1); lua_pop(L, 1); - lua_pushliteral(L, "Flags"); - lua_gettable(L, -2); + lua_getfield(L, -1, "Flags"); tbb->dwFlags = lua_tointeger(L, -1); lua_pop(L, 1); // up state - lua_pushliteral(L, "IconUp"); - lua_gettable(L, -2); + lua_getfield(L, -1, "IconUp"); tbb->hIconHandleUp = (HANDLE)lua_touserdata(L, -1); lua_pop(L, 1); - lua_pushliteral(L, "TooltipUp"); - lua_gettable(L, -2); + lua_getfield(L, -1, "TooltipUp"); tbb->pszTooltipUp = mir_utf8decodeA(lua_tostring(L, -1)); lua_pop(L, 1); - lua_pushliteral(L, "wParamUp"); - lua_gettable(L, -2); + lua_getfield(L, -1, "wParamUp"); tbb->wParamUp = luaM_towparam(L, -1); lua_pop(L, 1); - lua_pushliteral(L, "lParamUp"); - lua_gettable(L, -2); + lua_getfield(L, -1, "lParamUp"); tbb->lParamUp = luaM_tolparam(L, -1); lua_pop(L, 1); // dn state - lua_pushliteral(L, "IconDown"); - lua_gettable(L, -2); + lua_getfield(L, -1, "IconDown"); tbb->hIconHandleDn = (HANDLE)lua_touserdata(L, -1); lua_pop(L, 1); - lua_pushliteral(L, "TooltipDown"); - lua_gettable(L, -2); + lua_getfield(L, -1, "TooltipDown"); tbb->pszTooltipDn = mir_utf8decodeA(lua_tostring(L, -1)); lua_pop(L, 1); - lua_pushliteral(L, "wParamDown"); - lua_gettable(L, -2); + lua_getfield(L, -1, "wParamDown"); tbb->wParamDown = luaM_towparam(L, -1); lua_pop(L, 1); - lua_pushliteral(L, "lParamDown"); - lua_gettable(L, -2); + lua_getfield(L, -1, "lParamDown"); tbb->lParamDown = luaM_tolparam(L, -1); lua_pop(L, 1); -- cgit v1.2.3