class DockableEditorWindow

Inherits: IEditorWindow

Single window in the editor, that may be dragged, docked and can share space with multiple other windows by using tabs.

Unlike other editor windows, dockable editor windows can never exist on its own, it must always be docked to a parent tab group.

Public

Constructors

DockableEditorWindow

DockableEditorWindow() = default

*********************************************************************

Methods

~DockableEditorWindow

virtual ~DockableEditorWindow() noexcept

GetName

const String &GetName() const

Gets a unique name for this window.

This name will be used for referencing the window by other systems.

GetDisplayName

const HString &GetDisplayName() const

Gets the display name for the window.

This is what editor users will see in the window title bar.

GetDefaultSize

const GUIPhysicalSize &GetDefaultSize() const

Returns the width/height of the window when initially created, in physical pixel units.

GetBounds

GUIPhysicalArea GetBounds() const

Returns the bounds of the window in physical pixels, relative to its parent tab group.

SetHasFocus

void SetHasFocus(bool focus)

Makes the window in or out focus.

Window can only be made in focus if it is active.

HasFocus

bool HasFocus() const

Checks if the window has focus (usually means user clicked on it last).

SetActive

void SetActive()

Makes the window active in its tab group.

This means the windows tab is active and the window is visible.

IsActive

bool IsActive() const

Checks is the window the currently active window in its tab group.

This means the window's tab is active or the window is the only one in its container.

GetParentWindow

EditorRenderWindow *GetParentWindow() const

Gets the parent editor key window this window is docked in.

Can be null (for example when window is in the process of dragging and not visible).

GetParentTabGroup

EditorWindowTabGroup *GetParentTabGroup() const

Returns the parent window tab group.

Can be null (for example when window is in the process of dragging and not visible).

GetPosition

GUIPhysicalPoint GetPosition() const override

GetSize

GUIPhysicalSize GetSize() const override

GetDPIScale

float GetDPIScale() const override

Returns currently set DPI scale.

Scale of 1.0 corresponds to 96 DPI. physical pixel = logical pixel * DPI scale logical pixel = physical pixel / DPI ccale;

GetContent

GUIPanel *GetContent() const override

Returns the GUI panel at the root of the window.

You should all your own GUI elements as children of this element.

ScreenToWindowPosition

GUIPhysicalPoint ScreenToWindowPosition(const GUIPhysicalPoint &screenPosition) const override

Converts screen coordinates to coordinates relative to the window's GUI content panel.

WindowToScreenPosition

GUIPhysicalPoint WindowToScreenPosition(const GUIPhysicalPoint &windowPosition) const override

Converts coordinates relative to the window's GUI content panel to screen coordinates.

Close

void Close() override

Closes and destroys the window.

staticGetRttiStatic

static RTTIType *GetRttiStatic()

GetRtti

RTTIType *GetRtti() const override

Returns an interface you can use to access class' Run Time Type Information.

Fields

OnResized

Event<void (const GUIPhysicalSize &)> OnResized

Triggered whenever window size changes.

OnMoved

Event<void (const GUIPhysicalPoint &)> OnMoved

Triggered whenever window position changes.

OnFocusChanged

Event<void (bool)> OnFocusChanged

Triggered whenever window receives or loses focus.

OnParentTabGroupChanged

Event<void (EditorWindowTabGroup *)> OnParentTabGroupChanged

Triggered whenever window parent tab group changes.

Internal

Methods

SetSize

void SetSize(const GUIPhysicalSize &size) override

Size of the window.

SetPosition

void SetPosition(const GUIPhysicalPoint &point) override

Top-left corner of the window in screen space.

GetRenderWindow

SPtr<RenderWindow> GetRenderWindow() const override

Returns the render window that this editor window is being rendered to.

GetGUICamera

HCamera GetGUICamera() const override

Returns the camera used for rendering the window GUI contents.

GetGUIWidget

HGUIWidget GetGUIWidget() const override

Returns the GUI widget used for displaying GUI contents in the window.

NotifyTabGroupChanged

void NotifyTabGroupChanged(EditorWindowTabGroup *parentTabGroup, u32 index)

Changes the parent tab group of the window (e.g. when docking the window elsewhere).

Parent can be null (for example when window is in the process of being dragged and not visible).

SetHasFocusInternal

void SetHasFocusInternal(bool focus)

Sets or removes focus for this window.

DisableInternal

void DisableInternal()

Disables the window making its GUI contents not visible.

The window remains docked in its container.

EnableInternal

void EnableInternal()

Enables the window making its previously hidden GUI contents visible.

Protected

Constructors

DockableEditorWindow

DockableEditorWindow(const HString &displayName, const String &name, const GUIPhysicalSize &defaultSize, EditorWindowTabGroup &parentContainer)

Methods

DoOnMoved

virtual void DoOnMoved(const GUIPhysicalPoint &point)

Triggered whenever window position changes.

DoOnResized

virtual void DoOnResized(const GUIPhysicalSize &size)

Triggered whenever window size changes.

DoOnParentChanged

virtual void DoOnParentChanged()

Triggered whenever window parent container changes.

GetParentWidget

GUIWidget &GetParentWidget() const

Returns the parent GUI widget.

Before calling this you must ensure the window has a container parent otherwise this method will fail.

Fields

mName

String mName

mDisplayName

HString mDisplayName

mParentTabGroup

EditorWindowTabGroup * mParentTabGroup

mPosition

GUIPhysicalPoint mPosition

mSize

GUIPhysicalSize mSize

mDefaultSize

GUIPhysicalSize mDefaultSize

mIndex

u32 mIndex

mContent

GUIPanel * mContent

mHasFocus

bool mHasFocus

mIsActive

bool mIsActive