Skip to content

MenuBar

eduardgushchin edited this page Oct 22, 2026 · 1 revision

Home | API by Category | Complete API Index | API Status

Field Value
Full name Electron2D.MenuBar
Namespace Electron2D
Kind class
Category API Rendering

Overview

Displays a themed horizontal menu strip for its direct ordinary PopupMenu children.

Syntax

public class Electron2D.MenuBar

Remarks

Menus retain child identity across reordering. Titles follow each popup's Title or Name unless explicitly overridden. Header scene fields follow their popup when packing prunes siblings. Popup nodes retain normal scene ownership. Presentation uses the embedding viewport; system global menus require a native menu backend. Attached access requires the scene owner thread.

Inherits: Control

Detailed engine reference

Members

Member Kind Summary
public MenuBar() constructor Creates an empty menu strip with accessibility focus and shortcut input enabled.
protected override System.Func<Electron2D.Node> CreateSceneInstanceFactory() method
protected override System.Void Dispose(System.Boolean disposing) method
public System.Int32 GetMenuCount() method Returns the number of direct ordinary PopupMenu children, including hidden and disabled menus.
public Electron2D.PopupMenu GetMenuPopup(System.Int32 menu) method Returns a borrowed popup without changing its parent or lifetime.
public System.String GetMenuTitle(System.Int32 menu) method Returns the explicit title or the child's current Title/Name.
public System.String GetMenuTooltip(System.Int32 menu) method Returns one menu's tooltip.
protected override System.Collections.Generic.IEnumerable<Electron2D.PropertyDescriptor> GetPropertyDescriptors() method
public System.Boolean IsMenuDisabled(System.Int32 menu) method Returns whether user opening and shortcuts are disabled for one menu.
public System.Boolean IsMenuHidden(System.Int32 menu) method Returns whether one menu is omitted from the strip and shortcuts.
public System.Boolean IsNativeMenu() method Reports whether this strip currently uses a system global menu.
protected override System.Void OnGUIInput(Electron2D.InputEvent input) method
protected override Electron2D.Vector2 OnGetMinimumSize() method
protected override System.String OnGetTooltip(Electron2D.Vector2 atPosition) method
protected override System.Void OnNotification(System.Int32 what) method
protected override System.Void OnShortcutInput(Electron2D.InputEvent input) method
public System.Void SetDisableShortcuts(System.Boolean disabled) method Disables the owner shortcut stage without changing individual popup item records.
public System.Void SetMenuDisabled(System.Int32 menu, System.Boolean disabled) method Changes the disabled flag and closes this menu if necessary.
public System.Void SetMenuHidden(System.Int32 menu, System.Boolean hidden) method Changes header visibility without changing child membership.
public System.Void SetMenuTitle(System.Int32 menu, System.String title) method Overrides one menu's title; matching the child's current Title/Name restores automatic naming.
public System.Void SetMenuTooltip(System.Int32 menu, System.String tooltip) method Changes one menu's tooltip.
protected override System.Void ValidateDisposal() method
protected override System.Void ValidateMutation() method
public System.Boolean Flat { get; set; } property Gets or sets suppression of item decorations while retaining text and layout margins.
public System.String Language { get; set; } property Gets or sets the shaping language; empty uses the current translation locale.
public System.Boolean SwitchOnHover { get; set; } property Gets or sets hover switching while a menu in this strip is open.
public Electron2D.TextDirection TextDirection { get; set; } property Gets or sets the base writing direction independently of visual layout direction.

Member Details

MenuBar()

Kind: constructor

public MenuBar()

Summary

Creates an empty menu strip with accessibility focus and shortcut input enabled.

CreateSceneInstanceFactory()

Kind: method

protected override System.Func<Electron2D.Node> CreateSceneInstanceFactory()

Dispose(System.Boolean)

Kind: method

protected override System.Void Dispose(System.Boolean disposing)

GetMenuCount()

Kind: method

public System.Int32 GetMenuCount()

Summary

Returns the number of direct ordinary PopupMenu children, including hidden and disabled menus.

Returns

The current menu count.

GetMenuPopup(System.Int32)

Kind: method

public Electron2D.PopupMenu GetMenuPopup(System.Int32 menu)

Summary

Returns a borrowed popup without changing its parent or lifetime.

Returns

The corresponding child.

Parameters

  • menu: A valid zero-based menu index.

GetMenuTitle(System.Int32)

