Plugin:MirLua/Module/m genmenu

From Miranda NG
Jump to: navigation, search
Other languages:
English

Allows you to access menu subsystem.

Include module: local genmenu = require('m_genmenu')

Functions

ModifyMenuItem

Modifies menu item.

Parameters

Parameter name Required Type Description
hMenuItem Yes light userdata Menu item handle.
name Yes light userdata New menu item name or nil.
icon Yes light userdata Icon handle or INVALID_HANDLE_VALUE.
flags No number Additional flags or -1.

Result

     Type: boolean

     Returns true on success, otherwise false.

Example

local hMenuItem = genmenu.ModifyMenuItem(hMenuItem, 'New name', m.INVALID_HANDLE_VALUE)


ConfigureMenuItem

Дополнительная настройка пункта меню.

Parameters

Parameter name Required Type Description
hMenuItem Yes light userdata Menu item handle.
option Yes number
value Yes light userdata Value of the option.
hMenuItem
Тип: light userdata
Дескриптор пункта меню.
option
Тип: 'number'
изменяемая настройка (1 - название; 2 - горячие клавиши; 3 - параметр для исполнения; 4 - UUID).
value
Тип: light userdata
значение.

Result

     Type: light userdata

     Returns true on success, otherwise false.


ShowMenuItem

Shows/hides menu item.

Parameters

Parameter name Required Type Description
hMenuItem Yes light userdata Menu item handle.
isShown Yes boolean Pass true to show menu item, false to hide it.

Example

genmenu.ShowMenuItem(hMenuItem, true)


EnableMenuItem

Enables/disables menu item.

Parameters

Parameter name Required Type Description
hMenuItem Yes light userdata Menu item handle.
isEnabled Yes boolean Pass true to enable menu item, false to disable it.

Example

genmenu.EnableMenuItem(hMenuItem, false)


CheckMenuItem

Checks/unchecks menu item.

Parameters

Parameter name Required Type Description
hMenuItem Yes light userdata Menu item handle.
isChecked Yes boolean Pass true to check menu item, false to uncheck it.

Example

genmenu.CheckMenuItem(hMenuItem, true)


RemoveMenuItem

Removes menu item.

Parameters

Parameter name Required Type Description
hMenuItem Yes light userdata Menu item handle.

Result

     Type: boolean

     Returns true on success, otherwise false.

Example

genmenu.RemoveMenuItem(hMenuItem)

Structures

MenuItem

A table describing menu parameters.

Fields

Field name Required Type Description
Name Yes string Menu item name (automatically translated by Core).
Uid No string Plugin UUID in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
Service No string Service name.
Position No number Menu item position.
Parent No light userdata Parent menu handle.
Icon No light userdata Icon handle.
Flags No number Additional flags.