class DockManager::DockContainer

Contains information about a single dock area.

Each container can be a parent to two other containers or may contain a tab group, which results in a container hierarchy. Two children can be split vertically or horizontally at an user-defined point.

Public

Constructors

DockContainer

DockContainer(DockManager *manager)

DockContainer

DockContainer(DockManager *manager, DockContainer *parent)

Methods

~DockContainer

~DockContainer() noexcept

SetArea

void SetArea(const GUIPhysicalArea &area)

Determines the position and size of the container, relative to the parent dock manager.

SetDPIScale

void SetDPIScale(float dpiScale)

Sets the DPI scale of the underlying GUI widget, and if container is not a leaf recursively sets it on all child containers as well.

MakeLeaf

void MakeLeaf(EditorRenderWindow *parentWindow)

Transforms the container from non-leaf (parent to other containers) to leaf (parent to tab group).

This involves creating a tab group to which you can dock editor windows to.

parentWindow
Editor window of the parent dock manager.

MakeLeaf

void MakeLeaf(const HSceneObject &guiWidgetSO, EditorWindowTabGroup *existingTabGroup)

Transforms the container from non-leaf (parent to other containers) to leaf (parent to tab group).

Unlike the other overload this one accepts a previously created tab group.

guiWidgetSO
Parent SceneObject of the GUIWidget used by the provided tab group.
existingTabGroup
An existing widget container that may be used for docking widgets.

SplitContainer

void SplitContainer(bool horizontal, bool newChildIsFirst, float splitPosition = 0.5F)

Splits a leaf container containing a tab group (or may be empty in the case of root with no elements) into a container parent to two other containers.

horizontal
Whether the split is horizontal (true) or vertical (false).
newChildIsFirst
Determines to which child should the tab group from this object be moved to. If the new child is first, then bottom or right (for horizontal and vertical respectively) will receive the current tab group, and opposite if it's not first.
splitPosition
Determines at what position(in percent) should this container be split. User can modify this later via a dock slider.

MakeSplit

void MakeSplit(DockContainer *first, DockContainer *second, bool horizontal, float splitPosition)

Splits a leaf container containing a tab group (or may be empty in the case of root with no elements) into a container parent to two other containers.

Unlike new containers aren't created automatically but you must provide existing ones. If this container is non-leaf its tab group will be destroyed.

first
Container to insert into the first child slot (left if vertical split, top if horizontal split).
second
Container to insert into the second child slot (right if vertical split, bottom if horizontal split).
horizontal
Whether the split is horizontal (true) or vertical (false).
splitPosition
Determines at what position(in percent) should this container be split. User can modify this later via a dock slider.

AddLeft

void AddLeft(DockableEditorWindow *window)

Adds a new window to the left side of the container.

If the container is leaf it will be split into two containers vertically.

AddRight

void AddRight(DockableEditorWindow *window)

Adds a new window to the right side of the container.

If the container is leaf it will be split into two containers vertically.

AddTop

void AddTop(DockableEditorWindow *window)

Adds a new window to the top side of the container.

If the container is leaf it will be split into two containers horizontally.

AddBottom

void AddBottom(DockableEditorWindow *window)

Adds a new window to the bottom side of the container.

If the container is leaf it will be split into two containers horizontally.

AddWindow

void AddWindow(DockableEditorWindow *window)

Adds an existing window to this leaf container.

AddWindow

void AddWindow(const String &name)

Attempts to find a window with the specified name, opens it and adds it to this leaf container.

Update

void Update()

Update to be called once per frame.

Calls updates on all child windows.

Find

Attempts to find an existing leaf dock container with the specified tab group.

Returns null if one cannot be found.

FindAtPosition

DockContainer *FindAtPosition(const GUIPhysicalPoint &position)

Searches for a container at the specified position.

Call this at this top-most container in order to search them all.

position
Position is relative to the container area.

Returns: Null if it fails, else the found DockContainer at position.

GetContentBounds

GUIPhysicalArea GetContentBounds() const

Returns the bounds of the container that are to be considered dockable and interactable.

Fields

IsLeaf

bool IsLeaf

Children

Manager

DockManager * Manager

WindowTabGroup

EditorWindowTabGroup * WindowTabGroup

GUIWidgetSceneObject

HSceneObject GUIWidgetSceneObject

GUIWidget

HGUIWidget GUIWidget

Slider

GUIDockSlider * Slider

Area

GUIPhysicalArea Area

SplitPosition

float SplitPosition

IsHorizontal

bool IsHorizontal

Private

Methods

UpdateChildAreas

void UpdateChildAreas()

Updates sizes and positions of all child containers.

Normally called when parent area changes.

DoOnSliderDragged

void DoOnSliderDragged(const GUIPhysicalPoint &delta)

Triggered whenever the user drags the GUI slider belonging to this container.

DoOnWindowRemoved

void DoOnWindowRemoved()

Triggered whenever the user closes or undocks a window belonging to this container.

DoOnMaximizeClicked

void DoOnMaximizeClicked()

Triggered when the maximize button in the container's title bar is clicked.