60 tc->dragOffsetX = e.
x;
61 tc->dragOffsetY = e.
y;
77 tc->isBeingDragged =
true;
80 tc->setVisible (
false);
92 tc->isBeingDragged =
false;
95 tb->updateAllItemPositions (
true);
The base class for all JUCE user-interface objects.
void setRepaintsOnMouseActivity(bool shouldRepaint) noexcept
Causes automatic repaints when the mouse enters or exits this component.
bool isMouseOverOrDragging(bool includeChildren=false) const
True if the mouse is over this component, or if it's being dragged in this component.
Component * getParentComponent() const noexcept
Returns the component which this component is inside.
int getHeight() const noexcept
Returns the component's height in pixels.
void setAlwaysOnTop(bool shouldStayOnTop)
Sets whether the component should always be kept at the front of its siblings.
void setMouseCursor(const MouseCursor &cursorType)
Changes the mouse cursor shape to use when the mouse is over this component.
void setBounds(int x, int y, int width, int height)
Changes the component's position and size.
Colour findColour(int colourID, bool inheritFromParent=false) const
Looks for a colour that has been registered with the given colour ID number.
int getWidth() const noexcept
Returns the component's width in pixels.
Rectangle< int > getLocalBounds() const noexcept
Returns the component's bounds, relative to its own origin.
int getParentWidth() const noexcept
Returns the width of the component's parent.
int getParentHeight() const noexcept
Returns the height of the component's parent.
Enables drag-and-drop behaviour for a component and all its sub-components.
static DragAndDropContainer * findParentDragContainerFor(Component *childComponent)
Utility to find the DragAndDropContainer for a given Component.
A graphics context, used for drawing a component or image.
void drawRect(int x, int y, int width, int height, int lineThickness=1) const
Draws a rectangular outline, using the current colour or brush.
void setColour(Colour newColour)
Changes the current drawing colour.
@ DraggingHandCursor
An open flat hand for dragging heavy objects around.
Contains position and status information about a mouse event.
MouseInputSource source
The source device that generated this event.
const int x
The x-position of the mouse when the event occurred.
bool mouseWasDraggedSinceMouseDown() const noexcept
Returns true if the user seems to be performing a drag gesture.
const int y
The y-position of the mouse when the event occurred.
An image that will be resampled before it is drawn.
constexpr Type jmin(Type a, Type b)
Returns the smaller of two values.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...