From 5065f7257c564620622eaaf4a216d086ff658f30 Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 2 May 2008 20:43:50 +0000 Subject: [PATCH] --- .../gui/components/layout/juce_MultiDocumentPanel.cpp | 5 +++++ .../gui/components/layout/juce_MultiDocumentPanel.h | 4 ++++ .../gui/components/lookandfeel/juce_LookAndFeel.cpp | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/juce_appframework/gui/components/layout/juce_MultiDocumentPanel.cpp b/src/juce_appframework/gui/components/layout/juce_MultiDocumentPanel.cpp index 8a5b62b69d..de185fdc1f 100644 --- a/src/juce_appframework/gui/components/layout/juce_MultiDocumentPanel.cpp +++ b/src/juce_appframework/gui/components/layout/juce_MultiDocumentPanel.cpp @@ -161,6 +161,7 @@ void MultiDocumentPanel::addWindow (Component* component) dw->setResizable (true, false); dw->setContentComponent (component, false, true); dw->setName (component->getName()); + dw->setBackgroundColour (component->getComponentPropertyColour (T("mdiDocumentBkg_"), false, backgroundColour)); int x = 4; Component* const topComp = getChildComponent (getNumChildComponents() - 1); @@ -181,6 +182,10 @@ bool MultiDocumentPanel::addDocument (Component* const component, const Colour& backgroundColour, const bool deleteWhenRemoved) { + // If you try passing a full DocumentWindow or ResizableWindow in here, you'll end up + // with a frame-within-a-frame! Just pass in the bare content component. + jassert (dynamic_cast (component) == 0); + if (component == 0 || (maximumNumDocuments > 0 && components.size() >= maximumNumDocuments)) return false; diff --git a/src/juce_appframework/gui/components/layout/juce_MultiDocumentPanel.h b/src/juce_appframework/gui/components/layout/juce_MultiDocumentPanel.h index c1a924ae7b..8900f9dd8f 100644 --- a/src/juce_appframework/gui/components/layout/juce_MultiDocumentPanel.h +++ b/src/juce_appframework/gui/components/layout/juce_MultiDocumentPanel.h @@ -132,6 +132,10 @@ public: this will fail and return false. (If it does fail, the component passed-in will not be deleted, even if deleteWhenRemoved was set to true). + The MultiDocumentPanel will deal with creating a window border to go around your component, + so just pass in the bare content component here, no need to give it a ResizableWindow + or DocumentWindow. + @param component the component to add @param backgroundColour the background colour to use to fill the component's window or tab diff --git a/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp b/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp index 9ca302ae61..1af29b7e3f 100644 --- a/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp +++ b/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp @@ -1083,7 +1083,8 @@ void LookAndFeel::drawMenuBarItem (Graphics& g, } //============================================================================== -void LookAndFeel::fillTextEditorBackground (Graphics& g, int width, int height, TextEditor& textEditor) +void LookAndFeel::fillTextEditorBackground (Graphics& g, int /*width*/, int /*height*/, + TextEditor& textEditor) { g.fillAll (textEditor.findColour (TextEditor::backgroundColourId)); }