reckfellENGINE

MenuBar

Heading bar for child PopupMenus with local or native placement.

On this page
class MenuBarReckfellSharpInherits Control

Add PopupMenus as direct MenuBar children. Each creates one heading; a nested submenu belongs to its PopupMenu, while ordinary Entity/Control children create no heading. Add commands to PopupMenu and handle its IdPressed rather than heading-bar events.

An index in 0…GetMenuCount()-1 is the position among direct PopupMenus, including hidden/disabled ones. Not a total child index or command ID. Reordering/removal changes indices. GetMenuPopup returns an existing child object; do not free it separately while owned by the bar. RemoveChild detaches without Free.

The default heading uses PopupMenu.Title, falling back to Name when Title is empty. SetMenuTitle supplies a separate bar caption without changing window Title/Name. Assigning the current source Title/Name restores automatic tracking. GetMenuTitle returns the original string rather than necessarily its displayed translation.

Current implementation limitation: MoveChild matches a cached menu record by original title. Identical titles can associate hidden/disabled flags and other data with the wrong PopupMenu. Use distinct original titles for dynamic reordering; if duplicates are required, create the bar directly in final order. Matching translations of distinct original strings are a separate case.

PreferGlobalMenu = true is a preference rather than a guarantee of native menus. Check IsNativeMenu. Set false for a predictable in-window bar. Native mode contributes zero local minimum size and uses platform appearance/handling; Flat and local theme do not style the OS menu. StartIndex orders MenuBar placement in the native bar rather than shifting local PopupMenu indices.

SetMenuHidden hides a heading without removing its menu. SetMenuDisabled blocks ordinary opening/shortcut handling through this bar; direct PopupMenu access and application handlers remain available. SetDisableShortcuts disables the local MenuBar shortcut route rather than every application shortcut or necessarily native-menu handling.

SwitchOnHover switches adjacent menus while one is already open; configure before opening. It does not open every menu on simple hover. Language/TextDirection control text shaping rather than application locale. When changing them dynamically, reapply headings through SetMenuTitle(i, GetMenuTitle(i)) to explicitly refresh text buffers.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

MenuBarConstructor
# MenuBar
C#
public MenuBar();

Creates a bar: PreferGlobalMenu = true, SwitchOnHover = true, Flat = false, StartIndex = -1, empty Language, TextDirection.Auto. FocusMode = Accessibility; child PopupMenus supply headings.

Properties6

FlatProperty
# Flat
C#
public bool Flat { get; set; }

Skip state-style drawing for local headings, default false. Text and theme sizing margins remain; does not change native-menu styling.

LanguageProperty
# Language
C#
public string Language { get; set; }

Heading shaping language; empty uses the control locale. Does not change original strings/application locale. Reapply headings through SetMenuTitle for immediate dynamic refresh.

PreferGlobalMenuProperty
# PreferGlobalMenu
C#
public bool PreferGlobalMenu { get; set; }

Prefer the native menu bar, default true. Requires NativeMenu support; check IsNativeMenu. false keeps the bar in the window. Not the actual-mode indicator.

StartIndexProperty
# StartIndex
C#
public int StartIndex { get; set; }

MenuBar placement order in the native bar, default -1 appends. Does not reindex child PopupMenus or assign a command ID. Does not change local indices in in-window mode.

SwitchOnHoverProperty
# SwitchOnHover
C#
public bool SwitchOnHover { get; set; }

Switch between headings while a menu is open, default true. Configure before opening; ordinary hover over a closed bar does not itself open menus.

TextDirectionProperty
# TextDirection
C#
public Control.TextDirection TextDirection { get; set; }

Shaping direction, default Auto; Inherited uses layout direction. Does not reverse original strings. Reapply headings to refresh shaping after a dynamic change.

Methods24

GetLanguagestring
# GetLanguage
C#
public string GetLanguage();

Heading shaping language; empty uses the control locale. Does not change original strings/application locale. Reapply headings through SetMenuTitle for immediate dynamic refresh.

Returns string

Shaping language, or empty.

GetMenuCountint
# GetMenuCount
C#
public int GetMenuCount();

Number of direct child PopupMenus, including hidden/disabled; not the number of commands inside them.

Returns int

Direct PopupMenu count.

GetMenuPopupPopupMenu
# GetMenuPopup
C#
public PopupMenu GetMenuPopup(int menu);

Returns the shared child PopupMenu at the current index, null for missing/negative indices. Does not copy or open it.

Parameters
NameTypeDefault
menuint—
menu

Index 0…GetMenuCount()-1; GetMenuPopup returns null for a missing index.

Returns PopupMenu

Shared child PopupMenu, or null.

GetMenuTitlestring
# GetMenuTitle
C#
public string GetMenuTitle(int menu);

Original heading caption. Not a stable ID and can differ from PopupMenu.Title or its displayed translation.

Parameters
NameTypeDefault
menuint—
menu

Index 0…GetMenuCount()-1; GetMenuPopup returns null for a missing index.

Returns string

Original heading caption.

