60 if (constrainer !=
nullptr)
A class that imposes restrictions on a Component's size or position.
void setBoundsForComponent(Component *component, Rectangle< int > bounds, bool isStretchingTop, bool isStretchingLeft, bool isStretchingBottom, bool isStretchingRight)
Checks the given bounds, and then sets the component to the corrected size.
ComponentDragger()
Creates a ComponentDragger.
void dragComponent(Component *componentToDrag, const MouseEvent &e, ComponentBoundsConstrainer *constrainer)
Call this from your mouseDrag() callback to move the component.
void startDraggingComponent(Component *componentToDrag, const MouseEvent &e)
Call this from your component's mouseDown() method, to prepare for dragging.
virtual ~ComponentDragger()
Destructor.
The base class for all JUCE user-interface objects.
bool isAnyMouseButtonDown() const noexcept
Tests for any of the mouse-button flags.
Contains position and status information about a mouse event.
const ModifierKeys mods
The key modifiers associated with the event.
MouseInputSource source
The source device that generated this 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.
MouseEvent getEventRelativeTo(Component *newComponent) const noexcept
Creates a version of this event that is relative to a different component.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...