Provides Numeric slider GUI not tied to a control-handle.

Properties

Bounds

#
[Category("Layout")] public override Rectangle Bounds { get; set; }
Gets or sets the bounds of the slider.

ControlBackColour

#
[Category("Colours")] public Color ControlBackColour { get; set; }
Gets or sets the BackColour for this slider control.

ControlEdgeColour

#
[Category("Colours")] public Color ControlEdgeColour { get; set; }
Gets or sets the EdgeColor for this slider control.

ControlShadowColour

#
[Category("Colours")] public Color ControlShadowColour { get; set; }
Gets or sets the Shadow colour for this control.

DecimalPlaces

#
public int DecimalPlaces { get; set; }
Gets or sets the number of decimal places allowed for floating point type sliders. Valid values between zero and 12.

DrawControlBackground

#
public bool DrawControlBackground { get; set; }
Gets or sets whether the background of the slider should be drawn.

DrawControlBorder

#
public bool DrawControlBorder { get; set; }
Gets or sets whether the border of the slider should be drawn.

DrawControlShadows

#
public bool DrawControlShadows { get; set; }
Gets or sets whether the drop shadows of the slider should be drawn.

Epsilon

#
[Category("Values")] public decimal Epsilon { get; }
Gets the smallest value change supported by the current slider properties.

Font

#
[Category("Display")] public override Font Font { get; set; }
Gets or sets the font for this slider.

FormatMask

#
[Category("Display")] public string FormatMask { get; set; }
Gets or sets the string format mask to use for the display. Should contain at least one "{0}" element.

Grip

#
public RectangleF Grip { get; }
Gets the box of the current grip. If the slider value/limits are not set up correctly then this rectangle may well be outside of the bounds. If the limits are coincident, this will fail (divide by zero).

GripBottomColour

#
[Category("Colours")] public Color GripBottomColour { get; set; }
Gets or sets the fill colour for the bottom edge of the slider grip.

GripDisplay

#
[Category("Display")] public GH_SliderGripDisplay GripDisplay { get; set; }
Gets or sets how the slider grip (or thumb) is drawn.

GripEdgeColour

#
[Category("Colours")] public Color GripEdgeColour { get; set; }
Gets or sets the edge colour for the slider grip.

GripText

#
[Category("Layout")] public string GripText { get; }
Gets the text that will be drawn on the slider.

GripTextPure

#
[Browsable(false)] public string GripTextPure { get; }
Gets the text format of the number of this slider value.

GripTopColour

#
[Category("Colours")] public Color GripTopColour { get; set; }
Gets or sets the fill colour for the top edge of the slider grip.

GripWidth

#
[Category("Layout")] public int GripWidth { get; }
Gets an estimate of the maximum number of pixels taken up by the grip. This property depends on many different factors, though should remain constant when other properties are not changed. If the Font hasn't been specified, the default Windows.Forms.Control font is used.

IsTextInput

public bool IsTextInput { get; }
Gets whether the text input box is currently on screen.
inherited fromGH_TextBoxInputBase

Maximum

#
[Category("Values")] public decimal Maximum { get; set; }
Gets or sets the upper limit of the slider.

Minimum

#
[Category("Values")] public decimal Minimum { get; set; }
Gets or sets the lower limit of the slider.

NormalizedValue

#
public double NormalizedValue { get; set; }
Gets or sets the normalized value within the slider domain.

Padding

#
[Category("Layout")] public Padding Padding { get; set; }
Gets or sets the padding around the slider border.

Rail

#
public Rectangle Rail { get; }
Gets the shape of the rail. The height of the rectangle will be zero, but the y-position will be rounded to integer precision.

RailBrightColour

#
public Color RailBrightColour { get; set; }
Gets or sets the bright colour used to draw rails and ticks.

RailDarkColour

#
public Color RailDarkColour { get; set; }
Gets or sets the dark colour used to draw rails and ticks.

RailDisplay

