ComboBox really was never designed to be able to use other types of popup component, it's full of implementation details that assume it uses a PopupMenu. I've no idea what would need to be changed to make it more flexible, but I doubt if it would be as simple as just making it possible to override showPopup.
Well, with those two little modifications, I have something fully functional right now. I found easy to derive a class from ComboBox, I just have to load my popover object inside showPopup() and update ComboBox's selection at the end of the interaction. I never ask for a JUCE modification without knowing that it is actually effective :)
Hmm.. Well, I guess I could make the method virtual.
Re: setAlwaysOnTop, no it definitely shouldn't always be set to true, as that won't be what's wanted in all situations. Maybe you just need to call toFront() after showing it?
In a same way,
Can it be possible to let the struct ItemInfo and OwnedArray <ItemInfo> items protected instead of private.
This could allow showPopup() overloads to create menus with submenus for instance.
No, sorry, that's for internal use only. If I made it public and people started writing subclasses that relied on it, then I'd be unable to change the way the class works internally in the future.
I understand that the internal representation of ComboBox::ItemInfo will change if you decide to add all new features from juce::PopupMenu items (like iconToUse itemTextColour...)
Perhaps one day, adding public structure MenuItemCommandInfo like ApplicationCommandInfo shared between PopumMenu and ComboBox will help.
Having a public const accessor on OwnedArray<MenuItemCommandInfo> ComboBox::items should help clients to customize showPopup() too.
That's right. If I was going to add new functionality to do this kind of thing, then it'd need to be thought about more carefully, integrated with other classes, etc.
One thing to look out for is since you can't set the private menuActive member to true, showPopup() will be called on both mouseDown and mouseUp. In my case the effect was two identical popup menus exactly on top of each other. So it appeared the menu wasn't dismissed only on the second click.