Table of Contents

Class MenuBarv2

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

A horizontal list of MenuBarItemv2s. Each MenuBarItemv2 can have a PopoverMenu that is shown when the MenuBarItemv2 is selected.

public class MenuBarv2 : Menuv2, IDisposable, ISupportInitializeNotification, ISupportInitialize, IOrientation, IDesignable
Inheritance
MenuBarv2
Implements
Inherited Members

Remarks

MenuBars may be hosted by any View and will, by default, be positioned the full width across the top of the View's Viewport.

Constructors

MenuBarv2()

Initializes a new instance of View.

MenuBarv2(IEnumerable<MenuBarItemv2>)

Properties

DefaultKey

The default key for activating menu bars.

Key

Specifies the key that will activate the context menu.

Menus

Sets the Menu Bar Items for this Menu Bar. This will replace any existing Menu Bar Items.

Methods

EnableForDesign<TContext>(ref readonly TContext)

Causes the View to enable design-time mode. This typically means that the view will load demo data and be configured to allow for design-time manipulation.

EndInit()

Signals the View that initialization is ending. See ISupportInitialize.

HideActiveItem()

Hides the popover menu associated with the active menu bar item and updates the focus state.

HideItem(MenuBarItemv2?)

Hides popover menu associated with the specified menu bar item and updates the focus state.

IsActive()

Returns a value indicating whether the menu bar is active or not. When active, moving the mouse over a menu bar item will activate it.

IsOpen()

Gets whether any of the menu bar items have a visible PopoverMenu.

OnAccepting(CommandEventArgs)

Called when the user is accepting the state of the View and the Accept has been invoked. Set CommandEventArgs.Cancel to true and return true to stop processing.

OnHasFocusChanged(bool, View?, View?)

Invoked after HasFocus has changed. This method is called before the HasFocusChanged event is raised.

OnMouseEnter(CancelEventArgs)

Called when the mouse moves over the View's Frame and no other non-SubView occludes it. MouseLeave will be raised when the mouse is no longer over the Frame.

OnMouseLeave()

Called when the mouse moves outside View's Frame, or is occluded by another non-SubView.

OnSelectedMenuItemChanged(MenuItemv2?)

Called when the selected menu item has changed.

Events

KeyChanged

Raised when Key is changed.