DreamGUI
Reference

UDreamTabView

A tab view whose hierarchy is code, not an asset: a strip of tabs over a switcher of pages.

Inherits from UDreamUIControl.

Declared in Public/Controls/DreamTabView.h.

A tab view whose hierarchy is code, not an asset: a strip of tabs over a switcher of pages.

WHERE THE PAGES COME FROM, which is the only interesting question a tab view asks.

The control owns the switcher, and a page is simply a child the consumer nested inside the tab view. Nothing is copied and nothing is bound by name: a UDreamUserWidget placed in a host tree keeps whatever the host authored UNDER it, and InitializeWidgetStatic runs a nested instance's Initialize -- so by the time NativeOnInitialized runs, the pages are already sitting on this widget. All this control does is snapshot them before it builds anything of its own, then hang each one under the switcher. So this is a working tab view, from .dui, with nothing else:

Native.TabView Settings {
    Widget Video    { ... }
    Widget Audio    { ... }
    Widget Controls { ... }
}

The two routes that were considered and are NOT what this does:

  • A NamedSlot. UDreamNamedSlot takes exactly one child, so pages would need a panel wrapped around them; worse, the host-fills-the-slot step lives inside InitializeWidgetStatic behind an InWidgetTreeArchetype != nullptr gate, and a NATIVE class never has a widget-tree archetype. A native control cannot receive named-slot content at all.
  • Pages as a TArray property. The language cannot write a container: a tuple on a non-short-form destination is refused outright (ValueTypeMismatch), and a bare string cannot spell an array for ImportText. Nesting is the one thing .dui does natively, so nesting is the door.

WHERE THE TABS COME FROM. One tab per index, for as many indices as there are labels OR pages -- whichever is more, so the strip is never emptier than the thing it drives. TabLabels names tab i when it has an entry; otherwise the tab wears the page's own node id. That fallback is what makes the file above work with no label list at all, and TabLabels stays the spelling that a details panel, a Blueprint and a binding can all reach:

Native.TabView Settings {
    TabLabels      <-  GetSettingsTabs()      // localizable, from the host class
    ActiveTabIndex <-> CurrentSettingsTab
    ...
}

The same container limit bites the assignment form -- TabLabels = (...) does not parse into an array -- so a .dui that wants translated labels binds them rather than writing them inline. A node id is an identifier and not a translatable string, which is why the fallback is deliberately culture-invariant instead of pretending otherwise.

