Hello, I’m now trying to change the way of painting these buttons:
I cant find information about customization of the Increment / Decrement buttons of the “Slider::IncDecButton” Class.
Does anyone did this before?
I also can’t understand why the name of the parameter dont show, as on the other two buttons. This is the chunk of code. Thank you very much in advance!
constructor: // compDegree is the name of the button
addAndMakeVisible(compDegree);
compDegree.setSliderStyle(Slider::IncDecButtons);
Range<double>* r = new Range<double>(0.0, 5.0);
double newInterval = 1.0;
compDegree.setRange(*r, newInterval);
compDegree.setEnabled(true);
compDegreeAttachment.reset(new SliderAttachment(parameters, "compDegree", compDegree));
compDegree.setTextValueSuffix("Compression Level");
paint function:
void SimpleCompressorAudioProcessorEditor::paint(Graphics& g)
{
auto bounds = getLocalBounds();
g.fillAll(getLookAndFeel().findColour(ResizableWindow::backgroundColourId));
g.setColour(Colours::yellowgreen);
g.setFont(15.0f);
g.drawFittedText("title of the aplication not in the image", bounds.removeFromTop(50), Justification::centred, 1);
auto labelRow = bounds.removeFromBottom(12);
g.setFont(10.0f);
g.drawFittedText("Threshold", labelRow.removeFromLeft(60), 12, Justification::centred, 1);
labelRow.removeFromLeft(8);
g.drawFittedText("Knee", labelRow.removeFromLeft(60), 12, Justification::centred, 1);
labelRow.removeFromLeft(8);
g.drawFittedText("Attack", labelRow.removeFromLeft(60), 12, Justification::centred, 1);
labelRow.removeFromLeft(8);
g.drawFittedText("Release", labelRow.removeFromLeft(60), 12, Justification::centred, 1);
labelRow.removeFromLeft(8);
g.drawFittedText("Ratio", labelRow.removeFromLeft(60), 12, Justification::centred, 1);
labelRow.removeFromLeft(8);
g.drawFittedText("MakeUp", labelRow.removeFromLeft(60), 12, Justification::centred, 1);
}