JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_PropertyPanel.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29//==============================================================================
43class JUCE_API PropertyPanel : public Component
44{
45public:
46 //==============================================================================
49
51 PropertyPanel (const String& name);
52
54 ~PropertyPanel() override;
55
56 //==============================================================================
58 void clear();
59
68 void addProperties (const Array<PropertyComponent*>& newPropertyComponents,
69 int extraPaddingBetweenComponents = 0);
70
82 void addSection (const String& sectionTitle,
83 const Array<PropertyComponent*>& newPropertyComponents,
84 bool shouldSectionInitiallyBeOpen = true,
85 int indexToInsertAt = -1,
86 int extraPaddingBetweenComponents = 0);
87
89 void refreshAll() const;
90
92 bool isEmpty() const;
93
97 int getTotalContentHeight() const;
98
99 //==============================================================================
103 StringArray getSectionNames() const;
104
108 bool isSectionOpen (int sectionIndex) const;
109
113 void setSectionOpen (int sectionIndex, bool shouldBeOpen);
114
118 void setSectionEnabled (int sectionIndex, bool shouldBeEnabled);
119
123 void removeSection (int sectionIndex);
124
125 //==============================================================================
130 std::unique_ptr<XmlElement> getOpennessState() const;
131
140 void restoreOpennessState (const XmlElement& newState);
141
142 //==============================================================================
146 void setMessageWhenEmpty (const String& newMessage);
147
151 const String& getMessageWhenEmpty() const noexcept;
152
153 //==============================================================================
155 Viewport& getViewport() noexcept { return viewport; }
156
157 //==============================================================================
159 void paint (Graphics&) override;
161 void resized() override;
162
163private:
164 Viewport viewport;
165 struct SectionComponent;
166 struct PropertyHolderComponent;
167 PropertyHolderComponent* propertyHolderComponent;
168 String messageWhenEmpty;
169
170 void init();
171 void updatePropHolderLayout() const;
172 void updatePropHolderLayout (int width) const;
173
175};
176
177} // namespace juce
Holds a resizable array of primitive or copy-by-value objects.
Definition juce_Array.h:56
The base class for all JUCE user-interface objects.
A graphics context, used for drawing a component or image.
A panel that holds a list of PropertyComponent objects.
Viewport & getViewport() noexcept
Returns the PropertyPanel's internal Viewport.
A special array for holding a list of strings.
The JUCE String class!
Definition juce_String.h:53
A Viewport is used to contain a larger child component, and allows the child to be automatically scro...
Used to build a tree of elements representing an XML document.
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
This is a shorthand way of writing both a JUCE_DECLARE_NON_COPYABLE and JUCE_LEAK_DETECTOR macro for ...
JUCE Namespace.