Widget Studio
UWidgetStudioModernSpinBox Class Reference

A modernly styled spin box from Widget Studio. More...

#include <WSModernSpinBox.h>

Inheritance diagram for UWidgetStudioModernSpinBox:
UWidgetStudioSliderBase UWidgetStudioBase

Public Member Functions

FText GetLabel () const
 Returns the label.
 
bool AreArrowButtonsEnabled () const
 Returns true if the user can interface with the Spin Box via the arrow buttons.
 
bool IsMouseWheelInputEnabled () const
 Returns true if the user can interface with the Spin Box via mouse wheel.
 
bool IsDragInputEnabled () const
 Returns true if the user can interface with the Spin Box via dragging.
 
EPalette GetBackgroundColor () const
 Returns the background color.
 
EPalette GetContentColor () const
 Returns the content color.
 
EPalette GetIndicatorColor () const
 Returns the indicator color.
 
void SetLabelText (const FText NewText)
 Set the text on the label. More...
 
void SetArrowButtonsEnabled (const bool bState)
 Set the Spin Box to be adjustable via the arrow buttons. More...
 
void SetMouseWheelInputEnabled (const bool bState)
 Set the Spin Box to be adjustable via mouse wheel. More...
 
void SetDragInputEnabled (const bool bState)
 Set the Spin Box to be adjustable via dragging. More...
 
void SetBackgroundColor (const EPalette NewColor)
 Set the background color. More...
 
void SetContentColor (const EPalette NewColor)
 Set the background color. More...
 
void SetIndicatorColor (const EPalette NewColor)
 Set the background color. More...
 
virtual void SetValue (float NewValue, bool bBroadcast=true) override
 Set the value of the slider. More...
 
- Public Member Functions inherited from UWidgetStudioSliderBase
EValueClamp GetClampMethod () const
 Returns the clamp method.
 
float GetValue () const
 Returns the current value.
 
FString GetValueAsString () const
 Returns the current value as FString.
 
FText GetValueAsText () const
 Returns the current value as FText.
 
float GetMinValue () const
 Returns the minimum slider value.
 
float GetMaxValue () const
 Returns the maximum slider value.
 
float GetStepSize () const
 Returns the step size of the slider.
 
EEnumeration GetEnumerationType () const
 Returns the enumeration type.
 
bool IsIncrementLocked () const
 Can the user increase the value?
 
bool IsDecrementLocked () const
 Can the user decrease the value?
 
void SetClampMethod (const EValueClamp NewMethod)
 Set the clamping method. More...
 
virtual void SetMinValue (float NewValue)
 Set the minimum value of the slider. More...
 
virtual void SetMaxValue (float NewValue)
 Set the maximum value of the slider. More...
 
virtual void SetStepSize (float NewValue)
 Set the step size of the slider. More...
 
virtual void SetEnumerationType (EEnumeration NewType)
 Set the enumeration type. More...
 
virtual void Increment (float Multiplier=1.f, bool bBroadcast=true)
 Increases the value by the step value. More...
 
virtual void Decrement (float Multiplier=1.f, bool bBroadcast=true)
 Decreases the value by the step value. More...
 
virtual void SetLockIncrement (bool NewState)
 Allow or disallow the user to increase the value. More...
 
