40template <
class SelectableItemType>
99template <
class SelectableItemType>
127 originalSelection =
lassoSource->getLassoSelection().getItemArray();
147 if (source !=
nullptr)
179 originalSelection.
clear();
213 bool hitTest (
int,
int)
override {
return false; }
Holds a resizable array of primitive or copy-by-value objects.
void removeValuesIn(const OtherArrayType &otherArray)
Removes any elements which are also in another array.
void clear()
Removes all elements from the array.
The base class for all JUCE user-interface objects.
static bool JUCE_CALLTYPE isMouseButtonDownAnywhere() noexcept
Returns true if a mouse button is currently down.
Component * getParentComponent() const noexcept
Returns the component which this component is inside.
Rectangle< int > getBounds() const noexcept
Returns this component's bounding box.
void setBounds(int x, int y, int width, int height)
Changes the component's position and size.
void setSize(int newWidth, int newHeight)
Changes the size of the component.
LookAndFeel & getLookAndFeel() const noexcept
Finds the appropriate look-and-feel to use for this component.
virtual void setVisible(bool shouldBeVisible)
Makes the component visible or invisible.
A graphics context, used for drawing a component or image.
A component that acts as a rectangular selection region, which you drag with the mouse to select grou...
void endLasso()
Call this in your mouseUp event, after the lasso has been dragged.
LassoComponent()=default
Creates a Lasso component.
bool hitTest(int, int) override
Tests whether a given point is inside the component.
void beginLasso(const MouseEvent &e, LassoSource< SelectableItemType > *lassoSource)
Call this in your mouseDown event, to initialise a drag.
void paint(Graphics &g) override
Components can override this method to draw their content.
void dragLasso(const MouseEvent &e)
Call this in your mouseDrag event, to update the lasso's position.
ColourIds
A set of colour IDs to use to change the colour of various aspects of the label.
@ lassoFillColourId
The colour to fill the lasso rectangle with.
@ lassoOutlineColourId
The colour to draw the outline with.
A class used by the LassoComponent to manage the things that it selects.
virtual ~LassoSource()=default
Destructor.
virtual void findLassoItemsInArea(Array< SelectableItemType > &itemsFound, const Rectangle< int > &area)=0
Returns the set of items that lie within a given lassoable region.
virtual SelectedItemSet< SelectableItemType > & getLassoSelection()=0
Returns the SelectedItemSet that the lasso should update.
bool isAltDown() const noexcept
Checks whether the ALT key's flag is set.
bool isCommandDown() const noexcept
Checks whether the 'command' key flag is set (or 'ctrl' on Windows/Linux).
bool isShiftDown() const noexcept
Checks whether the shift key's flag is set.
Contains position and status information about a mouse event.
const ModifierKeys mods
The key modifiers associated with the event.
Point< int > getPosition() const noexcept
The position of the mouse when the event occurred.
Point< int > getMouseDownPosition() const noexcept
Returns the coordinates of the last place that a mouse was pressed.
A pair of (x, y) coordinates.
Manages a rectangle and allows geometric operations to be performed on it.
Manages a list of selectable items.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...