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.

public class Menu : Widget

Constructors​

public Menu(Widget parent)

Create a menu bar inside parent.

ParameterTypeDescription
parentWidgetContaining widget.

Properties​

Background​

public uint Background { get; set; }

Menu-bar background color as 0x00RRGGBB. Getter returns the last value set.

Returns uint

Methods​

AddDropdown(string header, string[] subItems, int itemWidth)​

public MenuItem AddDropdown(string header, string[] subItems, int 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)​

public MenuItem AddItem(string header, int 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.