API ReferenceSandbox.UI

StatusBarclass

A strip of normal status widgets on the left and permanent widgets on the right. Temporary messages replace the left widgets without deleting them.

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

Constructors1

Showing 1 constructors

public StatusBar()PUBLICCONSTRUCTOR

Methods7

Showing 7 methods

public T AddLeft(T widget, int stretch = 0)PUBLIC

Add and own a normal widget. Stretch distributes spare space within its slot.

ParameterTypeDescription
widgetT—
stretch = 0int—
Returns:T—

public T AddRight(T widget, int stretch = 0)PUBLIC

Add and own a permanent widget.

ParameterTypeDescription
widgetT—
stretch = 0int—
Returns:T—

public Sandbox.UI.Panel AddSeparator(bool right = False)PUBLIC

Add a separator to the normal or permanent slot.

ParameterTypeDescription
right = Falsebool—
Returns:Panel—

public void ClearMessage()PUBLIC

Clear the message and restore the normal widgets.

Returns:void—

public bool RemoveWidget(Sandbox.UI.Panel widget)PUBLIC

Remove a direct slot widget without deleting it. The caller takes ownership.

ParameterTypeDescription
widgetPanel—
Returns:bool—

public void ShowMessage(string text, float seconds = 5)PUBLIC

Replace the current message. Positive seconds expire automatically; zero or negative seconds keep the message until replaced or cleared. Empty text clears it.

ParameterTypeDescription
textstring—
seconds = 5float—
Returns:void—

public virtual void Tick()PUBLICVIRTUAL

Returns:void—

Properties3

Showing 3 properties

public Sandbox.UI.Panel Sandbox.UI.StatusBar.Left { get; set; }PUBLICGETSET

Normal widgets, hidden while a message is displayed.

Returns:Panel—

public string Sandbox.UI.StatusBar.Message { get; set; }PUBLICGETSET

The current temporary message, or an empty string.

Returns:string—

public Sandbox.UI.Panel Sandbox.UI.StatusBar.Right { get; set; }PUBLICGETSET

Permanent widgets, visible even while a message is displayed.

Returns:Panel—

On this page