A base class for building a option container such as a tab bar or combo box. More...
#include <WSContainer.h>
Public Member Functions | |
int32 | GetCurrentIndex () const |
Return the index of the current selected button. | |
int32 | GetOptionCount () const |
Returns the number of options. | |
TArray< FButtonOptions > | GetOptions () const |
Returns the options. | |
FButtonOptions | GetOptionAtIndex (int32 Index) |
Return the option at the given index. | |
FButtonOptions | GetCurrentOption () const |
Get the options of the current button. | |
int32 | GetOptionIndexViaText (FText InText) |
Returns the Option Index based on given text. More... | |
void | IncrementCurrentIndex (bool bBroadcast=true) |
Increases the current index by 1. More... | |
void | DecrementCurrentIndex (bool bBroadcast=true) |
Decreases the current index by 1. More... | |
void | ClearCurrentIndex (bool bBroadcast=true) |
Sets the current index to -1. More... | |
virtual void | SetOptions (TArray< FButtonOptions > NewOptions) |
Override the options in this container. More... | |
virtual void | SetCurrentIndex (int32 Index, bool bBroadcast=true) |
Set the current index. More... | |
void | AddOption (FButtonOptions NewOption) |
Add an option to the container. More... | |
virtual void | ClearOptions () |
Clear all options from the container. More... | |
bool | SetCurrentIndexViaOptionText (FText InText, bool bBroadcast=true) |
Finds and sets the current index based on option text. More... | |
![]() | |
FVector2D | GetDimensions () const |
Returns the current X and Y dimensions of the Widget. More... | |
int32 | GetBorderRadius () const |
Returns the current border radius of the Widget. More... | |
void | ForceStyleUpdate () |
Refresh the dynamic styling of the Widget Studio widget. | |
void | SetSizeModifier (ESizeModifier InSizeModifier) |
Set the size modifier of the Widget Studio widget. | |
Public Attributes | |
FWSContainerDelegate | OnCurrentIndexChanged |
Called when the current index has been changed. | |
FWSContainerHoverDelegate | OnIndividualHoverStateChanged |
Called when an individual widget contained in the container's hover state has changed. | |
![]() | |
FWSBaseHoverStateDelegate | OnHoverStateChanged |
Called when the hover state has been changed. | |
bool | bCanOverrideDimensions = true |
Used to enable or disable dimension override's. | |
bool | bCanOverrideBorderRadius = true |
Used to enable or disable dimension override's. | |
FVector2D | MinimumDimensions = FVector2D(50, 7) |
The minimum dimensions of the widget. More... | |
bool | bDisablePainting = false |
Used for debugging. More... | |
float | AnimationTime = 7 |
The animation interpolation speed. More... | |
ESizeModifier | SizeModifier = ESizeModifier::Regular |
Quickly modify the overall size of the widget. More... | |
FVector2D | OverrideDimensions = FVector2D(0, 0) |
Manually adjust the X and Y dimensions of the widget. More... | |
int32 | OverrideBorderRadius = -1 |
Manually adjust the border radius of the widget. More... | |
Protected Member Functions | |
virtual void | ConstructOption (FButtonOptions Option) |
virtual void | SynchronizeProperties () override |
virtual void | IndividualHoverStateChanged (UWidgetStudioBase *CallingWidget, const bool bIsHovering) |
![]() | |
virtual void | InitializeStyling () |
virtual void | UpdateStyling () |
virtual void | NativeOnMouseEnter (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override |
virtual void | NativeOnMouseLeave (const FPointerEvent &InMouseEvent) override |
virtual void | NativeOnMouseCaptureLost (const FCaptureLostEvent &CaptureLostEvent) override |
Protected Attributes | |
int32 | CurrentIndex = -1 |
The current option selected. More... | |
TArray< FButtonOptions > | Options |
The options that will be available. | |
A base class for building a option container such as a tab bar or combo box.
void UWidgetStudioContainer::AddOption | ( | FButtonOptions | NewOption | ) |
Add an option to the container.
NewOption | The option to add to the container. |
void UWidgetStudioContainer::ClearCurrentIndex | ( | bool | bBroadcast = true | ) |
Sets the current index to -1.
No option will be labeled as selected.
bBroadcast | When true, OnCurrentIndexChanged will be broadcasted. |
|
virtual |
Clear all options from the container.
Reimplemented in UWidgetStudioModernTabBar.
void UWidgetStudioContainer::DecrementCurrentIndex | ( | bool | bBroadcast = true | ) |
Decreases the current index by 1.
Can only go as low as index 0.
bBroadcast | When true, OnCurrentIndexChanged will be broadcasted. |
int32 UWidgetStudioContainer::GetOptionIndexViaText | ( | FText | InText | ) |
Returns the Option Index based on given text.
InText | The text to find the option by. |
void UWidgetStudioContainer::IncrementCurrentIndex | ( | bool | bBroadcast = true | ) |
Increases the current index by 1.
bBroadcast | When true, OnCurrentIndexChanged will be broadcasted. |
|
virtual |
Set the current index.
Index | The index to set the current index to. |
bBroadcast | When true, OnCurrentIndexChanged will be broadcasted. |
Reimplemented in UWidgetStudioModernComboBox, and UWidgetStudioModernTabBar.
bool UWidgetStudioContainer::SetCurrentIndexViaOptionText | ( | FText | InText, |
bool | bBroadcast = true |
||
) |
Finds and sets the current index based on option text.
Returns false if it could not find the option.
InText | The option text to set the current index to. |
bBroadcast | When true, OnCurrentIndexChanged will be broadcasted. |
|
virtual |
Override the options in this container.
NewOptions | The array of button options to use in the container. |
|
protected |
The current option selected.
A value of -1 will indicate that no option is selected.