SSlider

A Slate slider control is a linear scale and draggable handle.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Slate

Header

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

Include

#include "Widgets/Input/SSlider.h"

Syntax

class SSlider : public SLeafWidget

Remarks

A Slate slider control is a linear scale and draggable handle.

Variables

Name Description

Protected variable

bool

 

bControllerInputCaptured

Holds a flag indicating whether a controller/keyboard is manipulating the slider's value.

Protected variable

bool

 

bIsFocusable

When true, this slider will be keyboard focusable. Defaults to false.

Protected variable

bool

 

bMouseUsesStep

Sets new value if mouse position is greater/less than half the step size.

Protected variable

bool

 

bRequiresControllerLock

Sets whether we have to lock input to change the slider value.

Protected variable

EMouseCursor::T...

 

CachedCursor

Holds the initial cursor in case a custom cursor has been specified, so we can restore it after dragging the slider.

Protected variable

TAttribute< boo...

 

IndentHandle

Holds a flag indicating whether the slideable area should be indented to fit the handle.

Protected variable

TAttribute< boo...

 

LockedAttribute

Holds a flag indicating whether the slider is locked.

Protected variable

float

 

MaxValue

Protected variable

float

 

MinValue

Protected variable

EOrientation

 

Orientation

Holds the slider's orientation.

Protected variable

FVector2D

 

PressedScreenSpaceTouchDownPosition

The location in screenspace the slider was pressed by a touch

Protected variable

TAttribute< FSl...

 

SliderBarColor

Holds the color of the slider bar.

Protected variable

TAttribute< FSl...

 

SliderHandleColor

Holds the color of the slider handle.

Protected variable

TAttribute< flo...

 

StepSize

Holds the amount to adjust the value by when using a controller or keyboard

Protected variable

const FSliderSt...

 

Style

Holds the style passed to the widget upon construction.

Protected variable

TAttribute< flo...

 

ValueAttribute

Holds the slider's current value.

Constructors

Name Description

Public function

SSlider()

Functions

Name Description

Protected function Virtual

void

 

CommitValue

(
    float NewValue
)

Commits the specified slider value.

Public function

void

 

Construct

(
    const SSlider::FArguments& InDecla...
)

Construct the widget.

Protected function Const

const FSlate...

 

GetBarImage()

Public function Const

float

 

GetMaxValue()

Get the MaxValue attribute

Public function Const

float

 

GetMinValue()

Get the MinValue attribute

Public function Const

float

 

GetNormalizedValue()

Get the Value attribute scaled from 0 to 1

Public function Const

float

 

GetStepSize()

Get the StepSize attribute

Protected function Const

const FSlate...

 

GetThumbImage()

Public function Const

float

 

GetValue()

Get the Value attribute

Public function Const

bool

 

IsLocked()

Protected function

float

 

PositionToValue

(
    const FGeometry& MyGeometry,
    const FVector2D& AbsolutePosition
)

Calculates the new value based on the given absolute coordinates.

Public function

void

 

SetIndentHandle

(
    const TAttribute< bool >& InIndent...
)

Set the IndentHandle attribute

Public function

void

 

SetLocked

(
    const TAttribute< bool >& InLocked
)

Set the Locked attribute

Public function

void

 

SetMinAndMaxValues

(
    float InMinValue,
    float InMaxValue
)

Set the MinValue and MaxValue attributes.

Public function

void

 

SetMouseUsesStep

(
    bool MouseUsesStep
)

Set the MouseUsesStep attribute

Public function

void

 

SetOrientation

(
    EOrientation InOrientation
)

Set the Orientation attribute

Public function

void

 

SetRequiresControllerLock

(
    bool RequiresControllerLock
)

Set the RequiresControllerLock attribute

Public function

void

 

SetSliderBarColor

(
    FSlateColor InSliderBarColor
)

Set the SliderBarColor attribute

Public function

void

 

SetSliderHandleColor

(
    FSlateColor InSliderHandleColor
)

Set the SliderHandleColor attribute

Public function

void

 

SetStepSize

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

Set the StepSize attribute

Public function

void

 

SetValue

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

Set the Value attribute

Overridden from SWidget

Name Description

Public function Virtual Const

FVector2D

 

ComputeDesiredSize

(
    float
)

Overwritten from SWidget.

Public function Virtual

TSharedRef< ...

 

CreateAccessibleWidget()

Public function Virtual Const

bool

 

IsInteractable()

Public function Virtual

void

 

OnFocusLost

(
    const FFocusEvent& InFocusEvent
)

Called when this widget loses focus. 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

 

OnKeyUp

(
    const FGeometry& MyGeometry,
    const FKeyEvent& InKeyEvent
)

Called after a key is released when this widget has focus

Public function Virtual

FReply

 

OnMouseButtonDown

(
    const FGeometry& MyGeometry,
    const FPointerEvent& MouseEvent
)

MOUSE INPUT 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

void

 

OnMouseCaptureLost

(
    const FCaptureLostEvent& CaptureLo...
)

Called when this widget had captured the mouse, but that capture has been revoked for some reason.

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

FNavigationR...

 

OnNavigation

(
    const FGeometry& MyGeometry,
    const FNavigationEvent& InNavigati...
)

Called when navigation is requested e.g. Left Joystick, Direction Pad, Arrow Keys can generate navigation events.

Public function Virtual Const

int32

 

OnPaint

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

Overwritten from SWidget.

Public function Virtual

FReply

 

OnTouchEnded

(
    const FGeometry& MyGeometry,
    const FPointerEvent& InTouchEvent
)

Called when a touchpad touch is ended (finger lifted)

Public function Virtual

FReply

 

OnTouchMoved

(
    const FGeometry& MyGeometry,
    const FPointerEvent& InTouchEvent
)

Called when a touchpad touch is moved (finger moved)

Public function Virtual

FReply

 

OnTouchStarted

(
    const FGeometry& MyGeometry,
    const FPointerEvent& InTouchEvent
)

Called when a touchpad touch is started (finger down)

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

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