Im facing the problem that a ComboBox with a lot of content gets very difficult to use on a mobile platform, due to properties of the PopupMenu it opens. First of all, scrolling seems to be possible only with the up and down arrows, and not by swiping up and down. Second, as the arrows are placed at the very top and bottom of the screen, trying to tap them also often interferes with mobile OS functions that are triggered by swiping in from the top or bottom of the screen.
My solution to this kind of problem is to not use JUCE for anything but very simple single screen mobile UIs. Build a native UI (or use a cross platform UI framework such as React Native or Xamarin) and use JUCE for the things it’s good at - audio and custom graphics.
Thanks for the replies, @adamski and @o.petit. I agree in principle, but it’s someone else’s project I’m continuing. Porting thousands of lines of GUI Code to another library just to solve 2-3 minor issues like this is not really an option.
The most feasible solution seems to me to come up with a replacement for the ComboBox class that does what I want on mobile devices.
I know it’s ugly as hell to do this, because I’d basically have to duplicate the code of ComboBox and PopupMenu (>3000 lines of code!). A subclass of ComboBox won’t work, as I’d need to access private variables of ComboBox.
Any other ideas?
Seems like a reasonable idea. I’ve also had instances where a Juce class was not customisable enough for my needs, in which case I’ve either copy pasted/renamed the class to modify it my liking or completely restarted from scratch.
Yes it seems that’s going to be the only way to solve this issue that will work for sure. For a while I thought I found an elegant solution by creating a subclass of ComboBox and then overriding the mouse handling functions. But in the end this didn’t work out because PopupMenu has no option to show itself inside a rectangular area (the showAt method shows the menu adjacent to an area – with hard-coded offsets from the screen bounds, which are too small for mobile devices).
Well, I could still replace the whole PopupMenu by a Viewport containing buttons or so. Or would there be a way to show a PopupMenu inside a Viewport?