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
parentHudParentBase
Properties
BackgroundColor
The color of the background container box.
public Color BackgroundColor { get; set; }
Property Value
BackgroundFocusColor
The color of the background container box when the control has input focus.
public Color BackgroundFocusColor { get; set; }
Property Value
BackgroundHighlight
The color of the background container box when moused over.
public Color BackgroundHighlight { get; set; }
Property Value
BarColor
The color of the slider track (the background bar).
public Color BarColor { get; set; }
Property Value
BarFocusColor
The color of the slider track when the control has input focus.
public Color BarFocusColor { get; set; }
Property Value
BarHighlight
The color of the slider track when moused over.
public Color BarHighlight { get; set; }
Property Value
BorderColor
The color of the border surrounding the background box.
public Color BorderColor { get; set; }
Property Value
FocusHandler
Interface used to manage the element's input focus state.
public IFocusHandler FocusHandler { get; }
Property Value
HighlightEnabled
If true, the slider box will change visual appearance when moused over.
public bool HighlightEnabled { get; set; }
Property Value
IsMousedOver
Indicates whether the cursor is currently over this element.
public override bool IsMousedOver { get; }
Property Value
Max
The maximum allowable value for the slider.
public float Max { get; set; }
Property Value
Min
The minimum allowable value for the slider.
public float Min { get; set; }
Property Value
MouseInput
Mouse input interface for this clickable element.
public IMouseInput MouseInput { get; }
Property Value
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
SliderColor
The color of the slider thumb (the movable button) when not moused over.
public Color SliderColor { get; set; }
Property Value
SliderFocusColor
The color of the slider thumb (the movable button) when the control has input focus.
public Color SliderFocusColor { get; set; }
Property Value
SliderHighlight
The color of the slider thumb (the movable button) when moused over.
public Color SliderHighlight { get; set; }
Property Value
UpdateValueCallback
Helper property for registering a value update callback during initialization.
public EventHandler UpdateValueCallback { set; }
Property Value
UseFocusFormatting
If true, the slider box will change visual appearance when it has input focus.
public bool UseFocusFormatting { get; set; }
Property Value
Value
public float Value { get; set; }
Property Value
Events
ValueChanged
Invoked when the current value of the slider changes.
public event EventHandler ValueChanged