virtual void SetLockDecrement (bool NewState)
 Allow or disallow the user to decrease the value. 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 FReply NativeOnMouseButtonDown (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
 
virtual FReply NativeOnMouseWheel (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
 
virtual void SynchronizeProperties () override
 
virtual void InitializeStyling () override
 
virtual void UpdateStyling () override
 
virtual void NativeTick (const FGeometry &MyGeometry, float InDeltaTime) override
 
void OnTextCommitted (const FText &InText, ETextCommit::Type InCommitMethod)
 
void UpdateValueOnMouseMovement ()
 Logic for updating the value based on X axis mouse movement. More...
 
- Protected Member Functions inherited from UWidgetStudioSliderBase
float FilterValue (float InValue) const
 Filter Value based on set properties. More...
 
- Protected Member Functions inherited from UWidgetStudioBase
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

USizeBox * SizeBox = nullptr
 
UOverlay * Overlay = nullptr
 
UWidgetStudioModernCardBackgroundIndicator = nullptr
 
UHorizontalBox * HorizontalBox = nullptr
 
UWidgetStudioTextLabelItem = nullptr
 
UOverlay * BackgroundOverlay = nullptr
 
UWidgetStudioModernCardBackground = nullptr
 
UWidgetStudioModernCardBackgroundFill = nullptr
 
UHorizontalBox * ContentHorizontalBox = nullptr
 
UWidgetStudioIconArrowLeft = nullptr
 
UWidgetStudioIconArrowRight = nullptr
 
UEditableTextBox * ValueInput = nullptr
 
bool bIsPressed = false
 States.
 
bool bIsLeftArrowPressed = false
 
bool bIsRightArrowPressed = false
 
float InitialMousePos = 0.f
 Mouse positions.
 
float LastMousePos = 0.f
 
float PressTime = 0.f
 
FText Label
 The text on the label. More...
 
bool bEnableArrowButtons = true
 Allows the user to adjust the value by pressing the arrow buttons. More...
 
bool bEnableMouseWheelInput = true
 Allows the user to adjust the value by using the mouse wheel.
 
bool bEnableDragInput = true
 Allows the user to adjust the value by dragging left/right. More...
 
EPalette BackgroundColor = EPalette::PrimaryBackground
 The color of the background.
 
EPalette ContentColor = EPalette::PrimaryContent
 The color of the content.
 
EPalette IndicatorColor = EPalette::PrimaryAccent
 The color of the indicator.
 
- Protected Attributes inherited from UWidgetStudioSliderBase
FWSSliderDelegate OnValueChanged
 
bool bLockIncrement = false
 
bool bLockDecrement = false
 
EValueClamp ClampMethod = EValueClamp::Clamped
 The clamping method for the widget.
 
EEnumeration Enumeration = EEnumeration::Int
 The value type of the slider. More...
 
float Value = 50.f
 The current value of the slider.
 
float Min = 0.f
 The minimum value of the slider.
 
float Max = 100.f
 The maximum value of the slider.
 
float StepSize = 1.f
 The step size value of the slider.
 

Additional Inherited Members

- 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 modernly styled spin box from Widget Studio.

Member Function Documentation

◆ InitializeStyling()

void UWidgetStudioModernSpinBox::InitializeStyling ( )
overrideprotectedvirtual

Reimplemented from UWidgetStudioBase.

◆ SetArrowButtonsEnabled()

void UWidgetStudioModernSpinBox::SetArrowButtonsEnabled ( const bool  bState)

Set the Spin Box to be adjustable via the arrow buttons.

Parameters
bStateThe new enabled state. When enabled, the user will be able to adjust the value via the arrow buttons. When disabled, the buttons will be hidden.

◆ SetBackgroundColor()

void UWidgetStudioModernSpinBox::SetBackgroundColor ( const EPalette  NewColor)

Set the background color.

Parameters
NewColorThe new color to apply to the background.

◆ SetContentColor()

void UWidgetStudioModernSpinBox::SetContentColor ( const EPalette  NewColor)

Set the background color.

Parameters
NewColorThe new color to apply to the content.

◆ SetDragInputEnabled()

void UWidgetStudioModernSpinBox::SetDragInputEnabled ( const bool  bState)

Set the Spin Box to be adjustable via dragging.

Parameters
bStateThe new enabled state. When enabled, the user will be able to adjust the value via the dragging.

◆ SetIndicatorColor()

void UWidgetStudioModernSpinBox::SetIndicatorColor ( const EPalette  NewColor)

Set the background color.

Parameters
NewColorThe new color to apply to the indicator.

◆ SetLabelText()

void UWidgetStudioModernSpinBox::SetLabelText ( const FText  NewText)

Set the text on the label.

Parameters
NewTextThe new text to display on the label. If text is left blank, then the label will be hidden.

◆ SetMouseWheelInputEnabled()

void UWidgetStudioModernSpinBox::SetMouseWheelInputEnabled ( const bool  bState)

Set the Spin Box to be adjustable via mouse wheel.

Parameters
bStateThe new enabled state. When enabled, the user will be able to adjust the value via the mouse wheel.

◆ SetValue()

void UWidgetStudioModernSpinBox::SetValue ( float  NewValue,
bool  bBroadcast = true 
)
overridevirtual

Set the value of the slider.

Parameters
NewValueThe value to set the slider to.
bBroadcastEnable to broadcast the OnValueChanged event.

Reimplemented from UWidgetStudioSliderBase.

◆ SynchronizeProperties()

void UWidgetStudioModernSpinBox::SynchronizeProperties ( )
overrideprotectedvirtual

Reimplemented from UWidgetStudioSliderBase.

◆ UpdateStyling()

void UWidgetStudioModernSpinBox::UpdateStyling ( )
overrideprotectedvirtual

Reimplemented from UWidgetStudioBase.

◆ UpdateValueOnMouseMovement()

void UWidgetStudioModernSpinBox::UpdateValueOnMouseMovement ( )
protected

Logic for updating the value based on X axis mouse movement.

Note: This is an internal function only and is called during tick when required.

Member Data Documentation

◆ bEnableArrowButtons

bool UWidgetStudioModernSpinBox::bEnableArrowButtons = true
protected

Allows the user to adjust the value by pressing the arrow buttons.

Note: The buttons will be hidden when disabled.

◆ bEnableDragInput

bool UWidgetStudioModernSpinBox::bEnableDragInput = true
protected

Allows the user to adjust the value by dragging left/right.

Note: Drag location originates from the left lip.

◆ Label

FText UWidgetStudioModernSpinBox::Label
protected

The text on the label.

Label is hidden when empty.


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