WHY A TAB IS TWO VISUALS. A tab is a radio button that looks like a button: the toggles share one UUIToggleGroup, so mutual exclusion is the group's, not this control's. But a UUISelectable owns exactly two transitions and a tab needs three appearances -- pointer states, selected, and the label. The pointer transition tints the face; the CHECKED transition tints a separate full-bleed plate over it (aimed at one visual they overwrite each other and the selected colour would live only until the next hover -- the toggle's box-and-tick split, restated); and the label colour has no transition left, so the control pushes it directly. Three appearances, two transitions, one explicit push.

THE SHOULDER BUTTONS switch tabs (IDreamUITabSwitchTarget): the project's PreviousTabKeys and NextTabKeys, LB and RB by default, reach the tab view the player's focus is in -- else the first one on their active screen -- and step to the previous or next enabled tab, round at the ends, as CommonUI's tab list does; the action bar shows the two prompts while there is such a tab view.

Properties

NameTypeCategoryIn the details panelFrom BlueprintDescription
StyleFDreamTabViewStyleTab ViewyesSetStyleThis instance's own look. The project sheet wins while StyleSource says so AND a sheet actually exists; with no sheet in the project this IS the look in effect -- which is why it stays editable instead of being gated on the enum: the old edit condition greyed the exact values that were driving the control.
TabLabelsTArray<FText>Tab ViewyesSetTabLabelsThe tab captions, index-matched to the pages. An entry names that tab; a missing or empty one leaves the tab wearing its page's node id (see the class comment). Longer than the page list is allowed and grows the strip -- a screen that authors its tabs before its pages should see the strip it is building.
ActiveTabIndexint32Tab ViewyesGetActiveTabIndex / SetActiveTabIndexWhich tab is open, and therefore which page the switcher shows. A property rather than the getter/setter pair alone, because the pair alone is invisible: .dui writes properties, the designer lists properties, and a binding resolves a property.
TabTemplateClassTSubclassOf<UDreamUserWidget>Tab ViewyesSetTabTemplateClassA tab's CONTENT, authored elsewhere: one instance of this class is created inside every tab widget, filling it, and the built-in label steps aside. The tab's face, its selected plate, its hover and its place in the toggle group stay the control's, so a template only has to draw a tab.
TabEnabledTArray<bool>Tab ViewyesSetTabEnabledStatesWhich tabs can be picked, index-matched to the strip -- the same parallel-array idiom TabLabels uses, and for the same reason: a struct per tab would make the common case (no opinion at all) cost an array literal the language cannot write.
bTabsClosableboolTab ViewyesSetTabsClosableEvery tab carries a close button, and clicking one closes that tab -- the browser's arrangement.
bTabsDraggableboolTab ViewyesSetTabsDraggableTabs can be dragged along the strip to reorder them, carrying their pages with them.
bFocusPageOnTabChangeboolTab ViewyesSetFocusPageOnTabChangeSwitching tabs moves focus into the new page.
BodyNodeTObjectPtr<UDreamWidget>Tab View-read onlyThe parts, in the shape the rest of the framework expects to find them.
StripNodeTObjectPtr<UDreamWidget>Tab View-read only
IndicatorNodeTObjectPtr<UDreamWidget>Tab View-read onlyThe line under the open tab. Layout-ignoring; this control is the only thing that places it.
PageHostNodeTObjectPtr<UDreamWidget>Tab View-read onlyThe page area: the switcher's widget, and the panel a page's background is drawn on.
PageSwitcherTObjectPtr<UDreamLayoutContainerWidgetSwitcher>Tab View-read only
TabGroupTObjectPtr<UUIToggleGroup>Tab View-read onlyMutual exclusion, borrowed whole from the radio button's mechanism.
TabsTArray<FDreamTabViewTab>Tab View-read onlyOne entry per tab in the strip, in strip order.

Functions

FunctionKindDescription
void AddPage(UDreamWidget* InPage)callablePut a widget in as the next page, for a screen assembled in code rather than in .dui. The strip regenerates, so a page added past the end of TabLabels still gets a tab.
void CloseTab(int32 InIndex)callableClose a tab: broadcast, then drop its caption and destroy its page, then regrow the strip.
UDreamWidget* GetActivePage()pureThe page the switcher is showing, or null before any page is attached.
int32 GetActiveTabIndex()pureGet Active Tab Index
UDreamWidget* GetPage(int32 InIndex)pureGet Page
int32 GetPageCount()pureHow many pages the switcher holds. Not necessarily how many tabs the strip shows.
bool IsTabEnabled(int32 InIndex)pureA missing entry means enabled -- see TabEnabled.
void MoveTab(int32 InFromIndex, int32 InToIndex)callableMove a tab, carrying its page. Both indices are into the strip as it stands. The tab's widget moves with it rather than the strip being rebuilt, and OnTabChanged reports the open tab's new index when the move shifted it.
void SetActiveTabIndex(int32 InIndex)callableOpen a tab. Broadcasts when the index actually moved, exactly as a click on the tab would.
void SetActiveTabIndexWithoutNotify(int32 InIndex)callableThe same move without the broadcast. The <-> desugar looks for precisely this name (the setter's plus "WithoutNotify") so the forward half of a two-way binding cannot echo back into the variable that just drove it.
void SetFocusPageOnTabChange(bool bInFocusPageOnTabChange)callableSet Focus Page on Tab Change
void SetStyle(FDreamTabViewStyle InStyle)callableReplace the look and push it.
void SetTabEnabled(int32 InIndex, bool bInEnabled)callableGrows TabEnabled to reach InIndex when it has to, then re-pushes the strip's colours. Disabling a tab that has focus moves it to the tab's right neighbour, else the last enabled tab.
void SetTabEnabledStates(TArray<bool> InTabEnabled)callableEvery tab's enabled flag at once; a missing entry means enabled. SetTabEnabled changes one.
void SetTabLabels(TArray<FText> InLabels)callableReplace the captions and regenerate the strip.
void SetTabsClosable(bool bInTabsClosable)callableShow or hide every tab's close button. A restyle: the buttons are woken in the style loop. Hiding them moves focus that is on one onto its tab first.
void SetTabsDraggable(bool bInTabsDraggable)callableSet Tabs Draggable
void SetTabTemplateClass(TSubclassOf<UDreamUserWidget> InTabTemplateClass)callableThe authored tab content. Instanced into each tab at build, so a new class means a rebuild.

Events

EventSignatureDescription
OnTabGeneratedvoid DreamTabViewTabEvent__DelegateSignature(int32 TabIndex, UDreamWidget* Tab)One per tab, as the strip is built. The hook for a consumer whose tabs are richer than a word but who would rather not author a whole class: everything under the tab is reachable from here by display name. The tab view's counterpart of the list's OnRowGenerated.
OnTabChangedvoid DreamTabViewChangedEvent__DelegateSignature(int32 ActiveTabIndex)Fired when the open tab changes, whoever changed it -- a click, SetActiveTabIndex, or a close or a reorder that moved it. A consumer binds to this, not to a tab.
OnValueChangedBPvoid DreamTabViewChangedEvent__DelegateSignature(int32 ActiveTabIndex)The <-> convention: two-way bindings synthesize their reverse route against this exact name, so a value control carries it alongside its spoken events. Fires with them.
OnTabClosedvoid DreamTabViewChangedEvent__DelegateSignature(int32 ActiveTabIndex)A tab is closing. Fired BEFORE the page is destroyed and the caption dropped, so a consumer that wants to keep the page can take it out of the switcher from here -- the same order UDreamDialog::Close broadcasts in, and for the same reason.
OnTabReorderedvoid DreamTabViewReorderEvent__DelegateSignature(int32 FromIndex, int32 ToIndex)A tab was dragged to a new place. Both indices are into the strip as it was before the move.

On this page