I have a little app with 3 sub components and i'm trying to figure out the best way to be able to toggle between a single all-inclusive view and 3 separate windows for each sub component, so they can be positioned on the screen independently. I'm using a MenuBarModel to house the toggle. My question is where should I put the menuBar model code? in the DocumentWindow (main.cpp) class? in the MainContentComponent class?
I'm trying to figure out who should control which windows are displayed, and logically, it's the documentWindow class because that's the class that creates the MainContentComponent and makes it visible.
Ideally, I want this to happen:
Run application. App defaults to single view, with the 3 sub-components arranged in the window accordingly. Menu->View-> click on "Separate Windows" Main app window closes/hides/whatever 3 small windows, each containing one of the subcomponents open, complete with DocumentWindow::allButtons Menu->View-> click on "Single Window" 3 small windows close/hide/however it would work. Main App window opens, containing the 3 subcomponents arranged accordingly.
If i do "component.setVisible(true) inside of my MainContentComponent class, it appears in it's own window exclusive of the MainContentComponent's window (the DocumentWindow). however, if I do addAndMakeVisible(component), then the component appears inside the window DocumentWindow created for MainContentComponent.
Any ideas which way to proceed?
just wanted to add that two of my subcomponents are actually subclassing DocumentWindow, which is why "setVisible()" causes them to create their own windows.