GetMenuTooltipstring
# GetMenuTooltip
C#
public string GetMenuTooltip(int menu);

Stored heading tooltip rather than current tooltip visibility.

Parameters
NameTypeDefault
menuint—
menu

Index 0…GetMenuCount()-1; GetMenuPopup returns null for a missing index.

Returns string

Stored heading tooltip.

GetStartIndexint
# GetStartIndex
C#
public int GetStartIndex();

MenuBar placement order in the native bar, default -1 appends. Does not reindex child PopupMenus or assign a command ID. Does not change local indices in in-window mode.

Returns int

Placement order, or -1 for append.

GetTextDirectionControl.TextDirection
# GetTextDirection
C#
public Control.TextDirection GetTextDirection();

Shaping direction, default Auto; Inherited uses layout direction. Does not reverse original strings. Reapply headings to refresh shaping after a dynamic change.

Returns Control.TextDirection

Current Control.TextDirection.

IsFlatbool
# IsFlat
C#
public bool IsFlat();

Skip state-style drawing for local headings, default false. Text and theme sizing margins remain; does not change native-menu styling.

Returns bool

Local state-background skip flag.

IsMenuDisabledbool
# IsMenuDisabled
C#
public bool IsMenuDisabled(int menu);

Heading disabled flag, separate from disabled states of its commands.

Parameters
NameTypeDefault
menuint—
menu

Index 0…GetMenuCount()-1; GetMenuPopup returns null for a missing index.

Returns bool

Heading disabled flag.

IsMenuHiddenbool
# IsMenuHidden
C#
public bool IsMenuHidden(int menu);

Heading hidden flag rather than PopupMenu window Visible state.

Parameters
NameTypeDefault
menuint—
menu

Index 0…GetMenuCount()-1; GetMenuPopup returns null for a missing index.

Returns bool

Heading hidden flag.

IsNativeMenubool
# IsNativeMenu
C#
public bool IsNativeMenu();

Returns whether native mode is supported and enabled for this bar. Disabled for the edited scene. Not equivalent to PreferGlobalMenu.

Returns bool

true for supported, enabled native mode.

IsPreferGlobalMenubool
# IsPreferGlobalMenu
C#
public bool IsPreferGlobalMenu();

Prefer the native menu bar, default true. Requires NativeMenu support; check IsNativeMenu. false keeps the bar in the window. Not the actual-mode indicator.

Returns bool

Native-menu preference flag.

IsSwitchOnHoverbool
# IsSwitchOnHover
C#
public bool IsSwitchOnHover();

Switch between headings while a menu is open, default true. Configure before opening; ordinary hover over a closed bar does not itself open menus.

Returns bool

Hover-switch flag for open menus.

SetDisableShortcutsvoid
# SetDisableShortcuts
C#
public void SetDisableShortcuts(bool disabled);

Disables local MenuBar shortcut handling. Does not block direct PopupMenu actions or globally disable input/native menus. This SDK supplies no getter.

Parameters
NameTypeDefault
disabledbool—
disabled

Disables local MenuBar shortcut handling. Does not block direct PopupMenu actions or globally disable input/native menus. This SDK supplies no getter.

SetFlatvoid
# SetFlat
C#
public void SetFlat(bool enabled);

Skip state-style drawing for local headings, default false. Text and theme sizing margins remain; does not change native-menu styling.

Parameters
NameTypeDefault
enabledbool—
enabled

Skip state-style drawing for local headings, default false. Text and theme sizing margins remain; does not change native-menu styling.

SetLanguagevoid
# SetLanguage
C#
public void SetLanguage(string language);

Heading shaping language; empty uses the control locale. Does not change original strings/application locale. Reapply headings through SetMenuTitle for immediate dynamic refresh.

Parameters
NameTypeDefault
languagestring—
language

Heading shaping language; empty uses the control locale. Does not change original strings/application locale. Reapply headings through SetMenuTitle for immediate dynamic refresh.

SetMenuDisabledvoid
# SetMenuDisabled
C#
public void SetMenuDisabled(int menu, bool disabled);

Disables the heading for ordinary input and the local shortcut route. Record/index/child PopupMenu remain. Does not block calling an application command handler from code.

Parameters
NameTypeDefault
menuint—
disabledbool—
menu

Index 0…GetMenuCount()-1; GetMenuPopup returns null for a missing index.

disabled

Disables the heading for ordinary input and the local shortcut route. Record/index/child PopupMenu remain. Does not block calling an application command handler from code.

SetMenuHiddenvoid
# SetMenuHidden
C#
public void SetMenuHidden(int menu, bool hidden);

Hides the heading without removing PopupMenu or changing GetMenuCount. Does not prevent direct access to the menu object.

Parameters
NameTypeDefault
menuint—
hiddenbool—
menu

Index 0…GetMenuCount()-1; GetMenuPopup returns null for a missing index.

hidden

Hides the heading without removing PopupMenu or changing GetMenuCount. Does not prevent direct access to the menu object.

SetMenuTitlevoid
# SetMenuTitle
C#
public void SetMenuTitle(int menu, string title);

