Widget Studio
UWidgetStudioContainer Class Reference

A base class for building a option container such as a tab bar or combo box. More...

#include <WSContainer.h>

Inheritance diagram for UWidgetStudioContainer:
UWidgetStudioBase UWidgetStudioModernComboBox UWidgetStudioModernTabBar

Public Member Functions

int32 GetCurrentIndex () const
 Return the index of the current selected button.
 
int32 GetOptionCount () const
 Returns the number of options.
 
TArray< FButtonOptionsGetOptions () 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...
 
- Public Member Functions inherited from UWidgetStudioBase
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.
 
- Public Attributes inherited from UWidgetStudioBase
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)
 
- Protected Member Functions inherited from UWidgetStudioBase
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< FButtonOptionsOptions
 The options that will be available.
 

Detailed Description

A base class for building a option container such as a tab bar or combo box.

Member Function Documentation

◆ AddOption()

void UWidgetStudioContainer::AddOption ( FButtonOptions  NewOption)

Add an option to the container.

Parameters
NewOptionThe option to add to the container.

◆ ClearCurrentIndex()

void UWidgetStudioContainer::ClearCurrentIndex ( bool  bBroadcast = true)

Sets the current index to -1.

No option will be labeled as selected.

Parameters
bBroadcastWhen true, OnCurrentIndexChanged will be broadcasted.

◆ ClearOptions()

void UWidgetStudioContainer::ClearOptions ( )
virtual

Clear all options from the container.

Reimplemented in UWidgetStudioModernTabBar.

◆ DecrementCurrentIndex()

void UWidgetStudioContainer::DecrementCurrentIndex ( bool  bBroadcast = true)

Decreases the current index by 1.

Can only go as low as index 0.

Parameters
bBroadcastWhen true, OnCurrentIndexChanged will be broadcasted.

◆ GetOptionIndexViaText()

int32 UWidgetStudioContainer::GetOptionIndexViaText ( FText  InText)

Returns the Option Index based on given text.

Parameters
InTextThe text to find the option by.

◆ IncrementCurrentIndex()

void UWidgetStudioContainer::IncrementCurrentIndex ( bool  bBroadcast = true)

Increases the current index by 1.

Parameters
bBroadcastWhen true, OnCurrentIndexChanged will be broadcasted.

◆ SetCurrentIndex()

void UWidgetStudioContainer::SetCurrentIndex ( int32  Index,
bool  bBroadcast = true 
)
virtual

Set the current index.

Parameters
IndexThe index to set the current index to.
bBroadcastWhen true, OnCurrentIndexChanged will be broadcasted.

Reimplemented in UWidgetStudioModernComboBox, and UWidgetStudioModernTabBar.

◆ SetCurrentIndexViaOptionText()

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.

Parameters
InTextThe option text to set the current index to.
bBroadcastWhen true, OnCurrentIndexChanged will be broadcasted.

◆ SetOptions()

void UWidgetStudioContainer::SetOptions ( TArray< FButtonOptions NewOptions)
virtual

Override the options in this container.

Parameters
NewOptionsThe array of button options to use in the container.

Member Data Documentation

◆ CurrentIndex

int32 UWidgetStudioContainer::CurrentIndex = -1
protected

The current option selected.

A value of -1 will indicate that no option is selected.


The documentation for this class was generated from the following files: