s&box docs

public class Editor.Menu : Editor.Widget

Broader workflow and conceptual references connected to this API.

Constructors

Showing 2 constructors

Methods

Showing 30 methods

public Editor.Label AddHeading(string title)

public virtual Editor.Option AddOptionWithImage(string name, Editor.Pixmap icon, System.Action action = null, string shortcut = null)

Parameters

  • action: Default: null
  • shortcut: Default: null

public Editor.Option AddSeparator()

public T AddWidget(T widget)

Add a widget as an action to the menu. Some widgets such as `Editor.Widget` and `Editor.LineEdit` require `Editor.Widget.OnMouseReleased(Editor.MouseEvent)` to set `Editor.MouseEvent.Accepted` to to prevent the menu from closing.

public Editor.Menu FindOrCreateMenu(string name)

public Editor.Option GetOption(string name)

protected virtual void OnAboutToHide()

protected virtual void OnAboutToShow()

public void OpenAt(Vector2 position, bool modal = True)

Parameters

  • modal: Default: True

public void OpenAtCursor(bool modal = False)

Open this menu at the mouse cursor position

Parameters

  • modal: Default: False

public void RemoveMenus()

Remove all menus

public void RemoveOptions()

Remove all options

public void RemoveWidget(Editor.Widget widget)

public void RemoveWidgets()

Remove all widgets

Properties

Showing 12 properties

public bool Editor.Menu.HasMenus { get; set; }

public bool Editor.Menu.HasOptions { get; set; }

public string Editor.Menu.Icon { get; set; }

public int Editor.Menu.OptionCount { get; set; }

public Editor.Menu Editor.Menu.ParentMenu { get; set; }

public Editor.Menu Editor.Menu.RootMenu { get; set; }

public Editor.Option Editor.Menu.SelectedOption { get; set; }

public string Editor.Menu.Title { get; set; }

public virtual string Editor.Menu.ToolTip { get; set; }

public bool Editor.Menu.ToolTipsVisible { get; set; }

This property holds whether tooltips of menu actions should be visible. This property specifies whether action menu entries show their tooltip. By default, this property is `false`.

public System.Collections.Generic.IReadOnlyList`1<Editor.Widget> Editor.Menu.Widgets { get; set; }

Metadata

FieldValue
NamespaceEditor
Typeclass
AssemblySandbox.Tools
Doc IDT:Editor.Menu

On this page

Constructorspublic Menu(Editor.Widget parent = null)public Menu(System.String title, Editor.Widget parent = null)Methodspublic Editor.Label AddHeading(System.String title)public Editor.Menu AddMenu(Editor.Menu menu)public Editor.Menu AddMenu(System.String name, System.String icon = null)public virtual Editor.Option AddOption(Editor.Option option)public Editor.Option AddOption(System.ReadOnlySpan`1<Editor.Menu.PathElement> path, System.Action action = null, System.String shortcut = null)public virtual Editor.Option AddOption(System.String name, System.String icon = null, System.Action action = null, System.String shortcut = null)public Editor.Option AddOption(System.String[] path, System.String icon = null, System.Action action = null, System.String shortcut = null)public System.Void AddOptions(System.Collections.Generic.IEnumerable`1<T> items, System.Action`1<T> action = null, System.Boolean flat = False, System.Boolean reduce = True, System.String defaultSubMenuIcon = folder)public System.Void AddOptions(System.Collections.Generic.IEnumerable`1<T> items, System.Func`2<T,Editor.Menu.PathElement[]> getPath, System.Action`1<T> action = null, System.Boolean flat = False, System.Boolean reduce = True, System.String defaultSubMenuIcon = folder)public System.Void AddOptions(System.Collections.Generic.IEnumerable`1<T> items, System.Func`2<T,System.String> getPath, System.Action`1<T> action = null, System.Boolean flat = False, System.Boolean reduce = True, System.String defaultSubMenuIcon = folder)public virtual Editor.Option AddOptionWithImage(System.String name, Editor.Pixmap icon, System.Action action = null, System.String shortcut = null)public Editor.Option AddSeparator()public T AddWidget(T widget)public System.Void Clear()public Editor.Menu FindOrCreateMenu(System.String name)public Editor.Option GetOption(System.String name)public System.Void GetPathTo(System.ReadOnlySpan`1<Editor.Menu.PathElement> path, System.Collections.Generic.List`1<Editor.Menu> list)public System.Void GetPathTo(System.String path, System.Collections.Generic.List`1<Editor.Menu> list)public static Editor.Menu.PathElement[] GetSplitPath(Sandbox.Internal.ITitleProvider item)public static Editor.Menu.PathElement[] GetSplitPath(System.String path)protected virtual System.Void OnAboutToHide()protected virtual System.Void OnAboutToShow()public System.Void OpenAt(Vector2 position, System.Boolean modal = True)public System.Void OpenAtCursor(System.Boolean modal = False)public System.Void RemoveMenus()public System.Void RemoveOption(Editor.Option option)public System.Void RemoveOption(System.String name)public System.Void RemoveOptions()public System.Void RemoveWidget(Editor.Widget widget)public System.Void RemoveWidgets()Propertiespublic System.Boolean Editor.Menu.HasMenus { get; set; }public System.Boolean Editor.Menu.HasOptions { get; set; }public System.String Editor.Menu.Icon { get; set; }public System.Int32 Editor.Menu.MenuCount { get; set; }public System.Int32 Editor.Menu.OptionCount { get; set; }public Editor.Menu Editor.Menu.ParentMenu { get; set; }public Editor.Menu Editor.Menu.RootMenu { get; set; }public Editor.Option Editor.Menu.SelectedOption { get; set; }public System.String Editor.Menu.Title { get; set; }public virtual System.String Editor.Menu.ToolTip { get; set; }public System.Boolean Editor.Menu.ToolTipsVisible { get; set; }public System.Collections.Generic.IReadOnlyList`1<Editor.Widget> Editor.Menu.Widgets { get; set; }Metadata