Handle DragEvent in a customContainer with a list buttons and a slider
Hello,
Normally when i have to handle clicks or drags on a screen I just check where the clickEvent happens and if it has happened in the scroll with buttons inside it i cancel the event if its a scroll and do list.handleClick/Drag/Gesture event and if the click was somewhere else (sliders, buttons...) i do ScreenViewBase::handleClick/Drag/Gesture event.
But now I have this situation inside a container that at least to my knowledge if do CustomContainerBase::handleClick/Drag/Gesture event it doesn't make it's buttons or sliders handle it,
So my idea was to (from the screen class) redirect all the clicks directly to ScreenViewBase and if my container was visible redirect all drag/gestures to the container,
This almost works, the button clicks and the drags of the list in the container work fine but the slider doesn't work, as it also needs the drag/gestureEvent I redirect to the list, i tried the following in my container code but the drag is done much lower than the actual click,
void Choice_List::handleDragEvent(const DragEvent &evt)
{
if (!m_slider.getAbsoluteRect().intersect(evt.getOldX(), evt.getOldY()))
{
m_can_scroll = true;
m_scroll_elements.handleDragEvent(evt);
}
if (!m_scroll_elements.getAbsoluteRect().intersect(evt.getOldX(), evt.getOldY()))
{
m_can_scroll = false;
m_slider.handleDragEvent(evt);
}
}
void Choice_List::handleGestureEvent(const GestureEvent &evt)
{
if (m_scroll_elements.getAbsoluteRect().intersect(evt.getX(), evt.getY()))
{
m_can_scroll = true;
m_scroll_elements.handleGestureEvent(evt);
}
else
{
m_can_scroll = false;
m_slider.handleGestureEvent(evt);
}
}
The result of that code works on the fact that it can drag both the list and the slider but the ball of the slider goes like 200px below the actual click, in the image below I show as i can, the red arrow is where i click to drag, and the the ball moves below it.

I know this post was poorly written but I don't know how to explain this situation.
