# Sandbox.UI.Menu

One entry in a menu, and the menu it opens. A menu with no options is a plain command;
give it options and it becomes a submenu. A root menu with no parent is a context menu, or a
heading in a [Sandbox.UI.MenuBar](/api/Sandbox.UI.MenuBar).

- Kind: class
- Namespace: `Sandbox.UI`
- Assembly: `Sandbox.Engine`
- Inherits: [Sandbox.UI.Panel](/api/Sandbox.UI.Panel)

## Constructors

- [`Menu`](/api/Sandbox.UI.Menu/.ctor)

## Properties

- [`Checkable`](/api/Sandbox.UI.Menu/Checkable): Clicking toggles [Sandbox.UI.Menu.Checked](/api/Sandbox.UI.Menu/Checked) instead of running [Sandbox.UI.Menu.Clicked](/api/Sandbox.UI.Menu/Clicked).
- [`Checked`](/api/Sandbox.UI.Menu/Checked): Shows a check mark in the gutter.
- [`Clicked`](/api/Sandbox.UI.Menu/Clicked): Runs when the row is activated.
- [`Enabled`](/api/Sandbox.UI.Menu/Enabled): A disabled row is dimmed and does nothing when clicked.
- [`HasOptions`](/api/Sandbox.UI.Menu/HasOptions): Does this row open a submenu?
- [`Highlighted`](/api/Sandbox.UI.Menu/Highlighted): The row with the keyboard or hover highlight, in this menu's list.
- [`Icon`](/api/Sandbox.UI.Menu/Icon): Material icon shown in the gutter, before the text.
- [`IsOpen`](/api/Sandbox.UI.Menu/IsOpen): Whether this menu's options are showing.
- [`IsSeparator`](/api/Sandbox.UI.Menu/IsSeparator): Draws a line between rows instead of a row.
- [`Options`](/api/Sandbox.UI.Menu/Options): The option rows of this menu, in order.
- [`ParentMenu`](/api/Sandbox.UI.Menu/ParentMenu): The menu this row is an option of. Null for a root menu.
- [`RootMenu`](/api/Sandbox.UI.Menu/RootMenu): The top of this menu tree.
- [`Rows`](/api/Sandbox.UI.Menu/Rows): Everything the list shows, in order - the options and any other panels added.
- [`Shortcut`](/api/Sandbox.UI.Menu/Shortcut): Shortcut text drawn on the right, like "Ctrl+S". Display only - nothing dispatches it yet.
- [`StaysOpen`](/api/Sandbox.UI.Menu/StaysOpen): Whether the menu stays up after this row is activated. Checkable rows do, so several can be flipped in one go; commands close the menu. Set it to say otherwise.
- [`Text`](/api/Sandbox.UI.Menu/Text): The text shown on the row.
- [`Toggled`](/api/Sandbox.UI.Menu/Toggled): Runs with the new state when a checkable row is toggled. Setting it makes the row checkable.

## Methods

- [`Activate`](/api/Sandbox.UI.Menu/Activate): Do what a click on this row does. A submenu row opens, a checkable row toggles, a command runs and takes the whole menu down with it.
- [`AddMenu`](/api/Sandbox.UI.Menu/AddMenu): Add a submenu. Same as [Sandbox.UI.Menu.AddOption](/api/Sandbox.UI.Menu/AddOption) without an action.
- [`AddOption`](/api/Sandbox.UI.Menu/AddOption): Add a row. Returns it so you can keep configuring it or add options to it.
- [`AddSeparator`](/api/Sandbox.UI.Menu/AddSeparator): Add a line between rows.
- [`AddWidget`](/api/Sandbox.UI.Menu/AddWidget): Add any panel as a row - a text entry, a slider, a heading. It's shown in the list like an option but the menu leaves it alone.
- [`Clear`](/api/Sandbox.UI.Menu/Clear): Delete every row.
- [`Close`](/api/Sandbox.UI.Menu/Close): Hide this menu's options, and any open submenus.
- [`FindOption`](/api/Sandbox.UI.Menu/FindOption): The first option with this text, or null.
- [`OnDeleted`](/api/Sandbox.UI.Menu/OnDeleted)
- [`Open`](/api/Sandbox.UI.Menu/Open): Show this menu's options next to a panel. Use this for context menus and buttons.
- [`Remove`](/api/Sandbox.UI.Menu/Remove): Take a row out without deleting it.
