DockManagerclass

object→Widget→DockManager
Namespace
Editor
Assembly
Sandbox.Tools
Declaration
public class Editor.DockManager : Editor.Widget

Constructors1

Showing 1 constructors

Methods23

Showing 23 methods

public void AddDockFloating(Editor.DockWidget widget)PUBLIC

Adds a `Editor.DockWidget` as a floating window.

ParameterTypeDescription
widgetDockWidget—
Returns:void—

public void Clear()PUBLIC

Clear all registered dock types.

Returns:void—

public Editor.DockWidget CreateDockWidget(string name, string icon, Editor.Widget widget)PUBLIC

Creates a native dock widget container for the given widget.

ParameterTypeDescription
namestring—
iconstring—
widgetWidget—
Returns:DockWidget—

public Editor.DockWidget OpenDock(string name, Editor.DockArea area, Editor.DockWidget relativeTo = null)PUBLIC

Open a registered dock and move it into the given area, creating it if needed.

ParameterTypeDescription
namestring—
areaDockArea—
relativeTo = nullDockWidget—
Returns:DockWidget—

public void RegisterDock(Editor.DockManager.DockInfo info)PUBLIC

Register a dock type and create it closed in its default area, so it's available to view menus and layout restoring without appearing in the layout.

ParameterTypeDescription
infoDockInfo—
Returns:void—

public void RegisterDockType(Editor.DockManager.DockInfo info)PUBLIC

Registers a dock type without creating its widget.

ParameterTypeDescription
infoDockInfo—
Returns:void—

public void RemoveDock(Editor.DockWidget widget)PUBLIC

Remove a dock widget from the manager.

ParameterTypeDescription
widgetDockWidget—
Returns:void—

public bool RestoreState(string state)PUBLIC

Restore a layout previously captured from `Editor.DockManager.State`. Returns false if the state couldn't be restored, e.g. it was saved by an incompatible version.

ParameterTypeDescription
statestring—
Returns:bool—

public Editor.DockWidget SetCentralWidget(Editor.Widget widget)PUBLIC

Sets a widget as the central (always present, non-closable) area. Must be called before any other dock is added. Returns the dock hosting it, which can be used as a target for relative docking.

ParameterTypeDescription
widgetWidget—
Returns:DockWidget—

public void SetDockState(string name, bool visible)PUBLIC

Toggle a registered dock's visibility by name. If the dock doesn't exist yet, it will be created from its registered `Editor.DockManager.DockInfo`.

ParameterTypeDescription
namestring—
visiblebool—
Returns:void—

public bool SetSplitterProportions(Editor.DockWidget dock, System.ReadOnlySpan`1<float> proportions)PUBLIC

ParameterTypeDescription
dockDockWidget—
proportionsReadOnlySpan<float>—
Returns:bool—

public void UnregisterDockType(string name)PUBLIC

Unregister a dock type by name.

ParameterTypeDescription
namestring—
Returns:void—

Properties4

Showing 4 properties

public System.Collections.Generic.IEnumerable`1<Editor.DockManager.DockInfo> Editor.DockManager.DockTypes { get; set; }PUBLICGETSET

A list of dock types that are registered.

Returns:IEnumerable<DockInfo>—

public System.Action Editor.DockManager.OnLayoutLoaded { get; set; }PUBLICGETSET

Called when the layout state is loaded, e.g. when the default layout is applied or a saved layout is restored.

Returns:Action—

public System.Action`1<System.Collections.Generic.IReadOnlyCollection`1<string>> Editor.DockManager.OnStateRestoring { get; set; }PUBLICGETSET

Called before a layout state is restored with the names of the open docks saved in that layout. Dynamic dock types can use this to create their dock widgets before native restoration begins.

Returns:Action<IReadOnlyCollection<string>>—

public string Editor.DockManager.State { get; set; }PUBLICGETSET

A string representing the entire state of the dock manager (position of all docks, etc). Setting this restores the layout and invokes `Editor.DockManager.OnLayoutLoaded`.

Returns:string—

On this page

Constructorspublic DockManager(Editor.Widget parent = null)Methodspublic System.Void AddDock(Editor.DockManager.DockInfo info)public System.Void AddDock(Editor.DockWidget widget, Editor.DockArea area, Editor.DockWidget relativeTo)public System.Void AddDock(Editor.DockWidget widget, Editor.DockArea area)public System.Void AddDock(Editor.DockWidget widget, Editor.DockWidget tabWith)public Editor.DockWidget AddDock(System.String name, System.String icon, Editor.Widget widget, Editor.DockArea area = 1, Editor.DockWidget relativeTo = null)public System.Void AddDockFloating(Editor.DockWidget widget)public System.Void Clear()public Editor.DockWidget CreateDockWidget(System.String name, System.String icon, Editor.Widget widget)public Editor.DockWidget FindDockWidget(Editor.Widget widget)public Editor.DockWidget FindDockWidget(System.String name)public System.Boolean IsDockOpen(Editor.Widget widget)public System.Boolean IsDockOpen(System.String name)public Editor.DockWidget OpenDock(System.String name, Editor.DockArea area, Editor.DockWidget relativeTo = null)public System.Boolean RaiseDock(Editor.Widget widget)public System.Boolean RaiseDock(System.String name)public System.Void RegisterDock(Editor.DockManager.DockInfo info)public System.Void RegisterDockType(Editor.DockManager.DockInfo info)public System.Void RemoveDock(Editor.DockWidget widget)public System.Boolean RestoreState(System.String state)public Editor.DockWidget SetCentralWidget(Editor.Widget widget)public System.Void SetDockState(System.String name, System.Boolean visible)public System.Boolean SetSplitterProportions(Editor.DockWidget dock, System.ReadOnlySpan`1<System.Single> proportions)public System.Void UnregisterDockType(System.String name)Propertiespublic System.Collections.Generic.IEnumerable`1<Editor.DockManager.DockInfo> Editor.DockManager.DockTypes { get; set; }public System.Action Editor.DockManager.OnLayoutLoaded { get; set; }public System.Action`1<System.Collections.Generic.IReadOnlyCollection`1<System.String>> Editor.DockManager.OnStateRestoring { get; set; }public System.String Editor.DockManager.State { get; set; }Metadata