From 580c7f7fbcb7e9365fcbed87fc751e8e9d155cc2 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Tue, 30 Jun 2015 07:44:38 +0000 Subject: MirLua: added state control functions to m_genmenu git-svn-id: http://svn.miranda-ng.org/main/trunk@14448 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_genmenu.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'plugins/MirLua/src/m_genmenu.cpp') diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp index ac53d9b070..7b8df35cd0 100644 --- a/plugins/MirLua/src/m_genmenu.cpp +++ b/plugins/MirLua/src/m_genmenu.cpp @@ -101,6 +101,36 @@ static int lua_ModifyMenuItem(lua_State *L) return 1; } +static int lua_ShowMenuItem(lua_State *L) +{ + HGENMENU hMenuItem = (HGENMENU)lua_touserdata(L, 1); + bool isShow = (HGENMENU)lua_toboolean(L, 2); + + ::Menu_ShowItem(hMenuItem, isShow); + + return 0; +} + +static int lua_EnableMenuItem(lua_State *L) +{ + HGENMENU hMenuItem = (HGENMENU)lua_touserdata(L, 1); + bool isShow = (HGENMENU)lua_toboolean(L, 2); + + ::Menu_EnableItem(hMenuItem, isShow); + + return 0; +} + +static int lua_CheckMenuItem(lua_State *L) +{ + HGENMENU hMenuItem = (HGENMENU)lua_touserdata(L, 1); + bool isChecked = (HGENMENU)lua_toboolean(L, 2); + + ::Menu_SetChecked(hMenuItem, isChecked); + + return 0; +} + static int lua_RemoveMenuItem(lua_State *L) { HGENMENU hMenuItem = (HGENMENU)lua_touserdata(L, 1); @@ -117,6 +147,9 @@ static luaL_Reg genmenuApi[] = { "AddContactMenuItem", lua_AddContactMenuItem }, { "AddTrayMenuItem", lua_AddTrayMenuItem }, { "ModifyMenuItem", lua_ModifyMenuItem }, + { "ShowMenuItem", lua_ShowMenuItem }, + { "EnableMenuItem", lua_EnableMenuItem }, + { "CheckMenuItem", lua_CheckMenuItem }, { "RemoveMenuItem", lua_RemoveMenuItem }, { NULL, NULL } -- cgit v1.2.3