Menu Class
Package: GHIElectronics.Endpoint.UI
Namespace: GHIElectronics.Endpoint.UI
Horizontal menu bar. Menu.AddItem returns a leaf-item handle; Menu.AddDropdown returns a dropdown handle whose entries are listed on click.
class Menu : public Widget {};
Constructors
Menu(Widget parent)
Menu(const Widget& parent);
Create a menu bar inside parent.
| Parameter | Type | Description |
|---|---|---|
parent | Widget | Containing widget. |
Properties
Background
uint32_t Background() const;
void Background(uint32_t value);
Menu-bar background color as 0x00RRGGBB. Getter returns the last value set.
Returns uint
Methods
AddDropdown(string header, string[] subItems, int itemWidth)
MenuItem AddDropdown(const std::string& header, const std::vector<std::string>& subItems, int32_t itemWidth);
Append a dropdown menu item that opens a sub-list when tapped.
| Parameter | Type | Description |
|---|---|---|
header | string | Button text shown on the bar. |
subItems | string[] | Sub-item strings; null is treated as empty. |
itemWidth | int | Fixed width in pixels; 0 fits the text. |
Returns MenuItem: Handle for subscribing to MenuItem.ValueChanged and reading MenuItem.Selected.
AddItem(string header, int itemWidth)
MenuItem AddItem(const std::string& header, int32_t itemWidth);
Append a leaf menu item.
| Parameter | Type | Description |
|---|---|---|
header | string | Button text shown on the bar. |
itemWidth | int | Fixed width in pixels; 0 fits the text. |
Returns MenuItem: Handle for subscribing to MenuItem.Clicked.