class GUISliderField

A composite GUI object representing an editor field.

Editor fields are a combination of a label and an input field. Label is optional. This specific implementation displays a horizontal slider and a floating point input box.

Public

Constructors

GUISliderField

GUISliderField(const PrivatelyConstruct &dummy, const GUIContent &labelContent, u32 labelWidth, const String &style, const GUISizeConstraints &dimensions, bool withLabel)

Methods

staticGetGuiTypeName

static const String &GetGuiTypeName()

Returns type name of the GUI element used for finding GUI element styles.

SetValue

void SetValue(float value)

Value currently assigned to the field/slider.

Returns the clamped value according to range and step.

GetValue

float GetValue() const

SetStep

void SetStep(float step)

Defines the minimal increment the value can be increased/decreased by.

Set to zero to have no step.

GetStep

float GetStep() const

SetRange

void SetRange(float min, float max)

Sets a minimum and maximum allow values in the input field.

Set to large negative/positive values if you don't require clamping.

HasInputFocus

bool HasInputFocus() const

Checks is the input field currently active.

SetTint

void SetTint(const Color &color) override

Sets the tint of the GUI element.

staticCreate

static T *Create(const GUIContent &labelContent, u32 labelWidth, const String &styleClass = StringUtility::kBlank)

Creates a new GUI editor field with a label.

labelContent
Content to display in the editor field label.
labelWidth
Width of the label in pixels.
styleClass
Style class that will be used for determining GUI element visuals from the current style sheet. If no class is provided, default style is determined based on GUI element type.

Fields

OnValueChanged

Event<void (float)> OnValueChanged

Triggers when the field value changes.

Internal

Methods

SetValueInternal

void SetValueInternal(float value, bool triggerEvent)

Sets a new value in the input field, and also allows you to choose should the field trigger an onValueChanged event.

Protected

Methods

~GUISliderField

virtual ~GUISliderField() noexcept = default

InputBoxValueChanged

void InputBoxValueChanged(bool confirmed = true)

Triggered when the input box value changes definitively.

InputBoxValueChanging

void InputBoxValueChanging(const String &newValue)

Triggered when the input box value is changing.

SliderChanged

void SliderChanged(float newValue)

Triggered when the slider is moved.

DoOnInputBoxFocusGained

void DoOnInputBoxFocusGained()

Triggers when the input box receives keyboard focus.

DoOnInputBoxFocusLost

void DoOnInputBoxFocusLost()

Triggers when the input box loses keyboard focus.

staticFloatFilter

static bool FloatFilter(const String &str)

Callback that checks can the provided string be converted to a floating point value.

Fields

mInputBox

GUIInputBox * mInputBox

mSlider

mHasInputFocus

bool mHasInputFocus