class ModalWindow

Inherits: EditorRenderWindow

Base implementation of a window that when open doesn't allow you to interact with other windows.

Modal windows are similar to editor windows but cannot be docked, and are meant to be used for temporary operations like dialog boxes and progress bars.

Public

Constructors

ModalWindow

ModalWindow() = default

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

Methods

SetSize

void SetSize(const GUIPhysicalSize &size) override

Size of the window.

SetContentSize

void SetContentSize(const GUIPhysicalSize &size) override

Width & height of the content area of the window, in pixels.

The content area represents the area of the window not including the titlebar and the border.

GetContentSize

GUIPhysicalSize GetContentSize() const override

ScreenToWindowPosition

GUIPhysicalPoint ScreenToWindowPosition(const GUIPhysicalPoint &screenPoint) const override

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

WindowToScreenPosition

GUIPhysicalPoint WindowToScreenPosition(const GUIPhysicalPoint &windowPoint) const override

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

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.

SetTitle

void SetTitle(const HString &title)

Changes the text in the modal window title bar.

SetAllowCloseButton

void SetAllowCloseButton(bool allow)

staticGetRttiStatic

static RTTIType *GetRttiStatic()

GetRtti

RTTIType *GetRtti() const override

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

Protected

Constructors

ModalWindow

ModalWindow(const HString &title, const GUIPhysicalSize &size = GUIPhysicalSize(200, 200))

Methods

GetContentArea

GUIPhysicalArea GetContentArea() const

Returns the area in which the GUI contents are displayed (not including title bar and other default elements).

Area is relative to window.

Initialize

void Initialize() override

Initializes data that cannot be initialized in the constructor.

Must be called right after construction.

DoOnWindowResized

void DoOnWindowResized() override

Callback that triggers whenever the underlying render window changes size.

Fields

mContent

GUIPanel * mContent

Private

Methods

UpdateSize

void UpdateSize()

Updates the placement of child GUI elements and their non-client areas (used for OS move/resize operations).

Should be called after window size changes.

GetTitleBarHeight

GUIPhysicalUnit GetTitleBarHeight() const

Returns the height in pixels taken up by the title bar.

Fields

mTitleBarPanel

GUIPanel * mTitleBarPanel

mTitleBarBgPanel

GUIPanel * mTitleBarBgPanel

mTitle

GUILabel * mTitle

mCloseButton

GUIButton * mCloseButton

mTitleBarBg

GUITexture * mTitleBarBg

mContentLayoutX

GUILayout * mContentLayoutX

mHasCloseButton

bool mHasCloseButton

mTitleText

HString mTitleText