diff options
Diffstat (limited to 'plugins/MirLua')
-rw-r--r-- | plugins/MirLua/docs/examples/menus.lua | 10 | ||||
-rw-r--r-- | plugins/MirLua/src/m_genmenu.cpp | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/plugins/MirLua/docs/examples/menus.lua b/plugins/MirLua/docs/examples/menus.lua index 67bea59a40..8480c2cbaf 100644 --- a/plugins/MirLua/docs/examples/menus.lua +++ b/plugins/MirLua/docs/examples/menus.lua @@ -55,3 +55,13 @@ local hChild = genmenu.AddMainMenuItem(menuItem) --- Modify menu item local CMIM_NAME = tonumber("80000000", 16) genmenu.ModifyMenuItem(hChild, "Main menu child", hIcon, CMIM_NAME) + + +local hDisabledMenuItem = genmenu.AddMainMenuItem({ Name = "Disabled main menu item" }) +genmenu.EnableMenuItem(hDisabledMenuItem, false) + +local hHiddenMenuItem = genmenu.AddMainMenuItem({ Name = "Hidden main menu item" }) +genmenu.ShowMenuItem(hHiddenMenuItem, false) + +local hCheckedMenuItem = genmenu.AddMainMenuItem({ Name = "Checked main menu item" }) +genmenu.CheckMenuItem(hCheckedMenuItem, true) diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp index 76b54649e9..7fabed093b 100644 --- a/plugins/MirLua/src/m_genmenu.cpp +++ b/plugins/MirLua/src/m_genmenu.cpp @@ -117,9 +117,9 @@ static int lua_ShowMenuItem(lua_State *L) static int lua_EnableMenuItem(lua_State *L)
{
HGENMENU hMenuItem = (HGENMENU)lua_touserdata(L, 1);
- bool isShow = (HGENMENU)lua_toboolean(L, 2);
+ bool isEnable = (HGENMENU)lua_toboolean(L, 2);
- ::Menu_EnableItem(hMenuItem, isShow);
+ ::Menu_EnableItem(hMenuItem, isEnable);
return 0;
}
|