Class SMMenuItem

SMMenuItem: elements of a SMMenu

Summary

FieldTypeSummary
NextSMMenuItemNext menu item
PreviousSMMenuItemPrevious menu item
Return typeFunction and summary
SMMenuItemdisable(boolOrFunc, table args)
Disable (or not) the menu item.
SMMenuItemleftIcon(string li)
Add an image or text on the left side of the menu item.
SMMenuItemshortcut(string s)
Add a keyboard shortcut to the menu item.

Fields

SMMenuItem SMMenuItem:Previous

Previous menu item

SMMenuItem SMMenuItem:Next

Next menu item

Methods

SMMenuItem:leftIcon(string li)

Add an image or text on the left side of the menu item.

ParameterTypeDefaultDescription
listring Left icon "image:filename.png", or superposition of icons "image:file1.bmp|file2.png", or "text:Abc" or "color:<[#]RRGGBB>".
Return
SMMenuItem: self for function concatenation

SMMenuItem:disable(boolOrFunc, table args)

Disable (or not) the menu item.

ParameterTypeDefaultDescription
boolOrFunc  boolean or function. The boolean freezes the state, whereas the function is called each time the menu item is displayed. The function must return true to disable the item.
argstablenilIf first argument is a function, this argument is the table of arguments to call this function.
Return
SMMenuItem: self for function concatenation

SMMenuItem:shortcut(string s)

Add a keyboard shortcut to the menu item.

ParameterTypeDefaultDescription
sstring s
Return
SMMenuItem: self for function concatenation