hV_GUI — Menu
The menu can handle up to 4 levels with up to 8 options per level.
It is not an object but a function. A menu includes
Note the area used by the menu is darkened to improve readability. |
To go from left to right, select Item 2121 on the right side.
|
To go from right to left, select Item 212 on the hierarchy on the left side. Pressing Item 2 goes back to the first picture.
|
Because dialog is a function, there's no setup except the content of the menu.
The content of the menu is declared as an array of item. |
Code Editor
|
Each item includes an index and a label.
myMenuItems is the content of the menu and nItems the number of items.
myMenuItems is the content of the menu and nItems the number of items.
Both are required by the function menu.
To easily convert a string into an item, use |
|
To use a menu, define the following parameters:
|
|
The result is the index of the selected item, or 0x0000 if Cancel is selected.
The menu size fits both landscape and portrait modes with automatic recognition of the orientation. |