API ReferenceSandbox.UI

DockHostclass

Tabbed panel docking with nested splits. Registered content is owned until this host is deleted or transfers it. Splits respect the content's pixel min/max width and height where space allows. Tab groups reserve the largest minimum and allow the largest maximum of their tabs. If constraints cannot fit, the available space is shared.

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

Constructors1

Showing 1 constructors

public DockHost()PUBLICCONSTRUCTOR

Creates an empty docking workspace.

Methods10

Showing 10 methods

public bool Activate(string id)PUBLIC

Selects an open panel without moving it.

ParameterTypeDescription
idstring—
Returns:bool—

public bool Close(string id)PUBLIC

Closes a panel without deleting its content. Nonclosable panels are left open.

ParameterTypeDescription
idstring—
Returns:bool—

public void Dock(string id, string relativeTo = null, Sandbox.UI.DockPosition position = 0, float fraction = 0.5, int tabIndex = -1)PUBLIC

Opens or moves a registered panel. Edge fractions describe the incoming panel's share.

ParameterTypeDescription
idstring—
relativeTo = nullstring—
position = 0DockPosition—
fraction = 0.5float—
tabIndex = -1int—
Returns:void—

public Sandbox.UI.DockItem Find(string id)PUBLIC

Finds a registered panel, including closed panels.

ParameterTypeDescription
idstring—
Returns:DockItem—

public bool IsOpen(string id)PUBLIC

Whether a registered panel is in the layout.

ParameterTypeDescription
idstring—
Returns:bool—

public virtual void OnDeleted()PUBLICVIRTUAL

Returns:void—

public bool RestoreState(string json)PUBLIC

Restores a valid layout atomically. Open nonclosable panels must remain present.

ParameterTypeDescription
jsonstring—
Returns:bool—

public virtual void Tick()PUBLICVIRTUAL

Returns:void—

Properties2

Showing 2 properties

public System.Collections.Generic.IReadOnlyCollection`1<Sandbox.UI.DockItem> Sandbox.UI.DockHost.Items { get; set; }PUBLICGETSET

All registered panels, including closed panels.

Returns:IReadOnlyCollection<DockItem>—

public string Sandbox.UI.DockHost.State { get; set; }PUBLICGETSET

Saves tab order, selection and split proportions. Closed panels are omitted.

Returns:string—

On this page