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 | |
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')
-rw-r--r-- | plugins/MirLua/docs/examples/core.lua | 6 | ||||
-rw-r--r-- | plugins/MirLua/docs/examples/menus.lua | 21 | ||||
-rw-r--r-- | plugins/MirLua/docs/examples/popup.lua | 6 |
3 files changed, 17 insertions, 16 deletions
diff --git a/plugins/MirLua/docs/examples/core.lua b/plugins/MirLua/docs/examples/core.lua index 064ab58fad..e18dc0577a 100644 --- a/plugins/MirLua/docs/examples/core.lua +++ b/plugins/MirLua/docs/examples/core.lua @@ -1,7 +1,7 @@ -- core module (m) is included by default --- include m_genmenu module +--- include m_clist module +local clist = require('m_clist') -- include m_icolib module -local genmenu = require('m_genmenu') local icolib = require('m_icolib') -- Add icon for menu items @@ -10,5 +10,5 @@ local hRestartIcon = icolib.AddIcon('restartIcon', 'Restart') -- Subscribe to [[Miranda/System/ModulesLoaded]] event m.OnModulesLoaded(function() -- Add menu item to main menu that allow to restart Miranda NG - genmenu.AddMainMenuItem("Restart", 0, 0, hRestartIcon, "Miranda/System/Restart") + clist.AddMainMenuItem("Restart", 0, 0, hRestartIcon, "Miranda/System/Restart") end) 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) diff --git a/plugins/MirLua/docs/examples/popup.lua b/plugins/MirLua/docs/examples/popup.lua index 395f650267..4d48ace8a3 100644 --- a/plugins/MirLua/docs/examples/popup.lua +++ b/plugins/MirLua/docs/examples/popup.lua @@ -1,7 +1,7 @@ --- include m_popup module local popup = require('m_popup') ---- include m_genmenu module -local genmenu = require('m_genmenu') +--- include m_clist module +local clist = require('m_clist') m.CreateServiceFunction('MirLua/ShowPopup', function() local popupData = @@ -15,5 +15,5 @@ m.CreateServiceFunction('MirLua/ShowPopup', function() end) m.OnModulesLoaded(function() - genmenu.AddMainMenuItem({ Name = "Show lua popup", Service = 'MirLua/ShowPopup' }) + clist.AddMainMenuItem({ Name = "Show lua popup", Service = 'MirLua/ShowPopup' }) end) |