From 08384a52933dc6e166f2a67cee2e0e7b8ed0f3ca Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 30 Oct 2013 14:03:11 +0000 Subject: [PATCH] Added a new PropertyPanel constructor. --- .../properties/juce_PropertyPanel.cpp | 13 ++++++++++++- .../juce_gui_basics/properties/juce_PropertyPanel.h | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp b/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp index f8a9f72617..fd1c21d3ec 100644 --- a/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp +++ b/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp @@ -180,8 +180,19 @@ private: //============================================================================== PropertyPanel::PropertyPanel() - : messageWhenEmpty (TRANS("(nothing selected)")) { + init(); +} + +PropertyPanel::PropertyPanel (const String& name) : Component (name) +{ + init(); +} + +void PropertyPanel::init() +{ + messageWhenEmpty = TRANS("(nothing selected)"); + addAndMakeVisible (&viewport); viewport.setViewedComponent (propertyHolderComponent = new PropertyHolderComponent()); viewport.setFocusContainer (true); diff --git a/modules/juce_gui_basics/properties/juce_PropertyPanel.h b/modules/juce_gui_basics/properties/juce_PropertyPanel.h index 4984f424ab..2ec47f6723 100644 --- a/modules/juce_gui_basics/properties/juce_PropertyPanel.h +++ b/modules/juce_gui_basics/properties/juce_PropertyPanel.h @@ -45,6 +45,9 @@ public: /** Creates an empty property panel. */ PropertyPanel(); + /** Creates an empty property panel. */ + PropertyPanel (const String& name); + /** Destructor. */ ~PropertyPanel(); @@ -153,6 +156,7 @@ private: PropertyHolderComponent* propertyHolderComponent; String messageWhenEmpty; + void init(); void updatePropHolderLayout() const; void updatePropHolderLayout (int width) const;