Hi,
I would like to understand the LassoComponent but I'm having an hard time reading from the IntroJucer files.
I have a parent component with several child components (Cable) that I want to select.
In my parent component declaration I have this:
class myParentClass : public Component, public LassoSource<Cable*>
public:
void findLassoItemsInArea (Array <Cable*>& results, const Rectangle<int>& area);
SelectedItemSet<Cable*> selected;
SelectedItemSet<Cable*>& getLassoSelection();
then:
void myParentClass::mouseDown(const juce::MouseEvent &e)
{
addChildComponent(lassoCable);
lassoCable.beginLasso(e, this);
}
void myParentClass::mouseDrag(const juce::MouseEvent &e)
{
lassoCable.toFront(false);
lassoCable.dragLasso(e);
}
void myParentClass::mouseUp(const juce::MouseEvent &e)
{
lassoCable.endLasso();
removeChildComponent(&lassoCable);
}
void ModularSpace::findLassoItemsInArea (Array <Cable*>& results, const Rectangle<int>& area)
{
}
SelectedItemSet<Cable*>& ModularSpace::getLassoSelection()
{
return selected;
}
The lasso drawing is fine, but I don't understand how can I manage which component (Cable) is selected.
How am I supposed to use findLassoItemsInArea and the getLassoSelection?
Thanks!
