API ReferenceSandbox.UI

Toolbarclass

A horizontal or vertical strip of commands and controls. Children keep their natural size; when space runs out the strip scrolls. Add ordinary panels directly to embed other controls.

object→Panel→Toolbar
Namespace
Sandbox.UI
Assembly
Sandbox.Engine
Declaration
public class Sandbox.UI.Toolbar : Sandbox.UI.Panel

Constructors1

Showing 1 constructors

Methods6

Showing 6 methods

public Sandbox.UI.Button AddButton(string text, string icon, System.Action clicked)PUBLIC

Add a command. Use empty text for an icon-only button, and set its Tooltip.

ParameterTypeDescription
textstring—
iconstring—
clickedAction—
Returns:Button—

public Sandbox.UI.Button AddMenu(string text, string icon, Sandbox.UI.Menu menu)PUBLIC

Add a dropdown command. The toolbar owns the supplied menu and deletes it with the button.

ParameterTypeDescription
textstring—
iconstring—
menuMenu—
Returns:Button—

public Sandbox.UI.Panel AddSeparator()PUBLIC

Add a divider perpendicular to the toolbar's orientation.

Returns:Panel—

public Sandbox.UI.Panel AddSpacer()PUBLIC

Push the following controls to the far end of the toolbar.

Returns:Panel—

public Sandbox.UI.Button AddToggle(string text, string icon, bool value, System.Action`1<bool> changed)PUBLIC

ParameterTypeDescription
textstring—
iconstring—
valuebool—
changedAction<bool>—
Returns:Button—

public virtual void OnButtonTyped(Sandbox.UI.ButtonEvent e)PUBLICVIRTUAL

Arrow keys move between buttons; embedded editors keep their own keyboard behaviour.

ParameterTypeDescription
eButtonEvent—
Returns:void—

Properties1

Showing 1 properties

public bool Sandbox.UI.Toolbar.Vertical { get; set; }PUBLICGETSET

Arrange commands top to bottom instead of left to right.

Returns:bool—

On this page