#
[Category("Display")] public GH_SliderRailDisplay RailDisplay { get; set; }
Gets or sets how the slider rail (or track) is drawn.

RailEmptyColour

#
[Category("Colours")] public Color RailEmptyColour { get; set; }
Gets or sets the fill colour for the empty portion of the rail.

RailFullColour

#
[Category("Colours")] public Color RailFullColour { get; set; }
Gets or sets the fill colour for the full portion of the rail.

RaiseEvents

#
public bool RaiseEvents { get; set; }
Gets or sets a value indicating whether this slider raises the ValueChanged event.

RenderDelegate_Background

#
[Browsable(false)] public GH_SliderBase.DrawSliderChannel RenderDelegate_Background { get; set; }
Gets or sets the delegate called after the background of the slider has been drawn.

RenderDelegate_Border

#
[Browsable(false)] public GH_SliderBase.DrawSliderChannel RenderDelegate_Border { get; set; }
Gets or sets the delegate called after the border of the slider has been drawn.

RenderDelegate_Grip

#
[Browsable(false)] public GH_SliderBase.DrawSliderChannel RenderDelegate_Grip { get; set; }
Gets or sets the delegate called after the grip of the slider has been drawn.

RenderDelegate_Rail

#
[Browsable(false)] public GH_SliderBase.DrawSliderChannel RenderDelegate_Rail { get; set; }
Gets or sets the delegate called after the rail of the slider has been drawn.

RenderDelegate_Ticks

#
[Browsable(false)] public GH_SliderBase.DrawSliderChannel RenderDelegate_Ticks { get; set; }
Gets or sets the delegate called after the ticks of the slider have been drawn.

ShadowSize

#
[Category("Display")] public Padding ShadowSize { get; set; }
Gets or sets the size of the border shadow along all edges of the box.

SnapDistance

#
public decimal SnapDistance { get; set; }
Gets or sets the snap distance in absolute values.

TextColour

#
[Category("Colours")] public Color TextColour { get; set; }
Gets or sets the fill colour for the slider text.

TextInputHandlerDelegate

#
public GH_SliderBase.TextInputHandler TextInputHandlerDelegate { get; set; }
Gets or sets the custom handler for text input. If you do not set a custom handler the default behaviour will be used.

TickCount

#
[Category("Display")] public int TickCount { get; set; }
Gets or sets the number of ticks displayed.

TickDisplay

#
[Category("Display")] public GH_SliderTickDisplay TickDisplay { get; set; }
Gets or sets how the slider ticks are drawn.

TickFrequency

#
[Category("Display")] public int TickFrequency { get; set; }
Gets or sets the frequency of large ticks vs small ticks.

Ticks

#
public List<int> Ticks { get; }
Gets a list of all the tick offset x positions.

Type

#
public GH_SliderAccuracy Type { get; set; }
Gets or sets the accuracy type of the slider.

Value

#
[Category("Values")] public decimal Value { get; set; }
Gets or sets the value of the slider.

ValueF

#
[Category("Values")] public float ValueF { get; set; }
Gets or sets the value of the slider in single precision.

Methods

FixDomain

#
public void FixDomain()
Fix the limits of the slider. Limits will be rounded according to slider type and accuracy. Also, a minimum range for all types is ensured.

FixValue

#
public void FixValue()
Fix the value of the slider. The value will be rounded according to slider type and accuracy. Also, the value will be clipped to the limits. Before you call this function, ensure the limits are set up correctly.

HandleTextInputAccepted

#
protected override void HandleTextInputAccepted(string text)

HideTextInputBox

public void HideTextInputBox()
Hides the text-input override form (if it is displayed).
inherited fromGH_TextBoxInputBase

KeyDown

#
public bool KeyDown(KeyEventArgs args)
Respond to a KeyDown event.
args (KeyEventArgs)KeyDown event arguments.
True if something changed, false if not.

MouseDown

