6 "SharedModeAssignPanel");
8 "SharedModeAssignPanel");
16 Rectangle<int> bounds = getLocalBounds();
19 flexBox.flexDirection = FlexBox::Direction::row;
20 flexBox.flexWrap = FlexBox::Wrap::wrap;
21 flexBox.alignContent = FlexBox::AlignContent::stretch;
22 flexBox.alignItems = FlexBox::AlignItems::stretch;
23 flexBox.justifyContent = FlexBox::JustifyContent::flexStart;
24 std::vector<FlexBox> rows;
26 const FlexItem::Margin margin{
m_margin};
33 rows.push_back(flexBox);
34 flexBox.items.clear();
36 flexBox.items.add(FlexItem(*comp).withMargin(margin).withFlex(1.0f));
43 rows.push_back(flexBox);
44 flexBox.items.clear();
46 flexBox.items.add(FlexItem(*comp).withMargin(margin).withFlex(1.0f));
50 if (!flexBox.items.isEmpty())
52 rows.push_back(flexBox);
56 const int rowHeight = rows.size() > 0 ? bounds.getHeight() / (int)rows.size() : bounds.getHeight();
57 int y = bounds.getY();
61 rows[0].flexDirection = FlexBox::Direction::column;
63 for (
auto& row : rows)
65 Rectangle<int> rowBounds = bounds.removeFromTop(rowHeight);
66 row.performLayout(rowBounds);
74 addAndMakeVisible(newComp);
82 addAndMakeVisible(newComp);
91 if (dropComponent->getConnectedKwidgetID() == kwidgetID)
99 if (c->getConnectedKwidgetID() == kwidgetID)
103 return c->getDropComponents()[modSourceID];
116 if (dropComponent->getConnectedKwidgetID() == kwidgetID)
129 if (c->getConnectedKwidgetID() == kwidgetID)
A component for dropping draggable juce objects onto.
Definition DropComponent.h:11
OwnedArray< MultiDropComponent > m_multiDropComponents
Definition ModulationAssignerDropArea.h:75
void removeComponent(const String &kwidgetID)
Remove a drop component using its associated kwidgetID.
Definition ModulationAssignerDropArea.cpp:111
DropComponent * findDropComponent(const String &kwidgetID, int modSourceID)
Searches all the DropComponents in this DropArea to find which one is attached to the given kwidget m...
Definition ModulationAssignerDropArea.cpp:87
const OwnedArray< DropComponent > & getDropComponents() const noexcept
Returns an array of the child drop components.
Definition ModulationAssignerDropArea.h:21
OwnedArray< DropComponent > m_dropComponents
Definition ModulationAssignerDropArea.h:74
void paint(Graphics &g) override
Definition ModulationAssignerDropArea.cpp:12
DropComponent * addDropComponent(DropComponent *newComp)
Definition ModulationAssignerDropArea.cpp:71
bool m_singleRowColumn
Definition ModulationAssignerDropArea.h:79
ModulationAssignerDropArea()
Definition ModulationAssignerDropArea.cpp:10
int m_maxPerRow
Definition ModulationAssignerDropArea.h:76
float m_margin
Definition ModulationAssignerDropArea.h:77
void resized() override
Definition ModulationAssignerDropArea.cpp:14
void setMargin(float margin)
Sets the flex box margin.
Definition ModulationAssignerDropArea.cpp:141
MultiDropComponent * addMultiDropComponent(MultiDropComponent *newComp)
Definition ModulationAssignerDropArea.cpp:79
A simple container for a holding multiple drop components used for assigning modulation to a kwidget ...
Definition MultiDropComponent.h:16
Definition AirAbsorptionFilter.cpp:2
static const String ModulationMultiDropComponentID
Definition ModulationAssignerDropArea.h:59
static const String ModulationDropComponentID
Definition ModulationAssignerDropArea.h:58