46 propertyComponent->refresh();
67 propertyComponent->setBounds (1,
y,
getWidth() - 2, propertyComponent->getPreferredHeight());
68 y = propertyComponent->getBottom() +
padding;
85 if (numComponents > 0 &&
isOpen)
88 y += propertyComponent->getPreferredHeight();
103 propertyComponent->setVisible (open);
106 propertyPanel->resized();
113 propertyComponent->refresh();
120 &&
e.getNumberOfClicks() != 2)
151 section->setBounds (0,
y,
width, section->getPreferredHeight());
152 y = section->getBottom();
162 section->refreshAll();
167 sections.insert (indexToInsertAt, newSection);
176 if (section->getName().isNotEmpty())
177 if (index++ == targetIndex)
254 int extraPaddingBetweenComponents)
267 int extraPaddingBetweenComponents)
277 extraPaddingBetweenComponents));
284 auto maxWidth =
viewport.getMaximumVisibleWidth();
287 auto newMaxWidth =
viewport.getMaximumVisibleWidth();
288 if (maxWidth != newMaxWidth)
307 if (section->getName().isNotEmpty())
308 s.add (section->getName());
325 s->setOpen (shouldBeOpen);
331 s->setEnabled (shouldBeEnabled);
346 auto xml = std::make_unique<XmlElement> (
"PROPERTYPANELSTATE");
348 xml->setAttribute (
"scrollPos",
viewport.getViewPositionY());
351 for (
auto s : sections)
355 auto*
e = xml->createNewChildElement (
"SECTION");
356 e->setAttribute (
"name",
s);
357 e->setAttribute (
"open",
isSectionOpen (sections.indexOf (
s)) ? 1 : 0);
373 e->getBoolAttribute (
"open"));
#define noexcept
Definition DistrhoDefines.h:72
Definition juce_Array.h:56
void addAndMakeVisible(Component *child, int zOrder=-1)
Definition juce_Component.cpp:1554
void repaint()
Definition juce_Component.cpp:1917
Component() noexcept
Definition juce_Component.cpp:517
@ keyboardFocusContainer
Definition juce_Component.h:1307
void setSize(int newWidth, int newHeight)
Definition juce_Component.cpp:1262
TargetClass * findParentComponentOfClass() const
Definition juce_Component.h:813
int getWidth() const noexcept
Definition juce_Component.h:271
LookAndFeel & getLookAndFeel() const noexcept
Definition juce_Component.cpp:2173
Rectangle< int > getLocalBounds() const noexcept
Definition juce_Component.cpp:2283
String getName() const noexcept
Definition juce_Component.h:76
Definition juce_GraphicsContext.h:45
@ centred
Definition juce_Justification.h:138
Definition juce_MouseEvent.h:39
Definition juce_OwnedArray.h:51
void paint(Graphics &) override
Definition juce_PropertyPanel.cpp:216
StringArray getSectionNames() const
Definition juce_PropertyPanel.cpp:301
void setSectionEnabled(int sectionIndex, bool shouldBeEnabled)
Definition juce_PropertyPanel.cpp:328
bool isEmpty() const
Definition juce_PropertyPanel.cpp:243
std::unique_ptr< XmlElement > getOpennessState() const
Definition juce_PropertyPanel.cpp:344
int getTotalContentHeight() const
Definition juce_PropertyPanel.cpp:248
void updatePropHolderLayout() const
Definition juce_PropertyPanel.cpp:282
bool isSectionOpen(int sectionIndex) const
Definition juce_PropertyPanel.cpp:314
void setSectionOpen(int sectionIndex, bool shouldBeOpen)
Definition juce_PropertyPanel.cpp:322
Viewport viewport
Definition juce_PropertyPanel.h:164
void removeSection(int sectionIndex)
Definition juce_PropertyPanel.cpp:334
void resized() override
Definition juce_PropertyPanel.cpp:227
void addSection(const String §ionTitle, const Array< PropertyComponent * > &newPropertyComponents, bool shouldSectionInitiallyBeOpen=true, int indexToInsertAt=-1, int extraPaddingBetweenComponents=0)
Definition juce_PropertyPanel.cpp:263
void init()
Definition juce_PropertyPanel.cpp:201
PropertyHolderComponent * propertyHolderComponent
Definition juce_PropertyPanel.h:167
PropertyPanel()
Definition juce_PropertyPanel.cpp:191
const String & getMessageWhenEmpty() const noexcept
Definition juce_PropertyPanel.cpp:391
~PropertyPanel() override
Definition juce_PropertyPanel.cpp:210
void setMessageWhenEmpty(const String &newMessage)
Definition juce_PropertyPanel.cpp:382
void clear()
Definition juce_PropertyPanel.cpp:234
String messageWhenEmpty
Definition juce_PropertyPanel.h:168
void refreshAll() const
Definition juce_PropertyPanel.cpp:295
void addProperties(const Array< PropertyComponent * > &newPropertyComponents, int extraPaddingBetweenComponents=0)
Definition juce_PropertyPanel.cpp:253
void restoreOpennessState(const XmlElement &newState)
Definition juce_PropertyPanel.cpp:364
Definition juce_StringArray.h:35
Definition juce_String.h:53
bool isNotEmpty() const noexcept
Definition juce_String.h:316
Definition juce_XmlElement.h:83
Iterator< GetNextElementWithTagName > getChildWithTagNameIterator(StringRef name) const
Definition juce_XmlElement.h:730
bool hasTagName(StringRef possibleTagName) const noexcept
Definition juce_XmlElement.cpp:470
int getIntAttribute(StringRef attributeName, int defaultReturnValue=0) const
Definition juce_XmlElement.cpp:571
* e
Definition inflate.c:1404
int y
Definition inflate.c:1588
int g
Definition inflate.c:1573
unsigned s
Definition inflate.c:1555
static const char * name
Definition pugl.h:1582
static int width
Definition pugl.h:1593
#define TRANS(stringLiteral)
Definition juce_LocalisedStrings.h:208
const Colour black
Definition juce_Colours.h:50
Definition carla_juce.cpp:31
Definition juce_PropertyPanel.cpp:140
void paint(Graphics &) override
Definition juce_PropertyPanel.cpp:143
void updateLayout(int width)
Definition juce_PropertyPanel.cpp:145
void refreshAll() const
Definition juce_PropertyPanel.cpp:159
SectionComponent * getSectionWithNonEmptyName(int targetIndex) const noexcept
Definition juce_PropertyPanel.cpp:171
void insertSection(int indexToInsertAt, SectionComponent *newSection)
Definition juce_PropertyPanel.cpp:165
OwnedArray< SectionComponent > sections
Definition juce_PropertyPanel.cpp:184
PropertyHolderComponent()
Definition juce_PropertyPanel.cpp:141
Definition juce_PropertyPanel.cpp:30
void resized() override
Definition juce_PropertyPanel.cpp:61
int titleHeight
Definition juce_PropertyPanel.cpp:131
void lookAndFeelChanged() override
Definition juce_PropertyPanel.cpp:72
bool isOpen
Definition juce_PropertyPanel.cpp:132
void refreshAll() const
Definition juce_PropertyPanel.cpp:110
void mouseDoubleClick(const MouseEvent &e) override
Definition juce_PropertyPanel.cpp:124
~SectionComponent() override
Definition juce_PropertyPanel.cpp:50
SectionComponent(const String §ionTitle, const Array< PropertyComponent * > &newProperties, bool sectionIsOpen, int extraPadding)
Definition juce_PropertyPanel.cpp:31
OwnedArray< PropertyComponent > propertyComps
Definition juce_PropertyPanel.cpp:130
int getPreferredHeight() const
Definition juce_PropertyPanel.cpp:79
void setOpen(bool open)
Definition juce_PropertyPanel.cpp:96
void mouseUp(const MouseEvent &e) override
Definition juce_PropertyPanel.cpp:116
int padding
Definition juce_PropertyPanel.cpp:133
void paint(Graphics &g) override
Definition juce_PropertyPanel.cpp:55
#define const
Definition zconf.h:137