DNumSlider
Description
The DNumSlider allows you to create a slider, allowing the user to slide it to set a value, or changing the value in the box.
Parent
Derives methods, etc not listed on this page from Panel.
Events
DNumSlider:OnValueChanged( number value )
Called when the value of the slider is changed, through code or changing the slider.
Methods
number DNumSlider:GetDecimals()
Returns the amount of numbers after the decimal point.
number DNumSlider:GetDefaultValue()
Returns the default value of the slider, if one was set by DNumSlider:SetDefaultValue
Returns the range of the slider, basically maximum value - minimum value.
Panel DNumSlider:GetTextArea()
Returns the DTextEntry component of the slider.
Returns true if either the DTextEntry, the DSlider or the DNumberScratch are being edited.
DNumSlider:ResetToDefaultValue()
Resets the slider to the default value, if one was set by DNumSlider:SetDefaultValue.
This function is called by the DNumSlider when user middle mouse clicks on the draggable knob of the slider.
Sets the console variable to be updated when the value of the slider is changed.
DNumSlider:SetDecimals( number decimals )
Sets the desired amount of numbers after the decimal point.
This doesn't affect values passed to DNumSlider:OnValueChanged. To get right values passed to DNumSlider:OnValueChanged use math. Round.
DNumSlider:SetDefaultValue( number default )
Sets the default value of the slider, to be used by DNumSlider:ResetToDefaultValue or by middle mouse clicking the draggable knob of the slider.
This is used internally - although you're able to use it you probably shouldn't.
DNumSlider:UpdateNotches()
This is used internally - although you're able to use it you probably shouldn't.
Updates visual notches on the slider.
DNumSlider:ValueChanged( number value )
This is used internally - although you're able to use it you probably shouldn't.
Called when the value has been changed. This will also be called when the user manually changes the value through the text panel.
This is an internal function. Override DNumSlider:OnValueChanged instead.
Example
Attempts to create a DNumSlider.
Output: