class GUITabbedTitleBar

Tabbed title bar to be used in editor windows.

Displays tabs that can be activated, reordered by dragging, or dragged off and on to/on other title bars.

Public

Methods

staticGetGuiTypeName

static const String &GetGuiTypeName()

Returns type name of the GUI element used for finding GUI element styles.

staticCreate

static GUITabbedTitleBar *Create()

Creates a new tabbed title bar GUI element.

staticCreate

static GUITabbedTitleBar *Create(const GUIOptions &options)

Creates a new tabbed title bar GUI element.

options
Options that allow you to control how is the element positioned and sized. This will override any similar options set by style.

AddTab

u32 AddTab(const HString &name)

Adds a new tab to the end of the tab list.

name
Title to display on the tab button.

Returns: A unique ID (not sequential) that you may use for later identifying the tab.

InsertTab

u32 InsertTab(u32 position, const HString &name)

Inserts a new tab button at the specified position.

position
Sequential index to insert the tab button in. This will be clamped to a valid range.
name
Title to display on the tab button.

Returns: A unique ID (not sequential) that you may use for later identifying the tab.

RemoveTab

void RemoveTab(u32 tabId)

Removes the tab button with the specified ID.

SetActive

void SetActive(u32 tabId)

Activates the tab button with the specified ID.

GetTabId

u32 GetTabId(u32 position) const

Finds the unique tab ID from the provided sequential tab position.

GetTabCount

u32 GetTabCount() const

Returns the total number of display tab buttons.

UpdateTabName

void UpdateTabName(u32 tabId, const HString &name)

Changes the displayed title for a tab with the specified index.

CalculateDraggableAreas

Vector<GUIPhysicalArea> CalculateDraggableAreas(const GUIPhysicalArea &parentArea) const

Calculates areas between the tab buttons and other GUI elements on the title bar.

These areas are normally used for setting up valid areas the user can click on and drag the window the title bar belongs to.

Fields

OnTabActivated

Event<void (u32)> OnTabActivated

Triggered when the active tab changes.

Provided parameter is the unique ID of the activated tab.

OnTabClosed

Event<void (u32)> OnTabClosed

Triggered when a tab is closed.

Provided parameter is the unique ID of the closed tab.

OnTabMaximized

Event<void (u32)> OnTabMaximized

Triggered when a tab maximize button is clicked.

Provided parameter is the unique ID of the maximized/restored tab.

OnTabDraggedOff

Event<void (u32)> OnTabDraggedOff

Triggered when a tab gets dragged off the title bar.

Provided parameter is the unique ID of the activated tab.

OnTabDraggedOn

Event<void (u32)> OnTabDraggedOn

Triggered when a new tab gets dragged on the title bar.

Provided parameter is the sequential index of the activated tab.

Protected

Constructors

GUITabbedTitleBar

GUITabbedTitleBar(const GUISizeConstraints &sizeConstraints)

Methods

~GUITabbedTitleBar

virtual ~GUITabbedTitleBar() noexcept = default

CalculateUnconstrainedOptimalSize

GUILogicalSize CalculateUnconstrainedOptimalSize() const override

Calculates the optimal size for the GUI element, ignoring size constraints.

UpdateLayoutForChildren

void UpdateLayoutForChildren() override

Calculates sizes and relative positions for all child elements.

Should be preceded with a call to UpdateOptimalLayoutSizes().

UpdateAbsoluteCoordinatesForChildren

void UpdateAbsoluteCoordinatesForChildren() override

Calls UpdateAbsoluteCoordinates() on all child elements.

DoOnMouseEvent

bool DoOnMouseEvent(const GUIMouseEvent &ev) 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.

StartDrag

void StartDrag(u32 sequentialIndex, const GUIPhysicalPoint &startDragPosition)

Starts the internal drag and drop operation.

sequentialIndex
Sequential index of the dragged tab.
startDragPosition
Pointer position of where the drag originated, relative to parent widget.

EndDrag

void EndDrag()

Ends the internal drag and drop operation started with StartDrag().

TabToggled

void TabToggled(u32 tabId, bool toggledOn)

Triggered when a tab button is toggled on or off.

tabId
Unique ID of the tab.
toggledOn
Whether the tab was activated or deactivated.

TabClosed

void TabClosed()

Triggered when the close button is pressed.

TabMaximize

void TabMaximize()

Triggered when the maximize button is pressed.

TabDragged

void TabDragged(u32 tabId, const GUIPhysicalPoint &dragPosition)

Triggered every frame while a tab button is being dragged.

tabId
Unique ID of the dragged tab.
dragPosition
Position of the pointer, relative to parent widget.

TabDragEnd

void TabDragEnd(u32 tabId, const GUIPhysicalPoint &dragPosition)

Triggered when a drag operation on a tab button ends.

tabId
Unique index of the dragged tab.
dragPosition
Position of the pointer, relative to parent widget.

TabIdToSequentialIndex

i32 TabIdToSequentialIndex(u32 tabId) const

Converts unique tab ID to a sequential index corresponding to the tab's position in the title bar.

Fields

mTabButtons

Vector<GUITabButton *> mTabButtons

mNextTabId

u32 mNextTabId

mActiveTabId

u32 mActiveTabId

mBackgroundImage

GUITexture * mBackgroundImage

mMaxBtn

GUIButton * mMaxBtn

mCloseBtn

GUIButton * mCloseBtn

mTabToggleGroup

SPtr<GUIToggleGroup> mTabToggleGroup

mTemporaryDraggedWindow

DockableEditorWindow * mTemporaryDraggedWindow

mTemporaryDraggedTabId

u32 mTemporaryDraggedTabId

mDragInProgress

bool mDragInProgress

mDraggedBtn

GUITabButton * mDraggedBtn

mDragBtnOffset

GUILogicalUnit mDragBtnOffset

mInitialDragOffset

GUIPhysicalUnit mInitialDragOffset