#
public bool MouseDown(MouseEventArgs args, PointF pt)
Respond to mouse-down events.
args (MouseEventArgs)Mouse Event arguments.
pt (PointF)Mouse cursor position in floating point accuracy.
True if a Drag operation was started, false if the event went unnoticed.

MouseMove

#
public bool MouseMove(MouseEventArgs args, PointF pt)
Respond to mouse-move events.
args (MouseEventArgs)Mouse Event arguments.
pt (PointF)Mouse cursor position in floating point accuracy.
True if a Drag operation was performed, false if the event went unnoticed.

MouseUp

#
public bool MouseUp(MouseEventArgs args, PointF pt)
Respond to mouse-up events.
args (MouseEventArgs)Mouse Event arguments.
pt (PointF)Mouse cursor position in floating point accuracy.
True if a Drag operation was terminated, false if the event went unnoticed.

OnValueChanged

#
public void OnValueChanged(bool intermediate)
Raise the ValueChanged event.
intermediate (bool)Set the intermediate state of the event arguments.

ProcessNumber

#
public static decimal ProcessNumber(decimal val, GH_SliderAccuracy accuracy, int digits)
Process a number using the given slider characteristics.
val (decimal)Number to process.
accuracy (GH_SliderAccuracy)Slider rounding accuracy.
digits (int)Number of digits to use for floating point rounding.
Processed number.

Render

#
public void Render(Graphics G)
Render this slider into a Graphics context.
G (Graphics)Graphics to render with.

SetSnapRanges

#
public void SetSnapRanges(IEnumerable<SliderSnapRange> ranges)
Assign a collection of snap ranges to this slider.
ranges (IEnumerable<SliderSnapRange>)Ranges to snap to. Will override whatever snap ranges were defined before.

ShowTextInputBox

#
public void ShowTextInputBox(Control owner, bool limitToBoundary, Matrix transform, string content)
owner (Control)
limitToBoundary (bool)
transform (Matrix)
content (string)

ShowTextInputBox

#
public void ShowTextInputBox(Control owner, bool limitToBoundary, Matrix transform)
owner (Control)
limitToBoundary (bool)
transform (Matrix)

ShowTextInputBox

#
public void ShowTextInputBox(Control owner, bool limitToBoundary)
owner (Control)
limitToBoundary (bool)

ShowTextInputBox

public void ShowTextInputBox(Control owner, string content, bool selectContent, bool limitToBoundary, Matrix transform)
Display a floating text-box on top of the owner control.
inherited fromGH_TextBoxInputBase
owner (Control)Control that owns this slider. The coordinates of the Bounds rectangle must be specified in owner coordinates.
content (string)
selectContent (bool)
limitToBoundary (bool)If True, the pop up input box will be 'clipped' to the owner boundary. At least some part of the slider must be visible for this to work.
transform (Matrix)Transformation matrix to apply to pop up UI.

ShowTextInputBox

public void ShowTextInputBox(Control owner, string content, bool selectContent, bool limitToBoundary)
Display a floating text-box on top of the owner control.
inherited fromGH_TextBoxInputBase
owner (Control)Control that owns this slider. The coordinates of the Bounds rectangle must be specified in owner coordinates.
content (string)
selectContent (bool)
limitToBoundary (bool)If True, the pop up input box will be 'clipped' to the owner boundary. At least some part of the slider must be visible for this to work.

ShowTextInputBox

public void ShowTextInputBox(Control owner, string content, bool selectContent)
Display a floating text-box on top of the owner control.
inherited fromGH_TextBoxInputBase
owner (Control)Control that owns this slider. The coordinates of the Bounds rectangle must be specified in owner coordinates.
content (string)
selectContent (bool)

ShowTextInputBox

#
public void ShowTextInputBox(Control owner)
owner (Control)

Events

ValueChanged

#
public event GH_SliderBase.ValueChangedEventHandler ValueChanged
Raised whenever the value of this slider is changed due to User-Interface methods.