summaryrefslogtreecommitdiff
path: root/plugins/MirLua
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-30 07:44:38 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-30 07:44:38 +0000
commit580c7f7fbcb7e9365fcbed87fc751e8e9d155cc2 (patch)
tree21958f1f7c9d275d1a333d8ea5869e357accb460 /plugins/MirLua
parent1ac7427e92a1bb2a9bab2b576325b05b018108f6 (diff)
MirLua: added state control functions to m_genmenu
git-svn-id: http://svn.miranda-ng.org/main/trunk@14448 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua')
-rw-r--r--plugins/MirLua/src/m_genmenu.cpp33
1 files changed, 33 insertions, 0 deletions
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 }