PopupMenu
Popup command menu with separate indices, IDs and stored item states.
Add commands through AddItem, AddCheckItem, AddRadioCheckItem or AddMultistateItem. MenuBar/MenuButton can open the window, but handle application actions in PopupMenu.IdPressed. The menu does not itself save projects or execute commands by label.
An index is a position in 0…ItemCount-1, including separators. ID is a separate command number. For ordinary additions id = -1 assigns the current index; later removal does not renumber IDs. AddSeparator stores -1 as -1. Use your own unique nonnegative IDs: duplicates are allowed, GetItemIndex returns the first, and activation substitutes the current index for a stored negative ID.
After RemoveItem or SetItemIndex, resolve the index again through GetItemIndex(id) and check for -1. Do not pass -1 to a getter to mean last item: most getters require ordinary indices. The reviewed SetItem* methods accept negative indices from the end, but ToggleItemChecked/ToggleItemMultistate and RemoveItem do not.
Activation emits IdPressed, then IndexPressed. Use one channel for executing actions to avoid duplicate execution. An IdPressed handler can already mutate the list, so IndexPressed is not a fresh lookup of that command after mutation. Programmatic flag/text setters do not activate items.
Check/radio describes appearance and stored state rather than automatic toggling. Activation does not change Checked, and radio items do not uncheck siblings. Update your model in IdPressed, then explicitly SetItemChecked on the required indices. Indeterminate is separate: ToggleItemChecked does not reset it; clear Indeterminate explicitly for ordinary binary choices.
Multistate storage is also separate from activation: call ToggleItemMultistate or SetItemMultistate in the handler. Validate maxStates > 0 and 0 ≤ state < maxStates yourself; reducing the maximum does not normalize current state.
ActivateItemByEvent directly matches a Shortcut/accelerator rather than performing full input delivery. Filter press/repeat when calling from your own handler: matching key releases can also activate accelerators. Disabled and ShortcutDisabled exclude an item. forGlobalOnly restricts Shortcut matching rather than excluding ordinary accelerators.
Clear() and Clear(false) remove records while retaining child submenus. Clear(true) detaches and schedules freeing submenus referenced by current records; previously retained children no longer referenced by items are not removed by that condition. Prefer AddSubmenuEntityItem/GetItemSubmenuEntity: this menu adopts a parentless submenu. Do not share one submenu between multiple owners.
HideOnItemSelection and HideOnCheckableItemSelection default to true, HideOnStateItemSelection to false. These hiding policies do not toggle state or confirm successful command execution. MenuChanged is also not universal observation of every mutation: SetItemAsSeparator, for example, does not emit it.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
PopupMenuConstructor
public PopupMenu();Creates an empty hidden menu. HideOnItemSelection/HideOnCheckableItemSelection enabled, HideOnStateItemSelection disabled. Adding records does not activate them.
Properties14
AllowSearchProperty
public bool AllowSearch { get; set; }Enables navigation by the initial letters of original item labels, default true. This navigates rather than executing commands or providing a filter field. This letter-navigation mode is unused while the menu search bar is visible.
HideOnCheckableItemSelectionProperty
public bool HideOnCheckableItemSelection { get; set; }Hide on check/radio activation, default true. Does not toggle checked itself.
HideOnItemSelectionProperty
public bool HideOnItemSelection { get; set; }Hide on ordinary command activation, default true. Does not enable/disable handler execution.
HideOnStateItemSelectionProperty
public bool HideOnStateItemSelection { get; set; }Hide on multistate activation, default false. Does not modify state.
ItemCountProperty
public int ItemCount { get; set; }Record count including separators. Setter requires ≥ 0; growth adds empty records with index-based IDs, shrinking discards the tail. Does not manage the lifetime of every child submenu.
PreferNativeMenuProperty
public bool PreferNativeMenu { get; set; }If true, MenuBar will use native menu when supported.
Note: If PopupMenu is linked to StatusIndicator, MenuBar, or another PopupMenu item it can use native menu regardless of this property, use PopupMenu.IsNativeMenu to check it.
SearchBarEnabledProperty
public bool SearchBarEnabled { get; set; }Enables the menu filter field, default false. It appears at SearchBarMinItemCount; separators do not count toward the threshold. While the field is visible, AllowSearch letter navigation is unused. This configures the local menu rather than guaranteeing an equivalent OS-native field.
SearchBarFuzzySearchEnabledProperty
public bool SearchBarFuzzySearchEnabled { get; set; }Enables fuzzy matching in the search field, default true. false uses the matcher’s exact-token mode rather than promising byte-for-byte equality of the entire label. Search uses original item and submenu labels.
SearchBarFuzzySearchMaxMissesProperty
public int SearchBarFuzzySearchMaxMisses { get; set; }Fuzzy matcher miss allowance: integer 0 or greater, default 2. This configures matching rather than result count or a guaranteed Levenshtein distance.
SearchBarMinItemCountProperty
public int SearchBarMinItemCount { get; set; }Minimum number of non-separator items needed to show the enabled search field. Must be 0 or greater; default 0. Does not remove records or change IDs.
ShrinkHeightProperty
public bool ShrinkHeight { get; set; }Fit the local popup height to its computed content minimum when preparing it, default true. false retains the requested height subject to window constraints. The setter does not itself open or resize an already displayed window.
ShrinkWidthProperty
public bool ShrinkWidth { get; set; }Fit the local popup width to its computed content minimum when preparing it, default true. false retains the requested width subject to window constraints. The setter does not itself open the menu.
SubmenuPopupDelayProperty
public float SubmenuPopupDelay { get; set; }Hover submenu opening delay in seconds; default 0.2. A value ≤ 0 becomes 0.01; positive values below 0.01 are retained. Does not provide zero delay or trigger opening by itself.
SystemMenuIdProperty
public NativeMenu.SystemMenus SystemMenuId { get; set; }If set to one of the values of NativeMenu.SystemMenus, this PopupMenu is bound to the special system menu. Only one PopupMenu can be bound to each special menu at a time.
Methods109
ActivateItemByEventbool
public bool ActivateItemByEvent(InputEvent @event, bool forGlobalOnly = false);Directly matches a Shortcut/accelerator and activates the first eligible item. Caller must filter press/echo; a matching release can also activate an accelerator. Respects Disabled and ShortcutDisabled. forGlobalOnly restricts Shortcuts rather than ordinary accelerators.
| Name | Type | Default |
|---|---|---|
event | InputEvent | — |
forGlobalOnly | bool | false |
eventNon-null event; caller filters press/repeat before passing it.
forGlobalOnlyRestrict Shortcut matching to global ones; ordinary accelerators are not excluded.
booltrue when a matching item was found and activated.
AddCheckItemvoid
public void AddCheckItem(string label, int id = -1, Key accel = Key.None);Adds an initially unchecked checkbox item. Activation does not toggle checked; update the model and SetItemChecked in your handler.
| Name | Type | Default |
|---|---|---|
label | string | — |
id | int | -1 |
accel | Key | Key.None |
labelAdds an initially unchecked checkbox item. Activation does not toggle checked; update the model and SetItemChecked in your handler.
idCommand ID, separate from index; use a unique nonnegative value. -1 in ordinary additions assigns the current index, unlike AddSeparator.
accelAdds an initially unchecked checkbox item. Activation does not toggle checked; update the model and SetItemChecked in your handler.
AddCheckShortcutvoid
public void AddCheckShortcut(Shortcut shortcut, int id = -1, bool global = false);Adds a checkbox command with a shared Shortcut and a label from ResourceName. Initially unchecked; activation does not toggle checked. Update your model and call SetItemChecked in IdPressed. Echo repeats are disabled.
| Name | Type | Default |
|---|---|---|
shortcut | Shortcut | — |
id | int | -1 |
global | bool | false |
shortcutNon-null shared Shortcut with the required Events; ResourceName is copied into the initial item label.
idCommand ID; -1 assigns the current index. Prefer your own unique nonnegative ID.
globalInclude this Shortcut in global-only menu shortcut matching. Not OS-wide registration outside the application.
AddIconCheckItemvoid
public void AddIconCheckItem(Texture2D texture, string label, int id = -1, Key accel = Key.None);Adds a checkbox command with the original label, shared icon and optional accelerator. Initially unchecked; activation does not toggle it. Use SetItemChecked in IdPressed. id = -1 assigns the current index.
| Name | Type | Default |
|---|---|---|
texture | Texture2D | — |
label | string | — |
id | int | -1 |
accel | Key | Key.None |
textureShared icon Texture2D; the resource is not copied.
labelOriginal command label, separate from its ID and key binding.
idCommand ID; -1 assigns the current index. Prefer your own unique nonnegative ID.
accelKey with modifiers; Key.None disables the accelerator. Not a Shortcut object.
AddIconCheckShortcutvoid
public void AddIconCheckShortcut(Texture2D texture, Shortcut shortcut, int id = -1, bool global = false);Adds a checkbox command with a shared icon and Shortcut; label is copied from ResourceName. Activation does not change checked; echo repeats are disabled. Set the state explicitly in IdPressed.
| Name | Type | Default |
|---|---|---|
texture | Texture2D | — |
shortcut | Shortcut | — |
id | int | -1 |
global | bool | false |
textureShared icon Texture2D; the resource is not copied.
shortcutNon-null shared Shortcut with the required Events; ResourceName is copied into the initial item label.
idCommand ID; -1 assigns the current index. Prefer your own unique nonnegative ID.
globalInclude this Shortcut in global-only menu shortcut matching. Not OS-wide registration outside the application.
AddIconItemvoid
public void AddIconItem(Texture2D texture, string label, int id = -1, Key accel = Key.None);Adds an ordinary command with the original label and a shared Texture2D. accel sets a separate keyboard accelerator; Key.None disables it. id = -1 assigns the current index. This does not create a Shortcut resource or a checkable item.
| Name | Type | Default |
|---|---|---|
texture | Texture2D | — |
label | string | — |
id | int | -1 |
accel | Key | Key.None |
textureShared icon Texture2D; the resource is not copied.
labelOriginal command label, separate from its ID and key binding.
idCommand ID; -1 assigns the current index. Prefer your own unique nonnegative ID.
accelKey with modifiers; Key.None disables the accelerator. Not a Shortcut object.
AddIconRadioCheckItemvoid
public void AddIconRadioCheckItem(Texture2D texture, string label, int id = -1, Key accel = Key.None);Adds a radio command with the original label, shared icon and optional accelerator. Initially unchecked; the application implements toggling and mutual exclusion. id = -1 assigns the current index.
| Name | Type | Default |
|---|---|---|
texture | Texture2D | — |
label | string | — |
id | int | -1 |
accel | Key | Key.None |
textureShared icon Texture2D; the resource is not copied.
labelOriginal command label, separate from its ID and key binding.
idCommand ID; -1 assigns the current index. Prefer your own unique nonnegative ID.
accelKey with modifiers; Key.None disables the accelerator. Not a Shortcut object.
AddIconRadioCheckShortcutvoid
public void AddIconRadioCheckShortcut(Texture2D texture, Shortcut shortcut, int id = -1, bool global = false);Adds a radio command with a shared icon and Shortcut; label is copied from ResourceName. Activation neither changes checked nor clears neighboring radio flags; echo repeats are disabled.
| Name | Type | Default |
|---|---|---|
texture | Texture2D | — |
shortcut | Shortcut | — |
id | int | -1 |
global | bool | false |
textureShared icon Texture2D; the resource is not copied.
shortcutNon-null shared Shortcut with the required Events; ResourceName is copied into the initial item label.
idCommand ID; -1 assigns the current index. Prefer your own unique nonnegative ID.
globalInclude this Shortcut in global-only menu shortcut matching. Not OS-wide registration outside the application.
AddIconShortcut2 overloads
public void AddIconShortcut(Texture2D texture, Shortcut shortcut, int id, bool global);Short overload adds a command with allowEcho = false. Use the overload with allowEcho for an explicit repeat policy. Label is copied from ResourceName; global does not mean an OS-wide hotkey.
| Name | Type | Default |
|---|---|---|
texture | Texture2D | — |
shortcut | Shortcut | — |
id | int | — |
global | bool | — |
textureShared icon Texture2D; the resource is not copied.
shortcutNon-null shared Shortcut with the required Events; ResourceName is copied into the initial item label.
idCommand ID; -1 assigns the current index. Prefer your own unique nonnegative ID.
globalInclude this Shortcut in global-only menu shortcut matching. Not OS-wide registration outside the application.
public void AddIconShortcut(Texture2D texture, Shortcut shortcut, int id = -1, bool global = false, bool allowEcho = false);Adds an ordinary command with an icon and a shared Shortcut. Label is copied from ResourceName; this is not a checkbox. global does not register an OS-wide hotkey. Repeats require allowEcho = true; default false. Icon and Shortcut resources are not copied.
| Name | Type | Default |
|---|---|---|
texture | Texture2D | — |
shortcut | Shortcut | — |
id | int | -1 |
global | bool | false |
allowEcho | bool | false |
textureShared icon Texture2D; the resource is not copied.
shortcutNon-null shared Shortcut with the required Events; ResourceName is copied into the initial item label.
idCommand ID; -1 assigns the current index. Prefer your own unique nonnegative ID.
globalInclude this Shortcut in global-only menu shortcut matching. Not OS-wide registration outside the application.
allowEchoAllow repeated echo events; default false.
AddItemvoid
public void AddItem(string label, int id = -1, Key accel = Key.None);Adds a command with text, ID and optional accelerator. id = -1 assigns the current index; use a unique nonnegative ID for a stable command.
| Name | Type | Default |
|---|---|---|
label | string | — |
id | int | -1 |
accel | Key | Key.None |
labelAdds a command with text, ID and optional accelerator. id = -1 assigns the current index; use a unique nonnegative ID for a stable command.
idCommand ID, separate from index; use a unique nonnegative value. -1 in ordinary additions assigns the current index, unlike AddSeparator.
accelAdds a command with text, ID and optional accelerator. id = -1 assigns the current index; use a unique nonnegative ID for a stable command.
AddMultistateItemvoid
public void AddMultistateItem(string label, int maxStates, int defaultState = 0, int id = -1, Key accel = Key.None);Adds an item with state count and initial state index. Validate maxStates > 0 and defaultState range. Activation does not automatically advance state.
| Name | Type | Default |
|---|---|---|
label | string | — |
maxStates | int | — |
defaultState | int | 0 |
id | int | -1 |
accel | Key | Key.None |
labelAdds an item with state count and initial state index. Validate maxStates > 0 and defaultState range. Activation does not automatically advance state.
maxStatesAdds an item with state count and initial state index. Validate maxStates > 0 and defaultState range. Activation does not automatically advance state.
defaultStateAdds an item with state count and initial state index. Validate maxStates > 0 and defaultState range. Activation does not automatically advance state.
idCommand ID, separate from index; use a unique nonnegative value. -1 in ordinary additions assigns the current index, unlike AddSeparator.
accelAdds an item with state count and initial state index. Validate maxStates > 0 and defaultState range. Activation does not automatically advance state.
AddRadioCheckItemvoid
public void AddRadioCheckItem(string label, int id = -1, Key accel = Key.None);Adds an initially unchecked radio item. Does not create an exclusive group; clear other options yourself.
| Name | Type | Default |
|---|---|---|
label | string | — |
id | int | -1 |
accel | Key | Key.None |
labelAdds an initially unchecked radio item. Does not create an exclusive group; clear other options yourself.
idCommand ID, separate from index; use a unique nonnegative value. -1 in ordinary additions assigns the current index, unlike AddSeparator.
accelAdds an initially unchecked radio item. Does not create an exclusive group; clear other options yourself.
AddRadioCheckShortcutvoid
public void AddRadioCheckShortcut(Shortcut shortcut, int id = -1, bool global = false);Adds a radio command with a shared Shortcut and a label from ResourceName. Initially unchecked; neither automatic toggling nor mutual exclusion with neighboring radio items is provided. Set the required states in IdPressed. Echo repeats are disabled.
| Name | Type | Default |
|---|---|---|
shortcut | Shortcut | — |
id | int | -1 |
global | bool | false |
shortcutNon-null shared Shortcut with the required Events; ResourceName is copied into the initial item label.
idCommand ID; -1 assigns the current index. Prefer your own unique nonnegative ID.
globalInclude this Shortcut in global-only menu shortcut matching. Not OS-wide registration outside the application.
AddSeparatorvoid
public void AddSeparator(string label = "", int id = -1);Adds a separator that occupies an index but is not an activation command. Stores id directly: -1 is not replaced with an index. Label is optional.
| Name | Type | Default |
|---|---|---|
label | string | "" |
id | int | -1 |
labelAdds a separator that occupies an index but is not an activation command. Stores id directly: -1 is not replaced with an index. Label is optional.
idCommand ID, separate from index; use a unique nonnegative value. -1 in ordinary additions assigns the current index, unlike AddSeparator.
AddShortcut2 overloads
public void AddShortcut(Shortcut shortcut, int id, bool global);Short overload adds a command with allowEcho = false. Use the overload with allowEcho for an explicit repeat policy. Label is copied from ResourceName; global does not mean an OS-wide hotkey.
| Name | Type | Default |
|---|---|---|
shortcut | Shortcut | — |
id | int | — |
global | bool | — |
shortcutNon-null shared Shortcut with the required Events; ResourceName is copied into the initial item label.
idCommand ID; -1 assigns the current index. Prefer your own unique nonnegative ID.
globalInclude this Shortcut in global-only menu shortcut matching. Not OS-wide registration outside the application.
public void AddShortcut(Shortcut shortcut, int id = -1, bool global = false, bool allowEcho = false);Adds an ordinary command with a shared Shortcut resource; initial label is copied from ResourceName. id = -1 assigns the current index; use a stable nonnegative ID for routing. global concerns menu shortcut handling rather than OS-wide registration outside the application. allowEcho permits repeats; default false. Handle the action in IdPressed.
| Name | Type | Default |
|---|---|---|
shortcut | Shortcut | — |
id | int | -1 |
global | bool | false |
allowEcho | bool | false |
shortcutNon-null shared Shortcut with the required Events; ResourceName is copied into the initial item label.
idCommand ID; -1 assigns the current index. Prefer your own unique nonnegative ID.
globalInclude this Shortcut in global-only menu shortcut matching. Not OS-wide registration outside the application.
allowEchoAllow repeated echo events; default false.
AddSubmenuEntityItemvoid
public void AddSubmenuEntityItem(string label, PopupMenu submenu, int id = -1);Adds an item referencing a PopupMenu. Submenu must be parentless or already a child of this menu; a parentless object is adopted. Keep a clear owner/item relationship.
| Name | Type | Default |
|---|---|---|
label | string | — |
submenu | PopupMenu | — |
id | int | -1 |
labelAdds an item referencing a PopupMenu. Submenu must be parentless or already a child of this menu; a parentless object is adopted. Keep a clear owner/item relationship.
submenuAdds an item referencing a PopupMenu. Submenu must be parentless or already a child of this menu; a parentless object is adopted. Keep a clear owner/item relationship.
idCommand ID, separate from index; use a unique nonnegative value. -1 in ordinary additions assigns the current index, unlike AddSeparator.
AddSubmenuItemvoid · Deprecated
public void AddSubmenuItem(string label, string submenu, int id = -1);Adds an existing submenu by relative path. Prefer typed AddSubmenuEntityItem in the installed SDK; do not supply an arbitrary nonexistent menu name.
| Name | Type | Default |
|---|---|---|
label | string | — |
submenu | string | — |
id | int | -1 |
labelAdds an existing submenu by relative path. Prefer typed AddSubmenuEntityItem in the installed SDK; do not supply an arbitrary nonexistent menu name.
submenuAdds an existing submenu by relative path. Prefer typed AddSubmenuEntityItem in the installed SDK; do not supply an arbitrary nonexistent menu name.
idCommand ID, separate from index; use a unique nonnegative value. -1 in ordinary additions assigns the current index, unlike AddSeparator.
Clear2 overloads
public void Clear();Removes records and resets focus. No argument or false retains child submenus. true detaches and schedules freeing only submenus referenced by current items; does not free previously retained unreferenced children.
public void Clear(bool freeSubmenus = false);Removes records and resets focus. No argument or false retains child submenus. true detaches and schedules freeing only submenus referenced by current items; does not free previously retained unreferenced children.
| Name | Type | Default |
|---|---|---|
freeSubmenus | bool | false |
freeSubmenustrue detaches and schedules freeing currently referenced submenus; false retains them in the tree.
GetAllowSearchbool
public bool GetAllowSearch();Enables navigation by the initial letters of original item labels, default true. This navigates rather than executing commands or providing a filter field. This letter-navigation mode is unused while the menu search bar is visible.
boolEnables navigation by the initial letters of original item labels, default true. This navigates rather than executing commands or providing a filter field. This letter-navigation mode is unused while the menu search bar is visible.
GetFocusedItemint
public int GetFocusedItem();Returns the current highlight index, or -1. This is an index rather than a command ID or execution result.
intReturns the current highlight index, or -1. This is an index rather than a command ID or execution result.
GetItemAcceleratorKey
public Key GetItemAccelerator(int index);Returns the stored accelerator Key rather than a Shortcut object.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
KeyAccelerator Key, or Key.None.
GetItemAutoTranslateModeEntity.AutoTranslateModeEnum
public Entity.AutoTranslateModeEnum GetItemAutoTranslateMode(int index);Returns the stored translation policy, default Inherit, rather than whether a translation exists for this label.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexExisting item index rather than ID. Reviewed SetItem* methods accept negative indices from the end; getters and ScrollToItem require an ordinary valid index.
Entity.AutoTranslateModeEnumReturns the stored translation policy, default Inherit, rather than whether a translation exists for this label.
GetItemCountint
public int GetItemCount();Record count including separators. Setter requires ≥ 0; growth adds empty records with index-based IDs, shrinking discards the tail. Does not manage the lifetime of every child submenu.
intRecord count including separators.
GetItemIconTexture2D
public Texture2D GetItemIcon(int index);Returns the shared Texture2D, or null. This is the original resource rather than a menu-sized copy. Requires an ordinary valid index.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexOrdinary valid item index. SetItem* also accepts a negative index from the end; SetFocusedItem uses -1 only to clear.
Texture2DReturns the shared Texture2D, or null. This is the original resource rather than a menu-sized copy. Requires an ordinary valid index.
GetItemIconMaxWidthint
public int GetItemIconMaxWidth(int index);Returns the stored item limit rather than drawn width or the effective theme limit. Default 0.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexOrdinary valid item index. SetItem* also accepts a negative index from the end; SetFocusedItem uses -1 only to clear.
intReturns the stored item limit rather than drawn width or the effective theme limit. Default 0.
GetItemIconModulateColor
public Color GetItemIconModulate(int index);Returns the stored icon RGBA multiplier, white by default.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexOrdinary valid item index. SetItem* also accepts a negative index from the end; SetFocusedItem uses -1 only to clear.
ColorReturns the stored icon RGBA multiplier, white by default.
GetItemIdint
public int GetItemId(int index);Returns the stored ID at an existing index. Activation can substitute the index for negative IDs. Validate the index first: an invalid getter is not a command lookup.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
intStored record ID.
GetItemIndentint
public int GetItemIndent(int index);Returns the stored indentation level, default 0, rather than the resulting offset.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexOrdinary valid item index. SetItem* also accepts a negative index from the end; SetFocusedItem uses -1 only to clear.
intReturns the stored indentation level, default 0, rather than the resulting offset.
GetItemIndexint
public int GetItemIndex(int id);Returns the first current index with the ID, or -1. Duplicates are not prevented; resolve again after reorder/removal.
| Name | Type | Default |
|---|---|---|
id | int | — |
idCommand ID, separate from index; use a unique nonnegative value. -1 in ordinary additions assigns the current index, unlike AddSeparator.
intFirst matching-ID index, or -1.
GetItemLanguagestring
public string GetItemLanguage(int index);Returns the stored item language code, empty by default. Not necessarily the application’s current locale.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexExisting item index rather than ID. Reviewed SetItem* methods accept negative indices from the end; getters and ScrollToItem require an ordinary valid index.
stringReturns the stored item language code, empty by default. Not necessarily the application’s current locale.
GetItemMetadataVariant
public Variant GetItemMetadata(int index);Returns metadata Variant, Nil when unassigned. Validate the expected type before conversion.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
VariantMetadata Variant, or Nil.
GetItemMultistateint
public int GetItemMultistate(int index);Returns stored state index rather than state count.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
intStored state index.
GetItemMultistateMaxint
public int GetItemMultistateMax(int index);Returns state count; nonpositive values disable ToggleItemMultistate advancement.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
intState count.
GetItemShortcutShortcut
public Shortcut GetItemShortcut(int index);Returns the shared Shortcut resource, or null. This is not a copy: changing its Events affects items using it. Changing ResourceName does not itself replace item text; call SetItemText explicitly. Requires an ordinary valid index.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent item index rather than ID. Setter accepts negative indices from the end; getter requires an ordinary valid index.
ShortcutReturns the shared Shortcut resource, or null. This is not a copy: changing its Events affects items using it. Changing ResourceName does not itself replace item text; call SetItemText explicitly. Requires an ordinary valid index.
GetItemSubmenustring · Deprecated
public string GetItemSubmenu(int index);Returns stored submenu name/path. Prefer GetItemSubmenuEntity in the installed SDK when you need the object.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
stringStored submenu name/path.
GetItemSubmenuEntityPopupMenu
public PopupMenu GetItemSubmenuEntity(int index);Shared submenu object, or null. Does not change tree ownership/lifetime.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
PopupMenuShared PopupMenu, or null.
GetItemTextstring
public string GetItemText(int index);Returns original item text rather than displayed translation or command ID.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
stringOriginal item text.
GetItemTextDirectionControl.TextDirection
public Control.TextDirection GetItemTextDirection(int index);Returns the stored text-direction policy, default Auto, rather than the resolved direction of each line.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexExisting item index rather than ID. Reviewed SetItem* methods accept negative indices from the end; getters and ScrollToItem require an ordinary valid index.
Control.TextDirectionReturns the stored text-direction policy, default Auto, rather than the resolved direction of each line.
GetItemTooltipstring
public string GetItemTooltip(int index);Returns the stored tooltip string regardless of whether it is currently displayed.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexOrdinary valid item index. SetItem* also accepts a negative index from the end; SetFocusedItem uses -1 only to clear.
stringReturns the stored tooltip string regardless of whether it is currently displayed.
GetSearchBarFuzzySearchMaxMissesint
public int GetSearchBarFuzzySearchMaxMisses();Fuzzy matcher miss allowance: integer 0 or greater, default 2. This configures matching rather than result count or a guaranteed Levenshtein distance.
intFuzzy matcher miss allowance: integer 0 or greater, default 2. This configures matching rather than result count or a guaranteed Levenshtein distance.
GetSearchBarMinItemCountint
public int GetSearchBarMinItemCount();Minimum number of non-separator items needed to show the enabled search field. Must be 0 or greater; default 0. Does not remove records or change IDs.
intMinimum number of non-separator items needed to show the enabled search field. Must be 0 or greater; default 0. Does not remove records or change IDs.
GetShrinkHeightbool
public bool GetShrinkHeight();Fit the local popup height to its computed content minimum when preparing it, default true. false retains the requested height subject to window constraints. The setter does not itself open or resize an already displayed window.
boolFit the local popup height to its computed content minimum when preparing it, default true. false retains the requested height subject to window constraints. The setter does not itself open or resize an already displayed window.
GetShrinkWidthbool
public bool GetShrinkWidth();Fit the local popup width to its computed content minimum when preparing it, default true. false retains the requested width subject to window constraints. The setter does not itself open the menu.
boolFit the local popup width to its computed content minimum when preparing it, default true. false retains the requested width subject to window constraints. The setter does not itself open the menu.
GetSubmenuPopupDelayfloat
public float GetSubmenuPopupDelay();Hover submenu opening delay in seconds; default 0.2. A value ≤ 0 becomes 0.01; positive values below 0.01 are retained. Does not provide zero delay or trigger opening by itself.
floatHover submenu opening delay in seconds; default 0.2. A value ≤ 0 becomes 0.01; positive values below 0.01 are retained. Does not provide zero delay or trigger opening by itself.
GetSystemMenuNativeMenu.SystemMenus
public NativeMenu.SystemMenus GetSystemMenu();NativeMenu.SystemMenusGetSystemMenuRootstring
public string GetSystemMenuRoot();stringIsHideOnCheckableItemSelectionbool
public bool IsHideOnCheckableItemSelection();Hide on check/radio activation, default true. Does not toggle checked itself.
boolCheck/radio hiding flag.
IsHideOnItemSelectionbool
public bool IsHideOnItemSelection();Hide on ordinary command activation, default true. Does not enable/disable handler execution.
boolOrdinary-command hiding flag.
IsHideOnStateItemSelectionbool
public bool IsHideOnStateItemSelection();Hide on multistate activation, default false. Does not modify state.
boolMultistate hiding flag.
IsItemCheckablebool
public bool IsItemCheckable(int index);true for checkbox or radio type. Does not mean the item is checked.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
booltrue for checkbox/radio type.
IsItemCheckedbool
public bool IsItemChecked(int index);Stored checked flag independently of checkable type.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
boolStored checked flag.
IsItemDisabledbool
public bool IsItemDisabled(int index);Item disabled flag rather than checkbox state.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
boolRecord disabled flag.
IsItemIndeterminatebool
public bool IsItemIndeterminate(int index);Stored indeterminate flag.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
boolStored indeterminate flag.
IsItemRadioCheckablebool
public bool IsItemRadioCheckable(int index);true only for radio type. Does not imply an exclusive group.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
booltrue for radio type.
IsItemSeparatorbool
public bool IsItemSeparator(int index);Separator flag; separators cannot be used as ordinary activation commands.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
boolSeparator flag.
IsItemShortcutDisabledbool
public bool IsItemShortcutDisabled(int index);Shortcut-event handling disable flag, separate from Disabled.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
boolShortcut-event disable flag.
IsNativeMenubool
public bool IsNativeMenu();Returns true if the system native menu is supported and currently used by this PopupMenu.
boolIsPreferNativeMenubool
public bool IsPreferNativeMenu();boolIsSearchBarEnabledbool
public bool IsSearchBarEnabled();Enables the menu filter field, default false. It appears at SearchBarMinItemCount; separators do not count toward the threshold. While the field is visible, AllowSearch letter navigation is unused. This configures the local menu rather than guaranteeing an equivalent OS-native field.
boolEnables the menu filter field, default false. It appears at SearchBarMinItemCount; separators do not count toward the threshold. While the field is visible, AllowSearch letter navigation is unused. This configures the local menu rather than guaranteeing an equivalent OS-native field.
IsSearchBarFuzzySearchEnabledbool
public bool IsSearchBarFuzzySearchEnabled();Enables fuzzy matching in the search field, default true. false uses the matcher’s exact-token mode rather than promising byte-for-byte equality of the entire label. Search uses original item and submenu labels.
boolEnables fuzzy matching in the search field, default true. false uses the matcher’s exact-token mode rather than promising byte-for-byte equality of the entire label. Search uses original item and submenu labels.
IsSystemMenubool
public bool IsSystemMenu();Returns true if the menu is bound to the special system menu.
boolRemoveItemvoid
public void RemoveItem(int index);Removes a record and shifts later indices without renumbering IDs. Does not automatically free a submenu object; resolve command indices again after mutation.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
ScrollToItemvoid
public void ScrollToItem(int index);Scrolls the local list toward the row at an ordinary valid index. Uses cached geometry; call after layout is established. Does not select, highlight or execute the item.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexExisting item index rather than ID. Reviewed SetItem* methods accept negative indices from the end; getters and ScrollToItem require an ordinary valid index.
SetAllowSearchvoid
public void SetAllowSearch(bool allow);Enables navigation by the initial letters of original item labels, default true. This navigates rather than executing commands or providing a filter field. This letter-navigation mode is unused while the menu search bar is visible.
| Name | Type | Default |
|---|---|---|
allow | bool | — |
allowEnable letter navigation while the search bar is not visible.
SetFocusedItemvoid
public void SetFocusedItem(int index);Sets the highlighted item index; -1 clears it. Does not grab window focus or execute a command. Does not reject disabled items or separators; choose an eligible item yourself. Emits neither IdFocused nor IdPressed.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexOrdinary valid item index. SetItem* also accepts a negative index from the end; SetFocusedItem uses -1 only to clear.
SetHideOnCheckableItemSelectionvoid
public void SetHideOnCheckableItemSelection(bool enable);Hide on check/radio activation, default true. Does not toggle checked itself.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableHide on check/radio activation, default true. Does not toggle checked itself.
SetHideOnItemSelectionvoid
public void SetHideOnItemSelection(bool enable);Hide on ordinary command activation, default true. Does not enable/disable handler execution.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableHide on ordinary command activation, default true. Does not enable/disable handler execution.
SetHideOnStateItemSelectionvoid
public void SetHideOnStateItemSelection(bool enable);Hide on multistate activation, default false. Does not modify state.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableHide on multistate activation, default false. Does not modify state.
SetItemAcceleratorvoid
public void SetItemAccelerator(int index, Key accel);Sets an item Key accelerator. Key.None disables it; does not replace Shortcut or execute the command. Supports negative indices.
| Name | Type | Default |
|---|---|---|
index | int | — |
accel | Key | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
accelSets an item Key accelerator. Key.None disables it; does not replace Shortcut or execute the command. Supports negative indices.
SetItemAsCheckablevoid
public void SetItemAsCheckable(int index, bool enable);true selects checkbox type, replacing radio; false clears checkable type. Does not normalize other items’ checked flags. Supports negative indices.
| Name | Type | Default |
|---|---|---|
index | int | — |
enable | bool | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
enabletrue selects checkbox type, replacing radio; false clears checkable type. Does not normalize other items’ checked flags. Supports negative indices.
SetItemAsRadioCheckablevoid
public void SetItemAsRadioCheckable(int index, bool enable);true selects radio type; false clears checkable type without creating a group. Implement exclusivity in your model/handler. Supports negative indices.
| Name | Type | Default |
|---|---|---|
index | int | — |
enable | bool | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
enabletrue selects radio type; false clears checkable type without creating a group. Implement exclusivity in your model/handler. Supports negative indices.
SetItemAsSeparatorvoid
public void SetItemAsSeparator(int index, bool enable);Changes separator type without removing the record or changing ID. This setter does not emit MenuChanged in the current implementation. Supports negative indices.
| Name | Type | Default |
|---|---|---|
index | int | — |
enable | bool | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
enableChanges separator type without removing the record or changing ID. This setter does not emit MenuChanged in the current implementation. Supports negative indices.
SetItemAutoTranslateModevoid
public void SetItemAutoTranslateMode(int index, Entity.AutoTranslateModeEnum mode);Sets label translation policy: Inherit follows the menu setting, Always requests translation, Disabled retains the original string. Requires loaded translations and a suitable locale; does not generate translations. GetItemText is unchanged. Accepts negative indices.
| Name | Type | Default |
|---|---|---|
index | int | — |
mode | Entity.AutoTranslateModeEnum | — |
indexExisting item index rather than ID. Reviewed SetItem* methods accept negative indices from the end; getters and ScrollToItem require an ordinary valid index.
modeInherit, Always or Disabled; a policy rather than a translation dictionary.
SetItemCheckedvoid
public void SetItemChecked(int index, bool @checked);Sets checked without activation. A changed value clears indeterminate; reassigning the same checked value is a no-op and can retain indeterminate. Supports negative indices.
| Name | Type | Default |
|---|---|---|
index | int | — |
checked | bool | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
checkedSets checked without activation. A changed value clears indeterminate; reassigning the same checked value is a no-op and can retain indeterminate. Supports negative indices.
SetItemCountvoid
public void SetItemCount(int count);Record count including separators. Setter requires ≥ 0; growth adds empty records with index-based IDs, shrinking discards the tail. Does not manage the lifetime of every child submenu.
| Name | Type | Default |
|---|---|---|
count | int | — |
countRecord count including separators. Setter requires ≥ 0; growth adds empty records with index-based IDs, shrinking discards the tail. Does not manage the lifetime of every child submenu.
SetItemDisabledvoid
public void SetItemDisabled(int index, bool disabled);Disables an item for ordinary input and ActivateItemByEvent without removing it. Programmatic state setters remain available. Supports negative indices.
| Name | Type | Default |
|---|---|---|
index | int | — |
disabled | bool | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
disabledDisables an item for ordinary input and ActivateItemByEvent without removing it. Programmatic state setters remain available. Supports negative indices.
SetItemIconvoid
public void SetItemIcon(int index, Texture2D icon);Sets a shared Texture2D icon; does not copy the resource. null removes the icon. Accepts a negative index from the end. A change emits MenuChanged.
| Name | Type | Default |
|---|---|---|
index | int | — |
icon | Texture2D | — |
indexOrdinary valid item index. SetItem* also accepts a negative index from the end; SetFocusedItem uses -1 only to clear.
iconShared Texture2D, or null to remove the icon.
SetItemIconMaxWidthvoid
public void SetItemIconMaxWidth(int index, int width);Sets an icon width limit in local UI units. Positive item and theme limits combine using the smaller value. A wider icon scales down with its aspect ratio preserved; smaller icons are not enlarged. A nonpositive value disables only the item limit. Accepts negative indices.
| Name | Type | Default |
|---|---|---|
index | int | — |
width | int | — |
indexOrdinary valid item index. SetItem* also accepts a negative index from the end; SetFocusedItem uses -1 only to clear.
widthPositive width limit in local UI units; ≤ 0 disables the item limit, not the theme limit.
SetItemIconModulatevoid
public void SetItemIconModulate(int index, Color modulate);Sets the icon RGBA multiplier; white retains its color. Does not tint text or modify the source Texture2D. Accepts negative indices. Requests redraw without MenuChanged.
| Name | Type | Default |
|---|---|---|
index | int | — |
modulate | Color | — |
indexOrdinary valid item index. SetItem* also accepts a negative index from the end; SetFocusedItem uses -1 only to clear.
modulateIcon RGBA multiplier; white (1,1,1,1) retains color.
SetItemIdvoid
public void SetItemId(int index, int id);Changes a record ID without moving it. Does not enforce uniqueness; use a nonnegative value for stable IdPressed. Supports a negative record index from the end.
| Name | Type | Default |
|---|---|---|
index | int | — |
id | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
idCommand ID, separate from index; use a unique nonnegative value. -1 in ordinary additions assigns the current index, unlike AddSeparator.
SetItemIndentvoid
public void SetItemIndent(int index, int indent);Sets an indentation level: local offset is indent × the theme indent constant. This is neither a pixel count nor submenu creation. Normally use a nonnegative level. Accepts a negative item index.
| Name | Type | Default |
|---|---|---|
index | int | — |
indent | int | — |
indexOrdinary valid item index. SetItem* also accepts a negative index from the end; SetFocusedItem uses -1 only to clear.
indentIndentation level multiplied by the theme indent constant; normally 0 or greater.
SetItemIndeterminatevoid
public void SetItemIndeterminate(int index, bool indeterminate);Changes the indeterminate flag; an actual change resets checked to false. Reassigning the same value does nothing. Supports negative indices.
| Name | Type | Default |
|---|---|---|
index | int | — |
indeterminate | bool | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
indeterminateChanges the indeterminate flag; an actual change resets checked to false. Reassigning the same value does nothing. Supports negative indices.
SetItemIndexvoid
public void SetItemIndex(int index, int targetIndex);Moves the complete record, including ID/metadata/state, to final targetIndex. Both parameters accept indices from the end. Use ItemCount - 1 or -1 for the end rather than ItemCount.
| Name | Type | Default |
|---|---|---|
index | int | — |
targetIndex | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
targetIndexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
SetItemLanguagevoid
public void SetItemLanguage(int index, string language);Sets the item text-shaping language hint; an empty string uses the current language. Does not translate the original text, change GetItemText or switch the application locale. Accepts negative indices from the end.
| Name | Type | Default |
|---|---|---|
index | int | — |
language | string | — |
indexExisting item index rather than ID. Reviewed SetItem* methods accept negative indices from the end; getters and ScrollToItem require an ordinary valid index.
languageText-shaping language code; an empty string uses the current language.
SetItemMetadatavoid
public void SetItemMetadata(int index, Variant metadata);Stores item Variant data. Moves with the record; Array/Dictionary can retain shared contents. Supports negative indices.
| Name | Type | Default |
|---|---|---|
index | int | — |
metadata | Variant | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
metadataStores item Variant data. Moves with the record; Array/Dictionary can retain shared contents. Supports negative indices.
SetItemMultistatevoid
public void SetItemMultistate(int index, int state);Sets state without activation. Setter does not clamp range: validate 0 ≤ state < maxStates yourself. Supports negative record indices.
| Name | Type | Default |
|---|---|---|
index | int | — |
state | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
stateSets state without activation. Setter does not clamp range: validate 0 ≤ state < maxStates yourself. Supports negative record indices.
SetItemMultistateMaxvoid
public void SetItemMultistateMax(int index, int maxStates);Sets state count without normalizing current state. Use a positive value for active multistate and update state separately. Supports negative indices.
| Name | Type | Default |
|---|---|---|
index | int | — |
maxStates | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
maxStatesSets state count without normalizing current state. Use a positive value for active multistate and update state separately. Supports negative indices.
SetItemShortcutvoid
public void SetItemShortcut(int index, Shortcut shortcut, bool global = false);Replaces an existing item’s shared Shortcut and global flag; null removes the Shortcut. Does not change its label, icon, checked state or separate accelerator. Does not set allowEcho: the policy established when adding the item is retained. Accepts negative indices from the end. Updated Events on the shared Shortcut are used by subsequent matches.
| Name | Type | Default |
|---|---|---|
index | int | — |
shortcut | Shortcut | — |
global | bool | false |
indexCurrent item index rather than ID. Setter accepts negative indices from the end; getter requires an ordinary valid index.
shortcutShared Shortcut, or null to remove it. Events supplies input alternatives; ResourceName does not replace the current label.
globalInclude this Shortcut in global-only menu shortcut matching. Not OS-wide registration outside the application.
SetItemShortcutDisabledvoid
public void SetItemShortcutDisabled(int index, bool disabled);Disables item shortcut-event handling; also excludes its accelerator in ActivateItemByEvent. Does not disable the whole item for ordinary clicks. Supports negative indices.
| Name | Type | Default |
|---|---|---|
index | int | — |
disabled | bool | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
disabledDisables item shortcut-event handling; also excludes its accelerator in ActivateItemByEvent. Does not disable the whole item for ordinary clicks. Supports negative indices.
SetItemSubmenuvoid · Deprecated
public void SetItemSubmenu(int index, string submenu);Legacy setter in the installed SDK: resolves an existing PopupMenu by relative path. Prefer SetItemSubmenuEntity. An empty string is not a reliable way to clear a submenu; the typed setter also rejects null.
| Name | Type | Default |
|---|---|---|
index | int | — |
submenu | string | — |
indexExisting item index rather than ID. Reviewed SetItem* methods accept negative indices from the end; getters and ScrollToItem require an ordinary valid index.
submenuRelative path to an existing PopupMenu.
SetItemSubmenuEntityvoid
public void SetItemSubmenuEntity(int index, PopupMenu submenu);Assigns a non-null PopupMenu to an existing item. A parentless submenu becomes a child of this menu; objects owned by another parent are rejected. Replacement neither frees nor detaches the previous submenu. Do not pass null to clear it: remove/recreate the item, then separately clean up an unused child. Accepts negative indices.
| Name | Type | Default |
|---|---|---|
index | int | — |
submenu | PopupMenu | — |
indexExisting item index rather than ID. Reviewed SetItem* methods accept negative indices from the end; getters and ScrollToItem require an ordinary valid index.
submenuNon-null PopupMenu that is parentless or already a child of this menu.
SetItemTextvoid
public void SetItemText(int index, string text);Changes original text and refreshes translation/shaping rather than ID. Supports negative indexing from the end; does not activate the command.
| Name | Type | Default |
|---|---|---|
index | int | — |
text | string | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
textChanges original text and refreshes translation/shaping rather than ID. Supports negative indexing from the end; does not activate the command.
SetItemTextDirectionvoid
public void SetItemTextDirection(int index, Control.TextDirection direction);Sets the item’s base text-shaping direction. Auto derives it from text; this neither translates text nor mirrors the entire window layout. GetItemText remains original. Accepts negative indices.
| Name | Type | Default |
|---|---|---|
index | int | — |
direction | Control.TextDirection | — |
indexExisting item index rather than ID. Reviewed SetItem* methods accept negative indices from the end; getters and ScrollToItem require an ordinary valid index.
directionBase Control.TextDirection policy, default Auto.
SetItemTooltipvoid
public void SetItemTooltip(int index, string tooltip);Stores tooltip text; an empty string removes its text. Does not immediately open a tooltip or change the command label. Accepts negative indices; assigning the same value does nothing.
| Name | Type | Default |
|---|---|---|
index | int | — |
tooltip | string | — |
indexOrdinary valid item index. SetItem* also accepts a negative index from the end; SetFocusedItem uses -1 only to clear.
tooltipTooltip text; an empty string removes its text.
SetPreferNativeMenuvoid
public void SetPreferNativeMenu(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetSearchBarEnabledvoid
public void SetSearchBarEnabled(bool enabled);Enables the menu filter field, default false. It appears at SearchBarMinItemCount; separators do not count toward the threshold. While the field is visible, AllowSearch letter navigation is unused. This configures the local menu rather than guaranteeing an equivalent OS-native field.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledEnable the specified local menu feature.
SetSearchBarFuzzySearchEnabledvoid
public void SetSearchBarFuzzySearchEnabled(bool enabled);Enables fuzzy matching in the search field, default true. false uses the matcher’s exact-token mode rather than promising byte-for-byte equality of the entire label. Search uses original item and submenu labels.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledEnable the specified local menu feature.
SetSearchBarFuzzySearchMaxMissesvoid
public void SetSearchBarFuzzySearchMaxMisses(int maxMisses);Fuzzy matcher miss allowance: integer 0 or greater, default 2. This configures matching rather than result count or a guaranteed Levenshtein distance.
| Name | Type | Default |
|---|---|---|
maxMisses | int | — |
maxMissesSearch matcher allowance, integer 0 or greater.
SetSearchBarMinItemCountvoid
public void SetSearchBarMinItemCount(int count);Minimum number of non-separator items needed to show the enabled search field. Must be 0 or greater; default 0. Does not remove records or change IDs.
| Name | Type | Default |
|---|---|---|
count | int | — |
countNon-separator item-count threshold, 0 or greater.
SetShrinkHeightvoid
public void SetShrinkHeight(bool shrink);Fit the local popup height to its computed content minimum when preparing it, default true. false retains the requested height subject to window constraints. The setter does not itself open or resize an already displayed window.
| Name | Type | Default |
|---|---|---|
shrink | bool | — |
shrinkFit size along this axis when preparing the popup.
SetShrinkWidthvoid
public void SetShrinkWidth(bool shrink);Fit the local popup width to its computed content minimum when preparing it, default true. false retains the requested width subject to window constraints. The setter does not itself open the menu.
| Name | Type | Default |
|---|---|---|
shrink | bool | — |
shrinkFit size along this axis when preparing the popup.
SetSubmenuPopupDelayvoid
public void SetSubmenuPopupDelay(float seconds);Hover submenu opening delay in seconds; default 0.2. A value ≤ 0 becomes 0.01; positive values below 0.01 are retained. Does not provide zero delay or trigger opening by itself.
| Name | Type | Default |
|---|---|---|
seconds | float | — |
secondsDelay in seconds; ≤ 0 becomes 0.01.
SetSystemMenuvoid
public void SetSystemMenu(NativeMenu.SystemMenus systemMenuId);| Name | Type | Default |
|---|---|---|
systemMenuId | NativeMenu.SystemMenus | — |
SetSystemMenuRootvoid
public void SetSystemMenuRoot(string special);| Name | Type | Default |
|---|---|---|
special | string | — |
ToggleItemCheckedvoid
public void ToggleItemChecked(int index);Inverts checked without activation. Does not clear indeterminate or uncheck radio siblings. Requires an ordinary valid index.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
ToggleItemMultistatevoid
public void ToggleItemMultistate(int index);Increments state, wrapping to 0 at maxStates. Does nothing when maxStates ≤ 0. Does not activate the command; requires an ordinary valid index.
| Name | Type | Default |
|---|---|---|
index | int | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
Signals and events4
IdFocusedEvent
public event PopupMenu.IdFocusedEventHandler IdFocused;Reports menu navigation highlight changes. Carries the stored ID, including negative values; the negative-ID-to-index fallback of IdPressed does not apply. Direct SetFocusedItem emits no signal. Do not execute commands merely because they become highlighted.
| Name | Type | Default |
|---|---|---|
id | long | — |
idStored highlighted-item ID, including negative values. Not an index.
IdPressedEvent
public event PopupMenu.IdPressedEventHandler IdPressed;Command activation: ID, or index when stored ID is negative. Precedes IndexPressed. Use unique nonnegative IDs for stable routing.
| Name | Type | Default |
|---|---|---|
id | long | — |
idCommand ID, separate from index; use a unique nonnegative value. -1 in ordinary additions assigns the current index, unlike AddSeparator.
IndexPressedEvent
public event PopupMenu.IndexPressedEventHandler IndexPressed;Activation index captured when activation began, after IdPressed. If the first handler changed the list, the index can now refer to another record. Do not execute one action in both signals.
| Name | Type | Default |
|---|---|---|
index | long | — |
indexCurrent index 0…ItemCount-1; reviewed SetItem* methods accept negative indices from the end. Not an ID.
MenuChangedEvent
public event Action MenuChanged;Notification from many menu mutations rather than activation. Not every setter emits it: SetItemAsSeparator does not. Do not use it as sole observation of all writes.
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 type | Description |
|---|---|
font_accelerator_colorColor | The text Color(0.7, 0.7, 0.7, 0.8) |
font_colorColor | The default text Color(0.875, 0.875, 0.875, 1) |
font_disabled_colorColor |
Color(0.4, 0.4, 0.4, 0.8) |
font_hover_colorColor |
Color(0.875, 0.875, 0.875, 1) |
font_outline_colorColor | The tint of text outline of the menu item. Default:Color(0, 0, 0, 1) |
font_separator_colorColor |
Color(0.875, 0.875, 0.875, 1) |
font_separator_outline_colorColor | The tint of text outline of the labeled separator. Default:Color(0, 0, 0, 1) |
gutter_compactint | If not 1 |
h_separationint | The horizontal space between the item's elements. Default:4 |
icon_max_widthint | The maximum allowed width of the item's icon. This limit is applied on top of the default size of the icon, but before the value set with 0 |
indentint | Width of the single indentation level. Default:10 |
item_end_paddingint | Horizontal padding to the right of the items (or left, in RTL layout). Default:2 |
item_start_paddingint | Horizontal padding to the left of the items (or right, in RTL layout). Default:2 |
outline_sizeint | The size of the item text outline.
Note: If using a font with 0 |
search_bar_separationint | The vertical space between search bar and menu items. Default:4 |
separator_outline_sizeint | The size of the labeled separator text outline. Default:0 |
v_separationint | The vertical space between each menu item. Default:4 |
fontFont |
|
font_separatorFont |
|
font_separator_sizeint | Font size of the labeled separator. |
font_sizeint | Font size of the menu items. |
checkedTexture2D |
|
checked_disabledTexture2D |
|
indeterminateTexture2D |
|
indeterminate_disabledTexture2D |
|
radio_checkedTexture2D |
|
radio_checked_disabledTexture2D |
|
radio_uncheckedTexture2D |
|
radio_unchecked_disabledTexture2D |
|
searchTexture2D |
|
submenuTexture2D |
|
submenu_mirroredTexture2D |
|
uncheckedTexture2D |
|
unchecked_disabledTexture2D |
|
item_activated_disabled_soundAudioStream | Played when activating a disabled item is attempted. |
item_activated_soundAudioStream | Played when an item is activated. |
item_hovered_soundAudioStream | Played when an item is hovered. Disabled items do not play a hover sound. |
hoverStyleBox | |
labeled_separator_leftStyleBox |
|
labeled_separator_rightStyleBox |
|
panelStyleBox |
|
separatorStyleBox |
|