Class SMMenuItem
SMMenuItem: elements of a SMMenu
Summary
| Field | Type | Summary |
|---|---|---|
| Next | SMMenuItem | Next menu item |
| Previous | SMMenuItem | Previous menu item |
| Return type | Function and summary |
|---|---|
| SMMenuItem | disable(boolOrFunc, table args) Disable (or not) the menu item. |
| SMMenuItem | leftIcon(string li) Add an image or text on the left side of the menu item. |
| SMMenuItem | shortcut(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.
| Parameter | Type | Default | Description |
|---|---|---|---|
| li | string | 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.
| Parameter | Type | Default | Description |
|---|---|---|---|
| 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. | ||
| args | table | nil | If 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.
| Parameter | Type | Default | Description |
|---|---|---|---|
| s | string | s |
- Return
- SMMenuItem: self for function concatenation