summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_genmenu.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-15 12:45:08 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-15 12:45:08 +0000
commit779e5910d73c0b14454bcbce6206f77e139c8df8 (patch)
treed70718a31bbb18e394539dd27977de7f05508f0c /plugins/MirLua/src/m_genmenu.cpp
parent69941e28fe11ce3b7958f48e22ea1ecbb8fe64b0 (diff)
MirLua: added tray menu support
git-svn-id: http://svn.miranda-ng.org/main/trunk@14174 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/m_genmenu.cpp')
-rw-r--r--plugins/MirLua/src/m_genmenu.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp
index 3ded59d384..cda7655a77 100644
--- a/plugins/MirLua/src/m_genmenu.cpp
+++ b/plugins/MirLua/src/m_genmenu.cpp
@@ -70,6 +70,22 @@ static int lua_AddContactMenuItem(lua_State *L)
return 1;
}
+static int lua_AddTrayMenuItem(lua_State *L)
+{
+ if (lua_type(L, 1) != LUA_TTABLE)
+ {
+ lua_pushlightuserdata(L, 0);
+ return 1;
+ }
+
+ mir_ptr<CLISTMENUITEM> pmi(MakeMenuItem(L));
+
+ HGENMENU res = ::Menu_AddTrayMenuItem(pmi);
+ lua_pushlightuserdata(L, res);
+
+ return 1;
+}
+
static int lua_ModifyMenuItem(lua_State *L)
{
HGENMENU hMenuItem = (HGENMENU)lua_touserdata(L, 1);
@@ -102,6 +118,7 @@ static luaL_Reg genmenuApi[] =
{
{ "AddMainMenuItem", lua_AddMainMenuItem },
{ "AddContactMenuItem", lua_AddContactMenuItem },
+ { "AddTrayMenuItem", lua_AddTrayMenuItem },
{ "ModifyMenuItem", lua_ModifyMenuItem },
{ "RemoveMenuItem", lua_RemoveMenuItem },