We're developing a cross-platform smartphone app with a dozen or so screens/pages. I've implemented 2-finger pinching in our custom widgets (audio oscilloscopes and spectrograms, all based on CSL widgets), but I'd also like to allow the user to swipe horizontally to change pages and to scroll vertically within pages that are taller than the screen.
Many of our pages contain multiple other widgets (text panes, buttons, tree views, viewports, etc.).
I use mouse drag velocity computation to detect swipes within our custom widgets, and am now wondering how to handle it within a composite component that has multiple JUCE widgets in it. JUCE buttons and treeViews, for example, handle mouse events themselves, so I can't see how to put my velocity-based logic in there to detect a swipe that begins on a button.
Is there a well-known technique or design pattern that I'm missing?
Does one interpose a transparent component on top of the whole screen to delegate events and catch swipes?
Am I missing something simple? (If yes, please be polite...)
Thanks for any responses.
Stephen in Santa Barbara