Custom DocumentWindow Title Bar


#1

I want to use a custom title bar for Document Windows. ( A Close button on the left, an extra button on the right, total of 5 buttons… etc.) I don’t want change any JUCE library code. What is the preferred way to do?


#2

I also want to use MultiDocumentPanel and it wraps the document with a Document Window, so subclassing Document Window does not work.


#3

You could use a custom look and feel - check out the LookAndFeel class. It’ll let you do all that sort of thing.


#4

LookAndFeel::positionDocumentWindowButtons is limited to 3 buttons only, I would prefer to have a special TitleBar component to do all the dirty work. Maybe disabling the Title bar and using a custom component would be better. But MultiDocumentPanel wraps all document in a private DocumentWindow class. So I can’t use MultiDocumentPanel with this approach.


#5

If it’s something so specific, then you could always just customise the DocumentWindow class itself - override resized(), etc. and put your own components on the title bar.


#6

And then I would have to use my own version of MultiDocumentPanel, because it will use a standard DocumentWindow not my custom one. maybe this is even better because I need a simple MultiDocumentPanel anyway.


#7

at juce_MultiDocumentPanel.h there is:

class MDIDocumentWindow;
class MDITabbedComponent;

and no reference or definition for them anywhere, are they forgotton there?


#8

Hmm - bit of a typo, but they’re just internal classes, no need to worry about them.


#9