If your scroll wheel filling the entire screen is horizontal then it is not possible to distinguish the swipe container and the scroll wheel. However, if the scroll wheel is vertical, then you need to distinguish between horizontal drag and vertical drag as well as clicks on the scroll wheel or outside the scroll wheel.
Here is a example that shows the way I performed this distinction for a project related to a music player with a scroll list (similar behavior as the scroll wheel) and a swipe container.
void MusicPlayerView::handleClickEvent(const ClickEvent& evt)
{
if (evt.getType() == ClickEvent::PRESSED)
{
if(scrollablePlaylistContainer.getAbsoluteRect().intersect(evt.getX(), evt.getY()))
{
isPlaylistClicked = true;
}
}
else if (evt.getType() == ClickEvent::RELEASED)
{
dragType = NONE;
}
if(dragType != VERTICAL) //The swipe container should handle the event
{
musicPlayerSwipeContainer.handleClickEvent(evt);
}
MusicPlayerViewBase::handleClickEvent(evt);
}
void MusicPlayerView::handleDragEvent(const DragEvent& evt)
{
if(isPlaylistClicked)
{
isPlaylistClicked = false;
if(abs(evt.getDeltaY()) < abs(evt.getDeltaX()))
{
dragType = HORIZONTAL;
}
else
{
dragType = VERTICAL;
}
}
else
{
if(dragType == HORIZONTAL) //The swipe container should handle the event
{
musicPlayerSwipeContainer.handleDragEvent(evt);
}
else //The scroll container or the view should handle the event
{
MusicPlayerViewBase::handleDragEvent(evt);
}
}
}
void MusicPlayerView::handleGestureEvent(const GestureEvent& evt)
{
if(dragType == HORIZONTAL) //The swipe container should handle the event
{
musicPlayerSwipeContainer.handleGestureEvent(evt);
}
else //The scroll container or the view should handle the event
{
MusicPlayerViewBase::handleGestureEvent(evt);
}
}
/Alexandre