Hi,
i’ve been stuck for days now trying to do a drawable graph out of customized sliders.
i created a custom component (parent) which consists of an array of LinearBarVertical sliders. They have been programmatically placed and styled using my own LookAndFeel and my own paint function.
However since i want to draw e.g. a waveform using this component,
i don’t want to use the standard mousebehaviour on sliders,
because this prevents “drawing” from left to right.
so i tried overriding the parent components hitTest to set the slidersVlaues depending on the mouseposition and if isMouseButtonDownAnywhere but i can’t get it to work.
can somebody please give me a hint and point me in the reight direction? that would be nice!
int totalNumberOfSliders =100;
int sliderX = 10;
int sliderY = 0;
int sliderWidth =10;
int sliderHeight = 500;
bool hitTest (int x, int y) override
{
if ( isMouseButtonDownAnywhere() == true )
{
if(y >= sliderY && y < sliderWidth) // click is inside sliders y range
{
for(int i=0; i<totalNumberOfSliders; i++) // iterate through sliders
{
if(x >= (i*sliderX)-sliderX && x < (i*sliderWidth)) // click is inside sliders x range
{ sliderArray.getUnchecked (i)->setValue(, dontSendNotification);} // set clicked sliders value to y value of mouse
}
}
}
return false;
}
thank you in advance and thanks for reading
- Marcel /Dangerough