Widget Studio
UWidgetStudioModernButton Class Reference

A fully styled functional button from the Widget Studio. More...

#include <WSModernButton.h>

Inheritance diagram for UWidgetStudioModernButton:
UWidgetStudioButtonBase UWidgetStudioBase

Public Member Functions

bool IsTextValid () const
 Is the text valid?
 
FText GetText () const
 Returns the text displayed on the button.
 
FWSTextStyle GetTextOptions () const
 Returns the text style options.
 
bool IsIconValid () const
 Is the icon valid?
 
EIconItem GetIcon () const
 Returns the icon displayed on the button.
 
FWSIconStyle GetIconOptions () const
 Returns the icon style options.
 
bool IsIconColoredByPalette () const
 Returns true if the color is being colored by the theme's palette.
 
bool IsUsingCustomIcon () const
 Returns true if a custom icon has been set and is being used.
 
UTexture2D * GetCustomIcon () const
 Returns the custom icon.
 
EPalette GetStandardBackgroundColor () const
 Returns the standard background color of the button.
 
EPalette GetCheckedBackgroundColor () const
 Returns the checked background color of the button.
 
EPalette GetStandardContentColor () const
 Returns the standard content (Icon/Text) color of the button.
 
EPalette GetCheckedContentColor () const
 Returns the checked content (Icon/Text) color of the button.
 
EWSPlacement GetIconPlacement () const
 Returns the placement of the icon within the button.
 
ECornerStyle GetCornerStyle () const
 Returns the corner style of the button.
 
EButtonStyle GetButtonStyle () const
 Returns the style of the button.
 
EButtonContentStyle GetContentStyle () const
 Returns the content style of the button.
 
void SetText (FText NewText)
 Set the text displayed. More...
 
void SetTextOptions (FWSTextStyle NewTextOptions)
 Set the text style options. More...
 
void SetAlignment (TEnumAsByte< EHorizontalAlignment > NewAlignment)
 Set the placement of the content on the button. More...
 
void SetIcon (EIconItem NewIcon)
 Set the icon displayed. More...
 
void SetIconOptions (FWSIconStyle NewIconOptions)
 Set the icon style options. More...
 
void SetIconPlacement (EWSPlacement NewIconPlacement)
 Set the placement of the icon on the button. More...
 
void SetColorIconByPalette (bool NewState)
 Set the icon coloring method. More...
 
void SetCustomIcon (UTexture2D *NewCustomIcon)
 Sets the icon to use a custom icon. More...
 
void ClearCustomIcon ()
 Clears the set custom icon and automatically switches the widget to use the icon library.
 
void SetStandardBackgroundColor (EPalette NewColor)
 Set the color of the background when the button is NOT in a checked state. More...
 
void SetCheckedBackgroundColor (EPalette NewColor)
 Set the color of the background when the button IS in a checked state. More...
 
void SetStandardContentColor (EPalette NewColor)
 Set the color of the content (Text/Icon) when the button is NOT in a checked state. More...
 
void SetCheckedContentColor (EPalette NewColor)
 Set the color of the content (Text/Icon) when the button IS in a checked state. More...
 
void SetCornerStyle (ECornerStyle NewCornerStyle)
 Set how the corners of the button will appear visually. More...
 
void SetButtonStyle (EButtonStyle NewButtonStyle)
 Set how the style of the button will appear visually. More...
 
void SetContentStyle (EButtonContentStyle NewContentStyle)
 Set how the content of the button will appear visually. More...
 
void SetOptions (FButtonOptions NewOptions)
 Set the overall options of the button. More...
 
- Public Member Functions inherited from UWidgetStudioButtonBase
void ExecuteOnPressedLambda (UWidgetStudioButtonBase *CallingButton)
 Executes the OnPressedLambda delegate. More...
 
bool IsCheckable () const
 Returns the checkable state of the button. More...
 