Sets the heading caption without changing PopupMenu.Title/Name. Matching current source Title/Name restores automatic tracking. Reassignment refreshes shaping.

Parameters
NameTypeDefault
menuint—
titlestring—
menu

Index 0…GetMenuCount()-1; GetMenuPopup returns null for a missing index.

title

Sets the heading caption without changing PopupMenu.Title/Name. Matching current source Title/Name restores automatic tracking. Reassignment refreshes shaping.

SetMenuTooltipvoid
# SetMenuTooltip
C#
public void SetMenuTooltip(int menu, string tooltip);

Sets a separate bar-heading tooltip. Does not change tooltips of commands inside PopupMenu.

Parameters
NameTypeDefault
menuint—
tooltipstring—
menu

Index 0…GetMenuCount()-1; GetMenuPopup returns null for a missing index.

tooltip

Sets a separate bar-heading tooltip. Does not change tooltips of commands inside PopupMenu.

SetPreferGlobalMenuvoid
# SetPreferGlobalMenu
C#
public void SetPreferGlobalMenu(bool enabled);

Prefer the native menu bar, default true. Requires NativeMenu support; check IsNativeMenu. false keeps the bar in the window. Not the actual-mode indicator.

Parameters
NameTypeDefault
enabledbool—
enabled

Prefer the native menu bar, default true. Requires NativeMenu support; check IsNativeMenu. false keeps the bar in the window. Not the actual-mode indicator.

SetStartIndexvoid
# SetStartIndex
C#
public void SetStartIndex(int enabled);

MenuBar placement order in the native bar, default -1 appends. Does not reindex child PopupMenus or assign a command ID. Does not change local indices in in-window mode.

Parameters
NameTypeDefault
enabledint—
enabled

Integer native placement order, -1 for append; the SDK name enabled does not make it boolean.

SetSwitchOnHovervoid
# SetSwitchOnHover
C#
public void SetSwitchOnHover(bool enable);

Switch between headings while a menu is open, default true. Configure before opening; ordinary hover over a closed bar does not itself open menus.

Parameters
NameTypeDefault
enablebool—
enable

Switch between headings while a menu is open, default true. Configure before opening; ordinary hover over a closed bar does not itself open menus.

SetTextDirectionvoid
# SetTextDirection
C#
public void SetTextDirection(Control.TextDirection direction);

Shaping direction, default Auto; Inherited uses layout direction. Does not reverse original strings. Reapply headings to refresh shaping after a dynamic change.

Parameters
NameTypeDefault
directionControl.TextDirection—
direction

Shaping direction, default Auto; Inherited uses layout direction. Does not reverse original strings. Reapply headings to refresh shaping after a dynamic change.

Theme properties

These are Theme resource keys, not C# properties. Use the matching Control GetTheme…() and AddTheme…Override() methods for each value type.

Key and typeDescription
font_color
Color

Default text Color of the menu item.

Default: Color(0.875, 0.875, 0.875, 1)
font_disabled_color
Color

Text Color used when the menu item is disabled.

Default: Color(0.875, 0.875, 0.875, 0.5)
font_focus_color
Color

Text Color used when the menu item is focused. Only replaces the normal text color of the menu item. Disabled, hovered, and pressed states take precedence over this color.

Default: Color(0.95, 0.95, 0.95, 1)
font_hover_color
Color

Text Color used when the menu item is being hovered.

Default: Color(0.95, 0.95, 0.95, 1)
font_hover_pressed_color
Color

Text Color used when the menu item is being hovered and pressed.

Default: Color(1, 1, 1, 1)
font_outline_color
Color

The tint of text outline of the menu item.

Default: Color(0, 0, 0, 1)
font_pressed_color
Color

Text Color used when the menu item is being pressed.

Default: Color(1, 1, 1, 1)
h_separation
int

The horizontal space between menu items.

Default: 4
outline_size
int

The size of the text outline. Note: If using a font with FontFile.MultichannelSignedDistanceField enabled, its FontFile.MsdfPixelRange must be set to at least twice the value of MenuBar.outline_size for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.

Default: 0
font
Font

Font of the menu item's text.

font_size
int

Font size of the menu item's text.

disabled
StyleBox

StyleBox used when the menu item is disabled.

disabled_mirrored
StyleBox

StyleBox used when the menu item is disabled (for right-to-left layouts).

hover
StyleBox

StyleBox used when the menu item is being hovered.

hover_mirrored
StyleBox

StyleBox used when the menu item is being hovered (for right-to-left layouts).

hover_pressed
StyleBox

StyleBox used when the menu item is being pressed and hovered at the same time.

hover_pressed_mirrored
StyleBox

StyleBox used when the menu item is being pressed and hovered at the same time (for right-to-left layouts).

normal
StyleBox

Default StyleBox for the menu item.

normal_mirrored
StyleBox

Default StyleBox for the menu item (for right-to-left layouts).

pressed
StyleBox

StyleBox used when the menu item is being pressed.

pressed_mirrored
StyleBox

StyleBox used when the menu item is being pressed (for right-to-left layouts).

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.