class GUITabButton

Specialization of a GUIToggle element used for displaying tabs in a GUITabbedTitleBar.

Aside from being toggleable these buttons also track drag and drop operations.

Public

Methods

staticGetGuiTypeName

static const String &GetGuiTypeName()

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

GetIndex

u32 GetIndex() const

Returns the unique index for this tab button.

SetDraggedStateInternal

void SetDraggedStateInternal(bool active)

Changes the button state to dragged or not dragged, resulting primarily in a visual change.

staticCreate

static GUIElementType *Create(const ContentType &contents, const String &styleClass, const TInlineArray<GUIOption, 4> &options)

Creates a new GUI element.

contents
Structure describing the contents of the GUI element to create.
styleClass
Style class that will be used for determining GUI element visuals from the current style sheet. If no class is provided, default style is determined based on GUI element type.
options
Additional options that control GUI element size and position. This will override options set in the style sheet.

Fields

OnDragged

Event<void (u32, const GUIPhysicalPoint &)> OnDragged

Triggered when the user starts dragging the tab button.

Reported parameters are the unique index of the tab and pointer position relative to parent GUIWidget.

OnDragEnd

Event<void (u32, const GUIPhysicalPoint &)> OnDragEnd

Triggered when the user ends dragging the tab button.

Reported parameters are the unique index of the tab and pointer position relative to parent GUIWidget.

Internal

Constructors

GUITabButton

GUITabButton(PrivatelyConstruct, const GUITabButtonContent &content, const String &styleName, const GUISizeConstraints &dimensions)

Protected

Methods

SetIsToggled

void SetIsToggled(bool isToggled, bool triggerEvent) override

Checks or unchecks the toggle.

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.

Fields

mIndex

u32 mIndex

mDragStartPosition

GUIPhysicalPoint mDragStartPosition

mDraggedState

bool mDraggedState

mInactiveState

GUIElementState mInactiveState