summaryrefslogtreecommitdiff
path: root/plugins/MirLua/docs
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirLua/docs')
-rw-r--r--plugins/MirLua/docs/examples/icons.lua22
-rw-r--r--plugins/MirLua/docs/examples/menus.lua32
2 files changed, 52 insertions, 2 deletions
diff --git a/plugins/MirLua/docs/examples/icons.lua b/plugins/MirLua/docs/examples/icons.lua
new file mode 100644
index 0000000000..7b9f6dca6c
--- /dev/null
+++ b/plugins/MirLua/docs/examples/icons.lua
@@ -0,0 +1,22 @@
+--- include m_icons module
+require('m_icons')
+
+--- Add icon to icoLib
+-- @param name The name of icon
+-- @param description The description of icon
+-- @param section The section in witch icon will be stored (default 'MirLua')
+-- @return handle of icon
+M.Icons.AddIcon('testIcon', 'Lua icon', 'MirLua')
+
+--- Create the icon which will be deleted below
+M.Icons.AddIcon('testRemoved', 'Lua temporary icon')
+
+--- Get icon by name
+-- @param name The name of icon
+-- @return handle of icon
+local hIcon = M.Icons.GetIcon('testRemoved')
+
+--- Remove icon from iconLib
+-- @param handle The handle of icon (or name)
+-- @return 0 on success
+M.Icons.RemoveIcon('testRemoved')
diff --git a/plugins/MirLua/docs/examples/menus.lua b/plugins/MirLua/docs/examples/menus.lua
index 6a7d70912e..f3e279efad 100644
--- a/plugins/MirLua/docs/examples/menus.lua
+++ b/plugins/MirLua/docs/examples/menus.lua
@@ -1,3 +1,31 @@
-require('m_clist')
+--- include m_menus module
+require('m_menus')
-M.CList.AddContactMenuItem('test', 0, 0, 0, 'Srv/Test')
+--- Add icon for menu items
+local hIcon = M.Icons.AddIcon('testMenuIcon', 'Lua icon for menus')
+
+--- Add menu item to main menu
+-- @param name The name of menu item
+-- @param flags The flugs that determine behaviour of menu item (default 0)
+-- @param position The position of menu item in main menu (default 0)
+-- @param icon The handle of icon of menu item (default NULL)
+-- @param service The name of service which will be called (default '')
+-- @return handle of menu item
+M.Menus.AddMainMenuItem('Main menu item', 0, 0, hIcon, 'Srv/MMI')
+
+--- Add menu item to contact menu
+-- @param name The name of menu item
+-- @param flags The flugs that determine behaviour of menu item (default 0)
+-- @param position The position of menu item in main menu (default 0)
+-- @param icon The handle of icon of menu item (default NULL)
+-- @param service The name of service which will be called (default '')
+-- @return handle of menu item
+M.Menus.AddContactMenuItem('Contact menu item', 0, 0, hIcon, 'Srv/CMI')
+
+--- Create the contact menu item which will be deleted below
+local hMenuItem = M.Menus.AddContactMenuItem('testRemove', 0, 0, 0, 'Srv/TestRemove')
+
+--- Remove menu item from parent menu
+-- @param handle The handle of menu item
+-- @return 0 on success
+M.Menus.RemoveMenuItem(hMenuItem);