Design approaches for dynamic application panels

The goal is a GUI app with a main “form” which will be dynamic, that is there will be some “sub-forms” or “panels” which come and go based upon user input.

  1. What is the metaphor used in the Juce world for having a “panel” of widgets forming part of a UI, which could come and go? Would this just be a (compound) Component?

  2. Is there an object class or technique for having these “panels” fit together to fill the main application window, expanding or maintaining their dimensions as appropriate?


When a Component is hidden, all its children become hidden. It sounds like after you show or hide one of these panels you want your entire interface to recalculate and adjust various sizes. I suggest a componentBroadcast or componentNotifyParent.

As far as I know there is nothing especially robust for handling palettes or dynamic sizing of GUI panels except for the one class that deals with stacks of horizontal or vertical Components (the name escapes me). There are so many ways of doing this that no general purpose system would really be appropriate, you’ll have to plan out how you want your interface panels to stretch and then write some small framework for updating the bounding rectangles when the layout changes.

Thanks for those two enhancements.

I’m not sure if this is what you meant, but I just found Component::Positioner but it looks like it’s just a framework for us to fill in our own code. It also referred to a
RelativeCoordinatePositionerBase object.

I had hoped that some sort of “Panel” widget already existed.

It’s really hard to design something general purpose because there are so many different ways of handling dynamic panels in the interface. JUCE provides the raw materials and its up to you to define the behavior.

If you can describe in some more detail how you want your panels to work, perhaps with some accompanying diagrams, then we could make suggestions on how best to proceed with JUCE.

That’s certainly appreciated. I don’t have a specific UI plan in mind at this point.

I’m thinking that “less is more” for the UI “panel”, hide whatever is not
relevant or necessary. Have some sort of button to open up the details, and then to close it up. Similar to expanding and collapsing a tree node, but
with widgets on some sort of panel. I’m ultimately targeting tablet type devices with limited screen size, and forgoing usual menu structures.
Yeah, I’m just generic because to be honest, I’m at the “technology in search of a product” stage.

Having said that, it seems Component::setBoundsToFit might show some promise with the Justification element.

Not keen on tabs?

Oh, tabs. Yes, I’ve used them in a “previous life”. That might be the easiest way implement something quickly.

Thanks for that.

Oh looks like Jules updated to the latest Doxygen :slight_smile: