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:
parent
46a596fc7d
commit
c72cf7ed64
2 changed files with 15 additions and 0 deletions
|
|
@ -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() {}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue