Table of Contents

Class SliderBox

Namespace
RichHudFramework.UI
Assembly
RichHudClient.dll

A horizontal slider control designed to mimic the appearance of the standard sliders found in the Space Engineers terminal.

public class SliderBox : HudElementBase, IReadOnlyHudElement, IReadOnlyHudNode, IReadOnlyHudParent, IClickableElement, IFocusableElement, IValueControl<float>, IValueControl
Inheritance
SliderBox
Implements
Inherited Members

Examples

new SliderBox(parent)
{
    Min = 0f, Max = 1f, Value = 0.5f,
    MouseInput = 
    {
        ToolTip = $"This {nameof(SliderBox)} sets its own background opacity."
    },
    UpdateValueCallback = (obj, args) =>
    {
        var slider = (SliderBox)obj;
        slider.BackgroundColor = slider.BackgroundColor.SetAlphaPct(slider.Percent);
    }
};

Constructors

SliderBox()

public SliderBox()

SliderBox(HudParentBase)

public SliderBox(HudParentBase parent)

Parameters

parent HudParentBase

Properties

BackgroundColor

The color of the background container box.

public Color BackgroundColor { get; set; }

Property Value

Color

BackgroundFocusColor

The color of the background container box when the control has input focus.

public Color BackgroundFocusColor { get; set; }

Property Value

Color

BackgroundHighlight

The color of the background container box when moused over.

public Color BackgroundHighlight { get; set; }

Property Value

Color

BarColor

The color of the slider track (the background bar).

public Color BarColor { get; set; }

Property Value

Color

BarFocusColor

The color of the slider track when the control has input focus.

public Color BarFocusColor { get; set; }

Property Value

Color

BarHighlight

The color of the slider track when moused over.

public Color BarHighlight { get; set; }

Property Value

Color

BorderColor

The color of the border surrounding the background box.

public Color BorderColor { get; set; }

Property Value

Color

FocusHandler

Interface used to manage the element's input focus state.

public IFocusHandler FocusHandler { get; }

Property Value

IFocusHandler

HighlightEnabled

If true, the slider box will change visual appearance when moused over.

public bool HighlightEnabled { get; set; }

Property Value

bool

IsMousedOver

Indicates whether the cursor is currently over this element.

public override bool IsMousedOver { get; }

Property Value

bool

Max

The maximum allowable value for the slider.

public float Max { get; set; }

Property Value

float

Min

The minimum allowable value for the slider.

public float Min { get; set; }

Property Value

float

MouseInput

Mouse input interface for this clickable element.

public IMouseInput MouseInput { get; }

Property Value

IMouseInput

Percent

The current value expressed as a normalized percentage (0.0 to 1.0) of the range between Min and Max.

public float Percent { get; set; }

Property Value

float

SliderColor

The color of the slider thumb (the movable button) when not moused over.

public Color SliderColor { get; set; }

Property Value

Color

SliderFocusColor

The color of the slider thumb (the movable button) when the control has input focus.

public Color SliderFocusColor { get; set; }

Property Value

Color

SliderHighlight

The color of the slider thumb (the movable button) when moused over.

public Color SliderHighlight { get; set; }

Property Value

Color

UpdateValueCallback

Helper property for registering a value update callback during initialization.

public EventHandler UpdateValueCallback { set; }

Property Value

EventHandler

UseFocusFormatting

If true, the slider box will change visual appearance when it has input focus.

public bool UseFocusFormatting { get; set; }

Property Value

bool

Value

The current value of the slider, clamped between Min and Max.

public float Value { get; set; }

Property Value

float

Events

ValueChanged

Invoked when the current value of the slider changes.

public event EventHandler ValueChanged

Event Type

EventHandler