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 { ... }Properties
| Name | Type | Category | In the details panel | From Blueprint | Description |
|---|---|---|---|---|---|
Style | FDreamTabViewStyle | Tab View | yes | SetStyle | This 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. |
TabLabels | TArray<FText> | Tab View | yes | SetTabLabels | The 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. |
ActiveTabIndex | int32 | Tab View | yes | GetActiveTabIndex / SetActiveTabIndex | Which 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. |
TabTemplateClass | TSubclassOf<UDreamUserWidget> | Tab View | yes | SetTabTemplateClass | A 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. |
TabEnabled | TArray<bool> | Tab View | yes | SetTabEnabledStates | Which 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. |
bTabsClosable | bool | Tab View | yes | SetTabsClosable | Every tab carries a close button, and clicking one closes that tab -- the browser's arrangement. |
bTabsDraggable | bool | Tab View | yes | SetTabsDraggable | Tabs can be dragged along the strip to reorder them, carrying their pages with them. |
bFocusPageOnTabChange | bool | Tab View | yes | SetFocusPageOnTabChange | Switching tabs moves focus into the new page. |
BodyNode | TObjectPtr<UDreamWidget> | Tab View | - | read only | The parts, in the shape the rest of the framework expects to find them. |
StripNode | TObjectPtr<UDreamWidget> | Tab View | - | read only | |
IndicatorNode | TObjectPtr<UDreamWidget> | Tab View | - | read only | The line under the open tab. Layout-ignoring; this control is the only thing that places it. |
PageHostNode | TObjectPtr<UDreamWidget> | Tab View | - | read only | The page area: the switcher's widget, and the panel a page's background is drawn on. |
PageSwitcher | TObjectPtr<UDreamLayoutContainerWidgetSwitcher> | Tab View | - | read only | |
TabGroup | TObjectPtr<UUIToggleGroup> | Tab View | - | read only | Mutual exclusion, borrowed whole from the radio button's mechanism. |
Tabs | TArray<FDreamTabViewTab> | Tab View | - | read only | One entry per tab in the strip, in strip order. |
Functions
| Function | Kind | Description |
|---|---|---|
void AddPage(UDreamWidget* InPage) | callable | Put 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) | callable | Close a tab: broadcast, then drop its caption and destroy its page, then regrow the strip. |
UDreamWidget* GetActivePage() | pure | The page the switcher is showing, or null before any page is attached. |
int32 GetActiveTabIndex() | pure | Get Active Tab Index |
UDreamWidget* GetPage(int32 InIndex) | pure | Get Page |
int32 GetPageCount() | pure | How many pages the switcher holds. Not necessarily how many tabs the strip shows. |
bool IsTabEnabled(int32 InIndex) | pure | A missing entry means enabled -- see TabEnabled. |
void MoveTab(int32 InFromIndex, int32 InToIndex) | callable | Move 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) | callable | Open a tab. Broadcasts when the index actually moved, exactly as a click on the tab would. |
void SetActiveTabIndexWithoutNotify(int32 InIndex) | callable | The 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) | callable | Set Focus Page on Tab Change |
void SetStyle(FDreamTabViewStyle InStyle) | callable | Replace the look and push it. |
void SetTabEnabled(int32 InIndex, bool bInEnabled) | callable | Grows 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) | callable | Every tab's enabled flag at once; a missing entry means enabled. SetTabEnabled changes one. |
void SetTabLabels(TArray<FText> InLabels) | callable | Replace the captions and regenerate the strip. |
void SetTabsClosable(bool bInTabsClosable) | callable | Show 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) | callable | Set Tabs Draggable |
void SetTabTemplateClass(TSubclassOf<UDreamUserWidget> InTabTemplateClass) | callable | The authored tab content. Instanced into each tab at build, so a new class means a rebuild. |
Events
| Event | Signature | Description |
|---|---|---|
OnTabGenerated | void 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. |
OnTabChanged | void 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. |
OnValueChangedBP | void 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. |
OnTabClosed | void 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. |
OnTabReordered | void 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. |