1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added Slider method to modify the number of decimal places that are displayed in a slider's text box

This commit is contained in:
hogliux 2018-02-12 09:21:08 +00:00
parent 46a596fc7d
commit c72cf7ed64
2 changed files with 15 additions and 0 deletions

View file

@ -1615,6 +1615,12 @@ double Slider::snapValue (double attemptedValue, DragMode)
int Slider::getNumDecimalPlacesToDisplay() const noexcept { return pimpl->numDecimalPlaces; }
void Slider::setNumDecimalPlacesToDisplay (int decimalPlacesToDisplay)
{
pimpl->numDecimalPlaces = decimalPlacesToDisplay;
updateText();
}
//==============================================================================
int Slider::getThumbBeingDragged() const noexcept { return pimpl->sliderBeingDragged; }
void Slider::startedDragging() {}

View file

@ -746,9 +746,18 @@ public:
slider's value.
It calculates the fewest decimal places needed to represent numbers with
the slider's interval setting.
@see setNumDecimalPlacesToDisplay
*/
int getNumDecimalPlacesToDisplay() const noexcept;
/** Modifies the best number of decimal places to use when displaying this
slider's value.
@see getNumDecimalPlacesToDisplay
*/
void setNumDecimalPlacesToDisplay (int decimalPlacesToDisplay);
//==============================================================================
/** Allows a user-defined mapping of distance along the slider to its value.