class DockManager

GUI element that allows editor windows to be docked in it using arbitrary layouts.

Docked windows can be resized, undocked, maximized or closed as needed.

Public

Methods

staticCreate

static DockManager *Create(EditorRenderWindow *parentWindow)

Creates a new dock manager for the specified window.

Update

void Update()

Internal method.

Called once every frame.

Insert

void Insert(EditorWindowTabGroup *relativeTo, DockableEditorWindow *windowToInsert, DockLocation location)

Inserts a new window at the specified location.

relativeTo
Tab group relative to which to insert the window. Can be null in which case the window is inserted at the root.
windowToInsert
Window we want to insert into the dock layout.
location
Location to insert the window at, relative to container. If is null this is ignored.

GetLayout

SPtr<DockManagerLayout> GetLayout() const

Returns a saved layout of all the currently docked windows and their positions and areas.

SetLayout

void SetLayout(const SPtr<DockManagerLayout> &layout)

Sets a previously saved layout of docked windows.

This will close all currently active windows and open and position new ones according to the layout.

SetArea

void SetArea(const GUIPhysicalArea &area)

Changes the position and size of the dock manager.

SetDPIScale

void SetDPIScale(float dpiScale)

Sets the DPI scale of all the container GUI widgets.

CloseAll

void CloseAll()

Closes all docked windows.

IsInInteractionBounds

bool IsInInteractionBounds(const GUIPhysicalPoint &position) const override

Checks is the specified position within interactable bounds of a GUI element.

These are the bounds that will be used for hit tests for e.g. mouse cursor. By default this is the same as the absolute clipped bounds of the GUI element. Position is relative to parent GUI widget.

Private

Constructors

DockManager

DockManager(EditorRenderWindow *parentWindow, const GUISizeConstraints &sizeConstraints)

Methods

~DockManager

~DockManager() noexcept

UpdateDropOverlay

void UpdateDropOverlay(const GUIPhysicalArea &area)

Updates the dock overlay mesh that is displayed when user is dragging a window over a certain area.

InsidePolygon

bool InsidePolygon(Vector2 *polygonPoints, u32 pointCount, Vector2 point) const

Checks is the provided point inside the provided polygon.

polygonPoints
Points of the polygon to test against.
pointCount
Number of points in "polyPoints".
point
Point to check if it's in the polygon.

Returns: True if the point is in the polygon.

ToggleMaximize

void ToggleMaximize(DockContainer *container)

Maximizes or restored the specified container.

If any container is previously maximized it needs to be toggled back to restored state before maximizing another.

DoOnMouseEvent

bool DoOnMouseEvent(const GUIMouseEvent &event) override

Called when a mouse event is received on any GUI element the mouse is interacting with.

Return true if you have processed the event and don't want other elements to process it.

Fields

mRenderer

mParentWindow

EditorRenderWindow * mParentWindow

mRootContainer

DockContainer mRootContainer

mArea

GUIPhysicalArea mArea

mDropOverlayMesh

HMesh mDropOverlayMesh

mLastOverlayBounds

GUIPhysicalArea mLastOverlayBounds

mIsMaximized

bool mIsMaximized

mMaximizedContainer

DockContainer * mMaximizedContainer

mRestoredLayout

SPtr<DockManagerLayout> mRestoredLayout

mMouseOverContainer

DockContainer * mMouseOverContainer

mHighlightedDropLocation

DockLocation mHighlightedDropLocation

mShowOverlay

bool mShowOverlay

mTopDropPolygon

Vector2 * mTopDropPolygon

mBottomDropPolygon

Vector2 * mBottomDropPolygon

mLeftDropPolygon

Vector2 * mLeftDropPolygon

mRightDropPolygon

Vector2 * mRightDropPolygon