Navigation
API > API/Runtime > API/Runtime/Slate
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.
| Name | SSpinBox |
| Type | class |
| Header File | /Engine/Source/Runtime/Slate/Public/Widgets/Input/SSpinBox.h |
| Include Path | #include "Widgets/Input/SSpinBox.h" |
Syntax
template<typename NumericType>
class SSpinBox : public SCompoundWidget
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → SWidget → SCompoundWidget → SSpinBox
- FSlateControlledConstruction → SWidget → SCompoundWidget → SSpinBox
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
SSpinBox() |
Widgets/Input/SSpinBox.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~SSpinBox() |
Widgets/Input/SSpinBox.h |
Structs
| Name | Remarks |
|---|---|
| FArguments | |
| FPendingCommitValue | New value to be Committed on Tick for MouseMove events This exists to insulate high-frequency mouse move events which can fire many times during input processing from the side-effects of committing the spinbox value |
Enums
Protected
| Name | Remarks |
|---|---|
| ECommitMethod | How user changed the value in the spinbox |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOnDynamicSliderMinMaxValueChanged | TBaseDelegate_FourParams< void, NumericType, TWeakPtr< SWidget >, bool, bool > | Notification when the max/min spinner values are changed (only apply if SupportDynamicSliderMaxValue or SupportDynamicSliderMinValue are true) | Widgets/Input/SSpinBox.h |
| FOnGetDisplayValue | TBaseDelegate_OneParam< TOptional< FText >, NumericType > | Optional customization of the display value based on the current value. | Widgets/Input/SSpinBox.h |
| FOnValueChanged | TBaseDelegate_OneParam< void, NumericType > | Notification for numeric value change | Widgets/Input/SSpinBox.h |
| FOnValueCommitted | TBaseDelegate_TwoParams< void, NumericType, ETextCommit::Type > | Notification for numeric value committed | Widgets/Input/SSpinBox.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| DefaultMaxFractionalDigits | int32 | The default maximum fractional digits | Widgets/Input/SSpinBox.h |
| DefaultMinFractionalDigits | int32 | The default minimum fractional digits | Widgets/Input/SSpinBox.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActiveFillBrush | const FSlateBrush * | Widgets/Input/SSpinBox.h | ||
| AlwaysUsesDeltaSnap | TAttribute< bool > | Widgets/Input/SSpinBox.h | ||
| BackgroundActiveBrush | const FSlateBrush * | Widgets/Input/SSpinBox.h | ||
| BackgroundBrush | const FSlateBrush * | Widgets/Input/SSpinBox.h | ||
| BackgroundHoveredBrush | const FSlateBrush * | Widgets/Input/SSpinBox.h | ||
| bBroadcastValueChangesPerKey | bool | True to broadcast every time we type. | Widgets/Input/SSpinBox.h | |
| bCachedValueStringDirty | bool | Whetever the interfaced setting changed and the CachedValueString needs to be recomputed. | Widgets/Input/SSpinBox.h | |
| bDragging | bool | Whether the user is dragging the slider | Widgets/Input/SSpinBox.h | |
| bEnableWheel | bool | Does this spin box have the mouse wheel feature enabled? | Widgets/Input/SSpinBox.h | |
| bIsTextChanging | bool | Re-entrant guard for the text changed handler | Widgets/Input/SSpinBox.h | |
| bPreventThrottling | bool | Holds whether or not to prevent throttling during mouse capture When true, the viewport will be updated with every single change to the value during dragging | Widgets/Input/SSpinBox.h | |
| bUnlimitedSpinRange | bool | True when no range is specified, spinner can be spun indefinitely | Widgets/Input/SSpinBox.h | |
| CachedExternalValue | NumericType | This is the cached value the user believes it to be (usually different due to truncation to an int). | Widgets/Input/SSpinBox.h | |
| CachedMousePosition | FIntPoint | Cached mouse position to restore after scrolling. | Widgets/Input/SSpinBox.h | |
| CachedValueString | FString | Used to prevent per-frame re-conversion of the cached numeric value to a string. | Widgets/Input/SSpinBox.h | |
| CtrlMultiplier | TAttribute< float > | Widgets/Input/SSpinBox.h | ||
| Delta | TAttribute< NumericType > | Widgets/Input/SSpinBox.h | ||
| DistanceDragged | float | Widgets/Input/SSpinBox.h | ||
| EditableText | TSharedPtr< SEditableText > | Widgets/Input/SSpinBox.h | ||
| EnableSlider | TAttribute< bool > | Widgets/Input/SSpinBox.h | ||
| HoveredFillBrush | const FSlateBrush * | Widgets/Input/SSpinBox.h | ||
| InactiveFillBrush | const FSlateBrush * | Widgets/Input/SSpinBox.h | ||
| InterfaceAttr | TAttribute< TSharedPtr< INumericTypeInterface< NumericType > > > | Interface that defines conversion functionality for the templated type | Widgets/Input/SSpinBox.h | |
| InternalValue | double | This value represents what the spinbox believes the value to be, regardless of delta and the user binding to an int. | Widgets/Input/SSpinBox.h | |
| LinearDeltaSensitivity | TAttribute< int32 > | Widgets/Input/SSpinBox.h | ||
| MaxFractionalDigits | TAttribute< TOptional< int32 > > | Widgets/Input/SSpinBox.h | ||
| MaxSliderValue | TAttribute< TOptional< NumericType > > | Widgets/Input/SSpinBox.h | ||
| MaxValue | TAttribute< TOptional< NumericType > > | Widgets/Input/SSpinBox.h | ||
| MinDesiredWidth | TAttribute< float > | Prevents the spinbox from being smaller than desired in certain cases (e.g. when it is empty) | Widgets/Input/SSpinBox.h | |
| MinFractionalDigits | TAttribute< TOptional< int32 > > | Widgets/Input/SSpinBox.h | ||
| MinSliderValue | TAttribute< TOptional< NumericType > > | Widgets/Input/SSpinBox.h | ||
| MinValue | TAttribute< TOptional< NumericType > > | Widgets/Input/SSpinBox.h | ||
| OnBeginSliderMovement | FSimpleDelegate | Widgets/Input/SSpinBox.h | ||
| OnDynamicSliderMaxValueChanged | FOnDynamicSliderMinMaxValueChanged | Widgets/Input/SSpinBox.h | ||
| OnDynamicSliderMinValueChanged | FOnDynamicSliderMinMaxValueChanged | Widgets/Input/SSpinBox.h | ||
| OnEditEditableText | FOnGetDisplayValue | Widgets/Input/SSpinBox.h | ||
| OnEndSliderMovement | FOnValueChanged | Widgets/Input/SSpinBox.h | ||
| OnGetDisplayValue | FOnGetDisplayValue | Widgets/Input/SSpinBox.h | ||
| OnValueChanged | FOnValueChanged | Widgets/Input/SSpinBox.h | ||
| OnValueCommitted | FOnValueCommitted | Widgets/Input/SSpinBox.h | ||
| PendingCommitValue | TOptional< FPendingCommitValue > | Widgets/Input/SSpinBox.h | ||
| PointerDraggingSliderIndex | int32 | Tracks which cursor is currently dragging the slider (e.g., the mouse cursor or a specific finger) | Widgets/Input/SSpinBox.h | |
| PreDragValue | NumericType | The state of InternalValue before a drag operation was started | Widgets/Input/SSpinBox.h | |
| ShiftMultiplier | TAttribute< float > | Widgets/Input/SSpinBox.h | ||
| SliderExponent | TAttribute< float > | Widgets/Input/SSpinBox.h | ||
| SliderExponentNeutralValue | TAttribute< NumericType > | Widgets/Input/SSpinBox.h | ||
| SmallStepSize | const double | Step size to use when range is below SmallStepSizeMax. | Widgets/Input/SSpinBox.h | |
| SmallStepSizeMax | const double | Largest numerical value to use the SmallStepSize instead of StepSize. | Widgets/Input/SSpinBox.h | |
| StepSize | const double | Gets the default amount to change the slider when delta is not applicable. | Widgets/Input/SSpinBox.h | |
| Style | const FSpinBoxStyle * | Widgets/Input/SSpinBox.h | ||
| SupportDynamicSliderMaxValue | TAttribute< bool > | Widgets/Input/SSpinBox.h | ||
| SupportDynamicSliderMinValue | TAttribute< bool > | Widgets/Input/SSpinBox.h | ||
| TextBlock | TSharedPtr< STextBlock > | Widgets/Input/SSpinBox.h | ||
| ValueAttribute | TAttribute< NumericType > | Widgets/Input/SSpinBox.h | ||
| WheelStep | TAttribute< TOptional< NumericType > > | Widgets/Input/SSpinBox.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ApplySliderMaxValueChanged
(
float SliderDeltaToAdd, |
Widgets/Input/SSpinBox.h | ||
void ApplySliderMinValueChanged
(
float SliderDeltaToAdd, |
Widgets/Input/SSpinBox.h | ||
const bool CommitWithMultiplier
(
const FPointerEvent& MouseEvent |
Widgets/Input/SSpinBox.h | ||
void Construct
(
const FArguments& InArgs |
Construct the widget | Widgets/Input/SSpinBox.h | |
bool GetAlwaysUsesDeltaSnap() |
See the AlwaysUsesDeltaSnap attribute | Widgets/Input/SSpinBox.h | |
NumericType GetDelta() |
See the Delta attribute | Widgets/Input/SSpinBox.h | |
bool GetEnableSlider() |
See the EnableSlider attribute | Widgets/Input/SSpinBox.h | |
int32 GetMaxFractionalDigits() |
See the MaxFractionalDigits attribute | Widgets/Input/SSpinBox.h | |
NumericType GetMaxSliderValue() |
Widgets/Input/SSpinBox.h | ||
NumericType GetMaxValue() |
See the MaxValue attribute | Widgets/Input/SSpinBox.h | |
float GetMinDesiredWidth() |
See the MinDesiredWidth attribute | Widgets/Input/SSpinBox.h | |
int32 GetMinFractionalDigits() |
See the MinFractionalDigits attribute | Widgets/Input/SSpinBox.h | |
NumericType GetMinSliderValue() |
Widgets/Input/SSpinBox.h | ||
NumericType GetMinValue() |
See the MinValue attribute | Widgets/Input/SSpinBox.h | |
float GetSliderExponent() |
See the SliderExponent attribute | Widgets/Input/SSpinBox.h | |
NumericType GetValue() |
See the Value attribute | Widgets/Input/SSpinBox.h | |
TAttribute< NumericType > GetValueAttribute() |
Return the Value attribute | Widgets/Input/SSpinBox.h | |
const FSpinBoxStyle * GetWidgetStyle() |
Widgets/Input/SSpinBox.h | ||
void InvalidateStyle() |
Widgets/Input/SSpinBox.h | ||
bool IsMaxSliderValueBound() |
See the MaxSliderValue attribute | Widgets/Input/SSpinBox.h | |
bool IsMinSliderValueBound() |
See the MinSliderValue attribute | Widgets/Input/SSpinBox.h | |
void ResetCachedValueString () |
Reset the cached string. | Widgets/Input/SSpinBox.h | |
void SetAlwaysUsesDeltaSnap
(
bool bNewValue |
Widgets/Input/SSpinBox.h | ||
void SetDelta
(
NumericType InDelta |
Widgets/Input/SSpinBox.h | ||
void SetEnableSlider
(
bool bNewValue |
Widgets/Input/SSpinBox.h | ||
void SetMaxFractionalDigits
(
const TAttribute< TOptional< int32 > >& InMaxFractionalDigits |
Widgets/Input/SSpinBox.h | ||
void SetMaxSliderValue
(
const TAttribute< TOptional< NumericType > >& InMaxSliderValue |
Widgets/Input/SSpinBox.h | ||
void SetMaxValue
(
const TAttribute< TOptional< NumericType > >& InMaxValue |
Widgets/Input/SSpinBox.h | ||
void SetMinDesiredWidth
(
const TAttribute< float >& InMinDesiredWidth |
Widgets/Input/SSpinBox.h | ||
void SetMinFractionalDigits
(
const TAttribute< TOptional< int32 > >& InMinFractionalDigits |
Widgets/Input/SSpinBox.h | ||
void SetMinSliderValue
(
const TAttribute< TOptional< NumericType > >& InMinSliderValue |
Widgets/Input/SSpinBox.h | ||
void SetMinValue
(
const TAttribute< TOptional< NumericType > >& InMinValue |
Widgets/Input/SSpinBox.h | ||
void SetSliderExponent
(
const TAttribute< float >& InSliderExponent |
Widgets/Input/SSpinBox.h | ||
void SetTextBlockFont
(
FSlateFontInfo InFont |
Widgets/Input/SSpinBox.h | ||
void SetTextClearKeyboardFocusOnCommit
(
bool bNewValue |
Widgets/Input/SSpinBox.h | ||
void SetTextJustification
(
ETextJustify::Type InJustification |
Widgets/Input/SSpinBox.h | ||
void SetTextRevertTextOnEscape
(
bool bNewValue |
Widgets/Input/SSpinBox.h | ||
void SetTextSelectAllTextOnCommit
(
bool bNewValue |
Widgets/Input/SSpinBox.h | ||
void SetValue
(
const TAttribute< NumericType >& InValueAttribute, |
Widgets/Input/SSpinBox.h | ||
void SetWidgetStyle
(
const FSpinBoxStyle* InStyle |
Widgets/Input/SSpinBox.h |
Overridden from SWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool HasKeyboardFocus() |
Widgets/Input/SSpinBox.h | ||
virtual FCursorReply OnCursorQuery
(
const FGeometry& MyGeometry, |
Widgets/Input/SSpinBox.h | ||
virtual FReply OnFocusReceived
(
const FGeometry& MyGeometry, |
Widgets/Input/SSpinBox.h | ||
| Widgets/Input/SSpinBox.h | |||
virtual FReply OnMouseButtonDown
(
const FGeometry& MyGeometry, |
The system calls this method to notify the widget that a mouse button was pressed within it. | Widgets/Input/SSpinBox.h | |
virtual FReply OnMouseButtonUp
(
const FGeometry& MyGeometry, |
The system calls this method to notify the widget that a mouse button was release within it. | Widgets/Input/SSpinBox.h | |
virtual FReply OnMouseMove
(
const FGeometry& MyGeometry, |
The system calls this method to notify the widget that a mouse moved within it. | Widgets/Input/SSpinBox.h | |
virtual FReply OnMouseWheel
(
const FGeometry& MyGeometry, |
Called when the mouse wheel is spun. This event is bubbled. | Widgets/Input/SSpinBox.h | |
virtual int32 OnPaint
(
const FPaintArgs& Args, |
Widgets/Input/SSpinBox.h | ||
virtual bool SupportsKeyboardFocus() |
Widgets/Input/SSpinBox.h | ||
virtual void Tick
(
const FGeometry& AlottedGeometry, |
Widgets/Input/SSpinBox.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void CommitValue
(
NumericType NewValue, |
Call this method when the user's interaction has changed the value | Widgets/Input/SSpinBox.h | |
void EnterTextMode() |
Make the spinbox switch to keyboard-based input mode. | Widgets/Input/SSpinBox.h | |
void ExitTextMode() |
Make the spinbox switch to mouse-based input mode. | Widgets/Input/SSpinBox.h | |
FText GetDisplayValue() |
Widgets/Input/SSpinBox.h | ||
FString GetValueAsString() |
Widgets/Input/SSpinBox.h | ||
FText GetValueAsText() |
Widgets/Input/SSpinBox.h | ||
bool IsInTextMode() |
Widgets/Input/SSpinBox.h | ||
void NotifyValueCommitted
(
NumericType CurrentValue |
Widgets/Input/SSpinBox.h | ||
void TextField_OnTextChanged
(
const FText& NewText |
Invoked when the text in the text field changes | Widgets/Input/SSpinBox.h | |
void TextField_OnTextCommitted
(
const FText& NewText, |
Invoked when the text field commits its text. | Widgets/Input/SSpinBox.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static float Fraction
(
double InValue, |
Calculates range fraction. Possible to use on full numeric range | Widgets/Input/SSpinBox.h |