diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-06-30 15:31:44 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-06-30 15:31:44 +0000 |
commit | 5dac5be47f2d9af8cbceead6511ff4c0fc40bab5 (patch) | |
tree | e7835f34984466b1382e75c8eebc656f4e9cfb4f /plugins/MirLua/docs/examples/menus.lua | |
parent | f65741787bee7c5d143d733efb32b7ec3452edc6 (diff) |
MirLua: !api break
- separated m_clist and m_genmenu modules
- moved AddMainMenuItem, AddContactMenuItem, AddTrayMenuItem to m_clist
- added BuildMainMenu, BuildContactMenu and BuildTrayMenu to m_clist
- updated examples
- version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@14458 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/docs/examples/menus.lua')
-rw-r--r-- | plugins/MirLua/docs/examples/menus.lua | 21 |
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) |