Sub Window Minimization


#1

I have a main window that contains some components one of which is a sub window. Is there any built in functionality so when I minimize the sub window I just see the titlebar of the sub window? That’s so I can maximize it later. Here is the class I use for the sub window.

class ObjWindow : public DocumentWindow
{
public:
//==============================================================================
ObjWindow()
: DocumentWindow (T(“Object Properties”),
Colours::lightblue,
DocumentWindow::allButtons,
true)
{
//setContentComponent (new HelloWorldContentComponent());

    setVisible (true);
    centreWithSize (400, 200);
}

~ObjWindow()
{
    // (the content component will be deleted automatically, so no need to do it here)
}

//==============================================================================
void closeButtonPressed()
{
    // When the user presses the close button, we'll tell the app to quit. This 
    // window will be deleted by the app object as it closes down.
    this->setVisible(false);
}

};

Also I can’t see how the program knows to associate the closeButtonPressed function with the x button because I’m looking for a way to change what happens when someone presses the minimize button. Thanks.


#2

No, haven’t done anything that would minimise sub-windows, sorry.

The DocumentWindow is a button listener, so it can find out when the buttons are pressed and do the appropriate thing. You can just use the minimiseButtonPressed() method to react to it.


#3