Krotos Modules 3
Loading...
Searching...
No Matches
krotos::ModulationAssignerDropArea Class Reference

#include <ModulationAssignerDropArea.h>

Inheritance diagram for krotos::ModulationAssignerDropArea:

Classes

struct  ComponentIds
 

Public Member Functions

 ModulationAssignerDropArea ()
 
void resized () override
 
void paint (Graphics &g) override
 
const OwnedArray< DropComponent > & getDropComponents () const noexcept
 Returns an array of the child drop components.
 
int getNumDropComponents () const noexcept
 Returns the number of child drop components.
 
DropComponentaddDropComponent (DropComponent *newComp)
 
MultiDropComponentaddMultiDropComponent (MultiDropComponent *newComp)
 
void removeComponent (const String &kwidgetID)
 Remove a drop component using its associated kwidgetID.
 
void setMargin (float margin)
 Sets the flex box margin.
 
void setNumComponentsPerRow (int min, int max)
 Set the min / max number of drop components allowed per row in the flex box.
 
void drawSingleRowAsColumn (bool isColumn)
 Set this to true if a DropArea with a single row of items should draw as a column, i.e. The drop components will span the full horizontal width of the DropArea.
 
DropComponentfindDropComponent (const String &kwidgetID, int modSourceID)
 Searches all the DropComponents in this DropArea to find which one is attached to the given kwidget modulation source, and returns a pointer to it.
 

Private Attributes

OwnedArray< DropComponentm_dropComponents
 
OwnedArray< MultiDropComponentm_multiDropComponents
 
int m_minPerRow {3}
 
int m_maxPerRow {3}
 
float m_margin {1.0f}
 
Colour m_borderColour {Colours::red}
 
bool m_singleRowColumn {false}
 

Constructor & Destructor Documentation

◆ ModulationAssignerDropArea()

krotos::ModulationAssignerDropArea::ModulationAssignerDropArea ( )

Member Function Documentation

◆ addDropComponent()

DropComponent * krotos::ModulationAssignerDropArea::addDropComponent ( DropComponent * newComp)

◆ addMultiDropComponent()

MultiDropComponent * krotos::ModulationAssignerDropArea::addMultiDropComponent ( MultiDropComponent * newComp)

◆ drawSingleRowAsColumn()

void krotos::ModulationAssignerDropArea::drawSingleRowAsColumn ( bool isColumn)
inline

Set this to true if a DropArea with a single row of items should draw as a column, i.e. The drop components will span the full horizontal width of the DropArea.

◆ findDropComponent()

DropComponent * krotos::ModulationAssignerDropArea::findDropComponent ( const String & kwidgetID,
int modSourceID )

Searches all the DropComponents in this DropArea to find which one is attached to the given kwidget modulation source, and returns a pointer to it.

Parameters
kwidgetIDThe ID of the modulator kwidget that this DropComponent is assigned to
modSourceIDThe index of the modulation source that this DropComponent is assigned to e.g. ("XYPad1", 0) would try and return the DropComponent that is being used to assign modulation to XYPad1's X axis.
Returns
A pointer to the DropComponent, or nullptr if not found.

◆ getDropComponents()

const OwnedArray< DropComponent > & krotos::ModulationAssignerDropArea::getDropComponents ( ) const
inlinenoexcept

Returns an array of the child drop components.

◆ getNumDropComponents()

int krotos::ModulationAssignerDropArea::getNumDropComponents ( ) const
inlinenoexcept

Returns the number of child drop components.

◆ paint()

void krotos::ModulationAssignerDropArea::paint ( Graphics & g)
override

◆ removeComponent()

void krotos::ModulationAssignerDropArea::removeComponent ( const String & kwidgetID)

Remove a drop component using its associated kwidgetID.

◆ resized()

void krotos::ModulationAssignerDropArea::resized ( )
override

◆ setMargin()

void krotos::ModulationAssignerDropArea::setMargin ( float margin)

Sets the flex box margin.

◆ setNumComponentsPerRow()

void krotos::ModulationAssignerDropArea::setNumComponentsPerRow ( int min,
int max )
inline

Set the min / max number of drop components allowed per row in the flex box.

Member Data Documentation

◆ m_borderColour

Colour krotos::ModulationAssignerDropArea::m_borderColour {Colours::red}
private

◆ m_dropComponents

OwnedArray<DropComponent> krotos::ModulationAssignerDropArea::m_dropComponents
private

◆ m_margin

float krotos::ModulationAssignerDropArea::m_margin {1.0f}
private

◆ m_maxPerRow

int krotos::ModulationAssignerDropArea::m_maxPerRow {3}
private

◆ m_minPerRow

int krotos::ModulationAssignerDropArea::m_minPerRow {3}
private

◆ m_multiDropComponents

OwnedArray<MultiDropComponent> krotos::ModulationAssignerDropArea::m_multiDropComponents
private

◆ m_singleRowColumn

bool krotos::ModulationAssignerDropArea::m_singleRowColumn {false}
private

The documentation for this class was generated from the following files: