MenuBar class Core

The menu bar of a window or a page: captions in a row, each opening its menu - the grid's own MenuOverlayContent, so a menu reads, looks and types like every other menu of the product. The keyboard reaches it with F10 (or Tab); Left and Right move between the captions and, while a menu is open, to the menu beside it; Enter, Space or Down open one; a letter opens the menu whose caption marks it, also as Alt plus the letter from anywhere in the tree (ControlHost.OnAccessKey). The access keys are underlined.

The menus open in the pane stack of the grid that shows the board, or in the pane stack of the ArionControlSurface it is on.

Styling. From the style sheets (Select.Type<MenuBar>()): the bar's background and border, the captions' text, and the accent of an open caption.

A screen reader reads a menu bar with its menus as menu items.

public sealed class MenuBar : Control
Namespace
ArionUI.Presentation.Controls
Package
ArionUI.Presentation · dotnet add package ArionUI.Presentation --prerelease
Inherits
Control

Constructors

MenuBar

public MenuBar(params MenuBarItem[] items);

Parameters

items

The menus, left to right.

Properties

Children

public override IEnumerable<Control> Children { get; }

The controls inside this one, in tree order (visual order, tab order). A host keeps the tree it adopted: a control whose children change once it is adopted says so with Control.TreeChanged (on a shown board inside Board.Mutate), or its new children get no host and Tab, ticks and the wheel do not find them.

DrawsOwnFocus

public override bool DrawsOwnFocus { get; }

The control shows its focus itself (accent border, hover row, ring parameter). False = the host draws the shared default ring around Control.Bounds.

Focusable

public override bool Focusable { get; }

Can this KIND of control hold the keyboard focus? Combined with the live probes in Control.CanTakeFocus.

Height

public double Height { get; init; }

The bar's height.

Items

public IReadOnlyList<MenuBarItem> Items { get; }

The menus, left to right.

OpenIndex

public int OpenIndex { get; }

The index of the open menu, or -1.

Role

public override ControlRole Role { get; }

What KIND of part this is for assistive technology — the automation peers translate it into their host's control type.

WantsText

public override bool WantsText { get; }

Letters are access keys while the bar holds the keyboard; otherwise typing is none of its business.

Methods

Arrange

public override void Arrange(LogRect bounds);

HitTest

public override Control? HitTest(LogPoint p);

The control under an ABSOLUTE point, or null. Containers recurse; leaves answer for themselves. Same bounds the render pass used.

Measure

public override LogSize Measure(LogSize available);

Desired size given the space available (layout containers sum this).

OnDetached

protected internal override void OnDetached();

A bar that is no longer shown closes its menu.

OnFocusChanged

public override void OnFocusChanged();

Focus arrived at or left this control (read Control.IsFocused). For side effects the host cannot know — a list syncing its hover row.

OnKey

public override bool OnKey(ArionKey key, ArionModifiers mods);

Keys while focused. Return false to let the pane's fallback see the key.

OnText

public override void OnText(string text);

Render

public override void Render(IRenderSurface s, ControlFrame frame);

SpokenLabel

public override string? SpokenLabel();

What a screen reader speaks when this control receives the focus. A control that cannot take the focus but answers here is READ: it becomes a text part.