Navigation
API > API/Runtime > API/Runtime/Slate
Implements a widget switcher.
A widget switcher is like a tab control, but without tabs. At most one widget is visible at time.
| Name | SWidgetSwitcher |
| Type | class |
| Header File | /Engine/Source/Runtime/Slate/Public/Widgets/Layout/SWidgetSwitcher.h |
| Include Path | #include "Widgets/Layout/SWidgetSwitcher.h" |
Syntax
class SWidgetSwitcher : public SPanel
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → SWidget → SPanel → SWidgetSwitcher
- FSlateControlledConstruction → SWidget → SPanel → SWidgetSwitcher
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
SWidgetSwitcher() |
Widgets/Layout/SWidgetSwitcher.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~SWidgetSwitcher() |
Widgets/Layout/SWidgetSwitcher.h |
Structs
| Name | Remarks |
|---|---|
| FArguments |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FScopedWidgetSlotArguments | TPanelChildren< FSlot >::FScopedWidgetSlotArguments | Widgets/Layout/SWidgetSwitcher.h | |
| FSlot | FBasicLayoutWidgetSlot | Widgets/Layout/SWidgetSwitcher.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AllChildren | TPanelChildren< FSlot > | Holds the collection of all child widget, however the only one with a valid parent pointer will be the one in the dynamic slot. | Widgets/Layout/SWidgetSwitcher.h | |
| LastActiveWidget | TWeakPtr< SWidget > | Used to detect when WidgetIndex changes while bound. | Widgets/Layout/SWidgetSwitcher.h | |
| OneDynamicChild | TOneDynamicChild< FSlot > | Required to implement GetChildren() in a way that can dynamically return the currently active child. | Widgets/Layout/SWidgetSwitcher.h | |
| WidgetIndex | TAttribute< int32 > | Holds the desired widget index | Widgets/Layout/SWidgetSwitcher.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FScopedWidgetSlotArguments AddSlot
(
int32 SlotIndex |
Adds a slot to the widget switcher at the specified location. | Widgets/Layout/SWidgetSwitcher.h | |
void Construct
(
const FArguments& InArgs |
Constructs the widget. | Widgets/Layout/SWidgetSwitcher.h | |
TSharedPtr< SWidget > GetActiveWidget() |
Gets the active widget. | Widgets/Layout/SWidgetSwitcher.h | |
int32 GetActiveWidgetIndex() |
Gets the slot index of the currently active widget. | Widgets/Layout/SWidgetSwitcher.h | |
int32 GetNumWidgets() |
Gets the number of widgets that this switcher manages. | Widgets/Layout/SWidgetSwitcher.h | |
TSharedPtr< SWidget > GetWidget
(
int32 SlotIndex |
Gets the widget in the specified slot. | Widgets/Layout/SWidgetSwitcher.h | |
int32 GetWidgetIndex
(
TSharedRef< SWidget > Widget |
Gets the slot index of the specified widget. | Widgets/Layout/SWidgetSwitcher.h | |
int32 RemoveSlot
(
TSharedRef< SWidget > WidgetToRemove |
Removes a slot with the corresponding widget in it. | Widgets/Layout/SWidgetSwitcher.h | |
void SetActiveWidget
(
TSharedRef< SWidget > Widget |
Sets the active widget. | Widgets/Layout/SWidgetSwitcher.h | |
void SetActiveWidgetIndex
(
int32 Index |
Activates the widget at the specified index. | Widgets/Layout/SWidgetSwitcher.h |
Overridden from SWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool ValidatePathToChild
(
SWidget* InChild |
Widgets/Layout/SWidgetSwitcher.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const FSlot * GetActiveSlot() |
Widgets/Layout/SWidgetSwitcher.h | ||
TPanelChildren< FSlot > & GetTypedChildren() |
Widgets/Layout/SWidgetSwitcher.h | ||
virtual void OnSlotAdded
(
int32 AddedIndex |
Widgets/Layout/SWidgetSwitcher.h | ||
virtual void OnSlotRemoved
(
int32 RemovedIndex, |
Widgets/Layout/SWidgetSwitcher.h |
Overridden from SWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FVector2D ComputeDesiredSize
(
float |
Widgets/Layout/SWidgetSwitcher.h | ||
virtual bool ComputeVolatility() |
Widgets/Layout/SWidgetSwitcher.h | ||
virtual FChildren * GetChildren() |
Widgets/Layout/SWidgetSwitcher.h | ||
virtual void OnArrangeChildren
(
const FGeometry& AllottedGeometry, |
Widgets/Layout/SWidgetSwitcher.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FSlot::FSlotArguments Slot() |
Creates a new widget slot. | Widgets/Layout/SWidgetSwitcher.h |