bool IsChecked () const
 Returns the checked state of the button. More...
 
bool IsCheckedStateLocked () const
 Returns the checked lock state of the button.
 
bool IsPressed () const
 Returns the pressed state of the button.
 
virtual void SetCheckable (bool bNewCheckableState)
 Set the checkable state of the button. More...
 
virtual void SetChecked (bool bNewCheckedState, bool bBroadcast=true)
 Set the checked state of the button. More...
 
virtual void SetCheckedLockedState (bool bNewCheckedState)
 Lock or unlock the ability to change the checked state of the button. 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.
 

Protected Member Functions

virtual TSharedRef< SWidget > RebuildWidget () override
 
virtual int32 NativePaint (const FPaintArgs &Args, const FGeometry &AllottedGeometry, const FSlateRect &MyCullingRect, FSlateWindowElementList &OutDrawElements, int32 LayerId, const FWidgetStyle &InWidgetStyle, bool bParentEnabled) const override
 
virtual void SynchronizeProperties () override
 
virtual void InitializeStyling () override
 
virtual void UpdateStyling () override
 
void UpdateContentPositionsAndStyling () const
 
- Protected Member Functions inherited from UWidgetStudioButtonBase
virtual void NativeOnInitialized () override
 
virtual FReply NativeOnMouseButtonDown (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
 
virtual FReply NativeOnMouseButtonUp (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
 
virtual void NativeOnMouseCaptureLost (const FCaptureLostEvent &CaptureLostEvent) override
 
virtual void NativeOnMouseLeave (const FPointerEvent &InMouseEvent) override
 
- Protected Member Functions inherited from UWidgetStudioBase
virtual void NativeOnMouseEnter (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
 

Protected Attributes

const float BaseDropShadowOpacity = .15
 
float ShadowLength
 
UInvalidationBox * Retainer = nullptr
 
USizeBox * SizeBox = nullptr
 
UOverlay * Overlay = nullptr
 
UOverlay * BackgroundOverlay = nullptr
 
UOverlay * ContentOverlay = nullptr
 
UScaleBox * BackgroundScaleBox = nullptr
 
UImage * DropShadow = nullptr
 
UImage * Background = nullptr
 
UHorizontalBox * HorizontalContent = nullptr
 
UVerticalBox * VerticalContent = nullptr
 
UWidgetStudioIconIconItem = nullptr
 
USpacer * SpacerItem = nullptr
 
UWidgetStudioTextTextItem = nullptr
 
- Protected Attributes inherited from UWidgetStudioButtonBase
FTimerHandle DoublePressTimer
 
bool bIsCheckable = false
 Depicts if the button can be checked or not.
 
bool bIsChecked = false
 Depicts if the button is checked (on/true) or not (off/false). More...
 
bool bIsCheckedStateLocked = false
 Locks the current checked state. More...
 

Additional Inherited Members

- Public Attributes inherited from UWidgetStudioButtonBase
FWSButtonLambda OnPressedLambda
 An open lambda binding for to be used for complex functionality when the button is pressed. More...
 
FWSButtonDelegate OnPressed
 Called when the button is pressed with the left mouse button.
 
FWSButtonDelegate OnReleased
 Called when the button is released.
 
FWSButtonDelegate OnDoublePressed
 Called when the button is quickly pressed twice with the left mouse button.
 
FWSButtonToggledDelegate OnToggled
 Called when the buttons checked status is toggled. More...
 
bool bForceCheckable = false
 
bool bIsInteractable = true
 Internal Use Only. More...
 
- 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...
 

Detailed Description

A fully styled functional button from the Widget Studio.

Can be used for all button needs and purposes with minimal setup.

Member Function Documentation

◆ InitializeStyling()

void UWidgetStudioModernButton::InitializeStyling ( )
overrideprotectedvirtual

Reimplemented from UWidgetStudioBase.

◆ SetAlignment()

void UWidgetStudioModernButton::SetAlignment ( TEnumAsByte< EHorizontalAlignment >  NewAlignment)

Set the placement of the content on the button.

Parameters
NewAlignmentThe new alignment to align the buttons contents to.

◆ SetButtonStyle()

void UWidgetStudioModernButton::SetButtonStyle ( EButtonStyle  NewButtonStyle)

Set how the style of the button will appear visually.

Parameters
NewButtonStyleThe style of the button to update to.

◆ SetCheckedBackgroundColor()

void UWidgetStudioModernButton::SetCheckedBackgroundColor ( EPalette  NewColor)

Set the color of the background when the button IS in a checked state.

Parameters
NewColorThe color to apply to the checked background of the button.

◆ SetCheckedContentColor()

void UWidgetStudioModernButton::SetCheckedContentColor ( EPalette  NewColor)

Set the color of the content (Text/Icon) when the button IS in a checked state.

Parameters
NewColorThe color to apply to the checked content of the button.

◆ SetColorIconByPalette()

void UWidgetStudioModernButton::SetColorIconByPalette ( bool  NewState)

Set the icon coloring method.

If set to true, the icon will be colored by the palette. If set to false, the icon will use it's default color.

Parameters
NewStateThe state of using coloring the icon by the set color palette (true) or by using the icons own texture color (false).

◆ SetContentStyle()

void UWidgetStudioModernButton::SetContentStyle ( EButtonContentStyle  NewContentStyle)

Set how the content of the button will appear visually.

Parameters
NewContentStyleThe style of the content to update to.

◆ SetCornerStyle()

void UWidgetStudioModernButton::SetCornerStyle ( ECornerStyle  NewCornerStyle)

Set how the corners of the button will appear visually.

Parameters
NewCornerStyleThe style of the corners to update to.

◆ SetCustomIcon()

void UWidgetStudioModernButton::SetCustomIcon ( UTexture2D *  NewCustomIcon)

Sets the icon to use a custom icon.

Parameters
NewCustomIconThe texture2D to use as an icon.

◆ SetIcon()

void UWidgetStudioModernButton::SetIcon ( EIconItem  NewIcon)

Set the icon displayed.

Parameters
NewIconThe icon to display on the button.

◆ SetIconOptions()

void UWidgetStudioModernButton::SetIconOptions ( FWSIconStyle  NewIconOptions)

Set the icon style options.

Parameters
NewIconOptionsThe icon style options.

◆ SetIconPlacement()

void UWidgetStudioModernButton::SetIconPlacement ( EWSPlacement  NewIconPlacement)

Set the placement of the icon on the button.

Parameters
NewIconPlacementWhere to place the icon within the button.

◆ SetOptions()

void UWidgetStudioModernButton::SetOptions ( FButtonOptions  NewOptions)

Set the overall options of the button.

Parameters
NewOptionsThe options to update to.

◆ SetStandardBackgroundColor()

void UWidgetStudioModernButton::SetStandardBackgroundColor ( EPalette  NewColor)

Set the color of the background when the button is NOT in a checked state.

Parameters
NewColorThe color to apply to the background of the button.

◆ SetStandardContentColor()

void UWidgetStudioModernButton::SetStandardContentColor ( EPalette  NewColor)

Set the color of the content (Text/Icon) when the button is NOT in a checked state.

Parameters
NewColorThe color to apply to the content of the button.

◆ SetText()

void UWidgetStudioModernButton::SetText ( FText  NewText)

Set the text displayed.

Parameters
NewTextThe text to display on the button.

◆ SetTextOptions()

void UWidgetStudioModernButton::SetTextOptions ( FWSTextStyle  NewTextOptions)

Set the text style options.

Parameters
NewTextOptionsThe text style options.

◆ UpdateStyling()

void UWidgetStudioModernButton::UpdateStyling ( )
overrideprotectedvirtual

Reimplemented from UWidgetStudioBase.


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