Kind: method

public System.String GetMenuTitle(System.Int32 menu)

Summary

Returns the explicit title or the child's current Title/Name.

Returns

The untranslated title.

Parameters

  • menu: A valid menu index.

GetMenuTooltip(System.Int32)

Kind: method

public System.String GetMenuTooltip(System.Int32 menu)

Summary

Returns one menu's tooltip.

Returns

Empty initially.

Parameters

  • menu: A valid menu index.

GetPropertyDescriptors()

Kind: method

protected override System.Collections.Generic.IEnumerable<Electron2D.PropertyDescriptor> GetPropertyDescriptors()

IsMenuDisabled(System.Int32)

Kind: method

public System.Boolean IsMenuDisabled(System.Int32 menu)

Summary

Returns whether user opening and shortcuts are disabled for one menu.

Returns

False initially.

Parameters

  • menu: A valid menu index.

IsMenuHidden(System.Int32)

Kind: method

public System.Boolean IsMenuHidden(System.Int32 menu)

Summary

Returns whether one menu is omitted from the strip and shortcuts.

Returns

False initially.

Parameters

  • menu: A valid menu index.

IsNativeMenu()

Kind: method

public System.Boolean IsNativeMenu()

Summary

Reports whether this strip currently uses a system global menu.

Returns

False for the current canvas menu backend, including native popup windows.

OnGUIInput(Electron2D.InputEvent)

Kind: method

protected override System.Void OnGUIInput(Electron2D.InputEvent input)

OnGetMinimumSize()

Kind: method

protected override Electron2D.Vector2 OnGetMinimumSize()

OnGetTooltip(Electron2D.Vector2)

Kind: method

protected override System.String OnGetTooltip(Electron2D.Vector2 atPosition)

OnNotification(System.Int32)

Kind: method

protected override System.Void OnNotification(System.Int32 what)

OnShortcutInput(Electron2D.InputEvent)

Kind: method

protected override System.Void OnShortcutInput(Electron2D.InputEvent input)

SetDisableShortcuts(System.Boolean)

Kind: method

public System.Void SetDisableShortcuts(System.Boolean disabled)

Summary

Disables the owner shortcut stage without changing individual popup item records.

Parameters

  • disabled: Whether shortcuts are disabled.

SetMenuDisabled(System.Int32, System.Boolean)

Kind: method

public System.Void SetMenuDisabled(System.Int32 menu, System.Boolean disabled)

Summary

Changes the disabled flag and closes this menu if necessary.

Parameters

  • menu: A valid menu index.
  • disabled: Whether interaction is disabled.

SetMenuHidden(System.Int32, System.Boolean)

Kind: method

public System.Void SetMenuHidden(System.Int32 menu, System.Boolean hidden)

Summary

Changes header visibility without changing child membership.

Parameters

  • menu: A valid menu index.
  • hidden: Whether the header is hidden.

SetMenuTitle(System.Int32, System.String)

Kind: method

public System.Void SetMenuTitle(System.Int32 menu, System.String title)

Summary

Overrides one menu's title; matching the child's current Title/Name restores automatic naming.

Parameters

  • menu: A valid menu index.
  • title: Nonnull source text.

SetMenuTooltip(System.Int32, System.String)

Kind: method

public System.Void SetMenuTooltip(System.Int32 menu, System.String tooltip)

Summary

Changes one menu's tooltip.

Parameters

  • menu: A valid menu index.
  • tooltip: Nonnull source text.

ValidateDisposal()

Kind: method

protected override System.Void ValidateDisposal()

ValidateMutation()

Kind: method

protected override System.Void ValidateMutation()

Flat

Kind: property

public System.Boolean Flat { get; set; }

Summary

Gets or sets suppression of item decorations while retaining text and layout margins.

Value

False initially.

Language

Kind: property

public System.String Language { get; set; }

Summary

Gets or sets the shaping language; empty uses the current translation locale.

Value

Empty initially. NUL is rejected.

SwitchOnHover

Kind: property

public System.Boolean SwitchOnHover { get; set; }

Summary

Gets or sets hover switching while a menu in this strip is open.

Value

True initially. Hidden, disabled and obscured targets are skipped.

TextDirection

Kind: property

public Electron2D.TextDirection TextDirection { get; set; }

Summary

Gets or sets the base writing direction independently of visual layout direction.

Value

Auto initially; Inherited follows layout direction.

Clone this wiki locally