summaryrefslogtreecommitdiff
path: root/plugins/MirLua/docs/examples/menus.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirLua/docs/examples/menus.lua')
-rw-r--r--plugins/MirLua/docs/examples/menus.lua21
1 files changed, 11 insertions, 10 deletions
diff --git a/plugins/MirLua/docs/examples/menus.lua b/plugins/MirLua/docs/examples/menus.lua
index 8480c2cbaf..52ec8e3173 100644
--- a/plugins/MirLua/docs/examples/menus.lua
+++ b/plugins/MirLua/docs/examples/menus.lua
@@ -1,3 +1,5 @@
+--- include m_clist module
+local clist = require('m_clist')
--- include m_genmenu module
local genmenu = require('m_genmenu')
--- include m_icolib module
@@ -21,47 +23,46 @@ local hIcon = icolib.AddIcon('testMenuIcon', 'Lua icon for menus')
menuItem.Name = "Main menu item"
menuItem.Icon = hIcon
menuItem.Service = "Srv/MMI"
-genmenu.AddMainMenuItem(menuItem)
+clist.AddMainMenuItem(menuItem)
--- Add menu item to main menu
menuItem.Name = "Tray menu item"
menuItem.Service = "Srv/TMI"
-genmenu.AddTrayMenuItem(menuItem)
+clist.AddTrayMenuItem(menuItem)
--- Add menu item to contact menu
menuItem.Name = "Contact menu item"
menuItem.Service = "Srv/CMI"
-genmenu.AddContactMenuItem(menuItem)
+clist.AddContactMenuItem(menuItem)
--- Create the contact menu item which will be deleted below
menuItem.Name = "testRemove"
menuItem.Service = "Srv/TestRemove"
-local hMenuItem = genmenu.AddContactMenuItem(menuItem)
+local hMenuItem = clist.AddContactMenuItem(menuItem)
--- Remove menu item from parent menu
genmenu.RemoveMenuItem(hMenuItem)
--- Add root menu item
local CMIF_ROOTHANDLE = 384
-local hRoot = genmenu.AddMainMenuItem({ Name = "Main menu root", Flags = CMIF_ROOTHANDLE })
+local hRoot = clist.AddMainMenuItem({ Name = "Main menu root", Flags = CMIF_ROOTHANDLE })
--- Add child menu item
menuItem.Name = "Main menu child wierd"
menuItem.Flags = CMIF_ROOTHANDLE
menuItem.Service = 'Srv/SMI'
menuItem.Parent = hRoot
-local hChild = genmenu.AddMainMenuItem(menuItem)
+local hChild = clist.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" })
+local hDisabledMenuItem = clist.AddMainMenuItem({ Name = "Disabled main menu item" })
genmenu.EnableMenuItem(hDisabledMenuItem, false)
-local hHiddenMenuItem = genmenu.AddMainMenuItem({ Name = "Hidden main menu item" })
+local hHiddenMenuItem = clist.AddMainMenuItem({ Name = "Hidden main menu item" })
genmenu.ShowMenuItem(hHiddenMenuItem, false)
-local hCheckedMenuItem = genmenu.AddMainMenuItem({ Name = "Checked main menu item" })
+local hCheckedMenuItem = clist.AddMainMenuItem({ Name = "Checked main menu item" })
genmenu.CheckMenuItem(hCheckedMenuItem, true)