SSpinBox

A Slate SpinBox resembles traditional spin boxes in that it is a widget that provides keyboard-based and mouse-based manipulation of a numeric value.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Slate

Header

/Engine/Source/Runtime/Slate/Public/Widgets/Input/SSpinBox.h

Include

#include "Widgets/Input/SSpinBox.h"

Syntax

template<typename NumericType>
class SSpinBox : public SCompoundWidget

Remarks

A Slate SpinBox resembles traditional spin boxes in that it is a widget that provides keyboard-based and mouse-based manipulation of a numeric value. Mouse-based manipulation: drag anywhere on the spinbox to change the value. Keyboard-based manipulation: click on the spinbox to enter text mode.

Constructors

Name Description

Public function

SSpinBox()

Functions

Name Description

Public function

void

 

ApplySliderMaxValueChanged

(
    float SliderDeltaToAdd,
    bool UpdateOnlyIfHigher
)

Public function

void

 

ApplySliderMinValueChanged

(
    float SliderDeltaToAdd,
    bool UpdateOnlyIfLower
)

Protected function

void

 

CommitValue

(
    double NewValue,
    ECommitMethod CommitMethod,
    ETextCommit::Type OriginalCommitInf...
)

Call this method when the user's interaction has changed the value

Public function

void

 

Construct

(
    const FArguments& InArgs
)

Construct the widget

Protected function

void

 

EnterTextMode()

Make the spinbox switch to keyboard-based input mode.

Protected function

void

 

ExitTextMode()

Make the spinbox switch to mouse-based input mode.

Protected function Static

float

 

Fraction

(
    double InValue,
    NumericType InMinValue,
    NumericType InMaxValue
)

Calculates range fraction. Possible to use on full numeric range

Public function Const

bool

 

GetAlwaysUsesDeltaSnap()

See the AlwaysUsesDeltaSnap attribute

Public function Const

NumericType

 

GetDelta()

See the Delta attribute

Public function Const

int32

 

GetMaxFractionalDigits()

See the MaxFractionalDigits attribute

Public function Const

NumericType

 

GetMaxSliderValue()

Public function Const

NumericType

 

GetMaxValue()

See the MaxValue attribute

Public function Const

float

 

GetMinDesiredWidth()

See the MinDesiredWidth attribute

Public function Const

int32

 

GetMinFractionalDigits()

See the MinFractionalDigits attribute

Public function Const

NumericType

 

GetMinSliderValue()

Public function Const

NumericType

 

GetMinValue()

See the MinValue attribute

Public function Const

float

 

GetSliderExponent()

See the SliderExponent attribute

Public function Const

float

 

GetValue()

See the Value attribute

Protected function Const

FString

 

GetValueAsString()

Protected function Const

FText

 

GetValueAsText()

Public function Const

TAttribute< ...

 

GetValueAttribute()

Return the Value attribute

Protected function Const

bool

 

IsInTextMode()

Public function Const

bool

 

IsMaxSliderValueBound()

See the MaxSliderValue attribute

Public function Const

bool

 

IsMinSliderValueBound()

See the MinSliderValue attribute

Protected function Const

void

 

NotifyValueCommitted()

Public function

void

 

SetAlwaysUsesDeltaSnap

(
    bool bNewValue
)

Public function

void

 

SetDelta

(
    NumericType InDelta
)

Public function

void

 

SetMaxFractionalDigits

(
    const TAttribute< TOptional< int32 ...
)

Public function

void

 

SetMaxSliderValue

(
    const TAttribute< TOptional< Numeri...
)

Public function

void

 

SetMaxValue

(
    const TAttribute< TOptional< Numeri...
)

Public function

void

 

SetMinDesiredWidth

(
    const TAttribute< float >& InMinDe...
)

Public function

void

 

SetMinFractionalDigits

(
    const TAttribute< TOptional< int32 ...
)

Public function

void

 

SetMinSliderValue

(
    const TAttribute< TOptional< Numeri...
)

Public function

void

 

SetMinValue

(
    const TAttribute< TOptional< Numeri...
)

Public function

void

 

SetSliderExponent

(
    const TAttribute< float >& InSlide...
)

Public function

void

 

SetValue

(
    const TAttribute< NumericType >& I...
)

Protected function Static

double

 

Snap

(
    double InValue,
    double InGrid
)

Snaps value to a nearest grid multiple. Clamps value if it's outside numeric range

Protected function

void

 

TextField_OnTextChanged

(
    const FText& NewText
)

Invoked when the text in the text field changes

Protected function

void

 

TextField_OnTextCommitted

(
    const FText& NewText,
    ETextCommit::Type CommitInfo
)

Invoked when the text field commits its text.

Overridden from SWidget

Name Description

Public function Virtual Const

bool

 

HasKeyboardFocus()

Checks to see if this widget currently has the keyboard focus

Public function Virtual Const

FCursorReply

 

OnCursorQuery

(
    const FGeometry& MyGeometry,
    const FPointerEvent& CursorEvent
)

The system asks each widget under the mouse to provide a cursor. This event is bubbled.

Public function Virtual

FReply

 

OnFocusReceived

(
    const FGeometry& MyGeometry,
    const FFocusEvent& InFocusEvent
)

KEY INPUT Called when focus is given to this widget. This event does not bubble.

Public function Virtual

FReply

 

OnKeyDown

(
    const FGeometry& MyGeometry,
    const FKeyEvent& InKeyEvent
)

Called after a key is pressed when this widget has focus (this event bubbles if not handled)

Public function Virtual

FReply

 

OnMouseButtonDown

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

The system calls this method to notify the widget that a mouse button was pressed within it.

Public function Virtual

FReply

 

OnMouseButtonUp

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

The system calls this method to notify the widget that a mouse button was release within it.

Public function Virtual

FReply

 

OnMouseMove

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

The system calls this method to notify the widget that a mouse moved within it.

Public function Virtual Const

int32

 

OnPaint

(
    const FPaintArgs& Args,
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    FSlateWindowElementList& OutDrawEl...,
    int32 LayerId,
    const FWidgetStyle& InWidgetStyle,
    bool bParentEnabled
)

The widget should respond by populating the OutDrawElements array with FDrawElements that represent it and any of its children.

Public function Virtual Const

bool

 

SupportsKeyboardFocus()

Checks to see if this widget supports keyboard focus. Override this in derived classes.

Classes

Name

Description

Public struct

FArguments

Enums

Name

Description

Protected enum

ECommitMethod

How user changed the value in the spinbox

Typedefs

Name

Description

FOnDynamicSliderMinMaxValueChanged

Notification when the max/min spinner values are changed (only apply if SupportDynamicSliderMaxValue or SupportDynamicSliderMinValue are true)

FOnValueChanged

Notification for numeric value change

FOnValueCommitted

Notification for numeric value committed

Constants

Name

Description

DefaultMaxFractionalDigits

The default maximum fractional digits

DefaultMinFractionalDigits

The default minimum fractional digits

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss