13 class CustomLayout :
public Component,
public ValueTree::Listener,
public ComponentListener
21 static const Identifier
slot;
26 static const Identifier
name;
43 void paint(Graphics&)
override{};
158 void addSlot(
const String& name,
const Rectangle<int>& bounds);
176 void valueTreeChildAdded(ValueTree& parentTree, ValueTree& childWhichHasBeenAdded)
override;
179 int indexFromWhichChildWasRemoved)
override;
192 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(
CustomLayout)
Definition CustomLayout.h:14
void resized() override
Definition CustomLayout.cpp:23
void configureAutoLayout(FlexBox flexboxSettings, FlexItem::Margin margin)
Definition CustomLayout.cpp:227
std::function< Rectangle< int >(String componentType, Rectangle< int > currentBounds)> getAutoLayoutBoundsFromType
Used to look up what bounds should be used for a given component type when using auto layout....
Definition CustomLayout.h:134
~CustomLayout()
Definition CustomLayout.cpp:21
void paint(Graphics &) override
Definition CustomLayout.h:43
void setLayoutTree(const ValueTree &layoutTree)
Definition CustomLayout.h:52
void valueTreePropertyChanged(ValueTree &treeWhosePropertyHasChanged, const Identifier &property) override
Definition CustomLayout.cpp:199
ValueTree & getLayoutTree()
Definition CustomLayout.cpp:68
static const String FileExtension
Definition CustomLayout.h:31
FlexBox m_flexSettings
Definition CustomLayout.h:147
ValueTree m_layoutTree
Definition CustomLayout.h:142
void valueTreeRedirected(ValueTree &treeWhichHasBeenChanged)
Definition CustomLayout.cpp:204
bool m_editable
Definition CustomLayout.h:144
void valueTreeChildAdded(ValueTree &parentTree, ValueTree &childWhichHasBeenAdded) override
Definition CustomLayout.cpp:181
static const Rectangle< int > DefaultSize
Definition CustomLayout.h:32
CustomLayout()
Definition CustomLayout.cpp:15
void setAutoLayout(bool isEnabled)
Use this to enable / disable automatic laying out of slots using FlexBox. FlexBox settings must be co...
Definition CustomLayout.h:119
void addComponent(Component &component, Rectangle< int > bounds=CustomLayout::DefaultSize)
Definition CustomLayout.cpp:94
void saveLayout()
Definition CustomLayout.cpp:147
void resetLayoutTree(const ValueTree &layoutTree)
Definition CustomLayout.cpp:75
FlexItem::Margin m_flexMargin
Definition CustomLayout.h:148
bool isAutoLayoutActive()
Returns true if auto layout is active.
Definition CustomLayout.h:125
void componentMovedOrResized(Component &component, bool wasMoved, bool wasResized) override
Definition CustomLayout.cpp:212
void valueTreeChildRemoved(ValueTree &parentTree, ValueTree &childWhichHasBeenRemoved, int indexFromWhichChildWasRemoved) override
Definition CustomLayout.cpp:189
OwnedArray< Component > m_components
Definition CustomLayout.h:141
bool m_autoLayout
Definition CustomLayout.h:146
void addSlot(const String &name, const Rectangle< int > &bounds)
Definition CustomLayout.cpp:82
bool isEditModeActive()
Definition CustomLayout.h:111
void removeComponent(int index)
Definition CustomLayout.cpp:130
std::function< void()> treeRedirected
Definition CustomLayout.h:138
Component * createAndAddResizableComponent(String name, Rectangle< int > bounds)
Definition CustomLayout.cpp:161
void setEditModeActive(bool isEditModeActive)
Definition CustomLayout.cpp:137
Definition AirAbsorptionFilter.cpp:2
Definition CustomLayout.h:25
static const Identifier name
Definition CustomLayout.h:26
static const Identifier index
Definition CustomLayout.h:27
static const Identifier bounds
Definition CustomLayout.h:28
Definition CustomLayout.h:19
static const Identifier slot
Definition CustomLayout.h:21
static const Identifier layout
Definition CustomLayout.h:20