Skip to main content

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(const Widget& parent);

Create a menu bar inside parent.

ParameterTypeDescription
parentWidgetContaining 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.

ParameterTypeDescription
headerstringButton text shown on the bar.
subItemsstring[]Sub-item strings; null is treated as empty.
itemWidthintFixed 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.

ParameterTypeDescription
headerstringButton text shown on the bar.
itemWidthintFixed width in pixels; 0 fits the text.

Returns MenuItem: Handle for subscribing to MenuItem.Clicked.