IncDec Slider buttons don't work with NormalisableRange

If I call setRange() on a IncDec Slider, the buttons will work as expected.

However, if I set the range of an IncDec Slider using setNormalisableRange(), the buttons don’t work.

As a test, I used the same NormalisableRange on a rotary slider and everything worked as expected. When I applied the very same range to the IncDec slider, the buttons did not trigger any changes.

Is this a bug, feature, or did I miss something in the documentation?

I just got it to work.

Bear with me on the explanation. My situation was that I have two sliders.

A rotary slider and an IncDec Slider. The GUI requirements are that

  1. We have an IncDec slider that displays values
  2. A Rotary Slider that does not display values.

They both refer to the same information. It’s just that we want to give the user two methods of adjusting the values (using a knob, or using an incDec button)

[Credit: to @daniel for the code provided Custom Label ]

void updateFrequency()
{


//---------------------------------------------------------------------
NormalisableRange<double> newRange(
    MIN,
    MAX,
    // maps real value to 0..1
    nullptr,
    // maps 0..1 values to real world
    nullptr,
    // maps real world to legal real world
    [](auto rangeStart, auto rangeEnd, auto valueToRemap)
{
    if (valueToRemap <= SomeVal)
    {
        return juce::jlimit(rangeStart, rangeEnd, SomeVal);
    }
    else if (valueToRemap > SomeVal && valueToRemap <= BiggerVal)
    {
        return jlimit(rangeStart, rangeEnd, BiggerVal);
    }
    else
    {
        return jlimit(rangeStart, rangeEnd, MAX);
    }

});


rotarySlider.setNormalisableRange(newRange); // Slider with no Textbox
incDecSlider.setNormalisableRange(newRange); // Slider with a visible Textbox

incDecSlider.setRange(MIN, MAX, 0.00000001); // I arbitrarily chose the step value.  

incDecSlider.getValueObject().referTo(rotarySlider.getValueObject());

}