108 explicit Zone (
int zoneFlags)
noexcept;
112 Zone& operator= (
const Zone&)
noexcept;
114 bool operator== (
const Zone&)
const noexcept;
115 bool operator!= (
const Zone&)
const noexcept;
142 template <
typename ValueType>
146 if (isDraggingWholeObject())
147 return original + distance;
149 if (isDraggingLeftEdge()) original.setLeft (
jmin (original.getRight(), original.getX() + distance.x));
150 if (isDraggingRightEdge()) original.setWidth (
jmax (ValueType(), original.getWidth() + distance.x));
151 if (isDraggingTopEdge()) original.setTop (
jmin (original.getBottom(), original.getY() + distance.y));
152 if (isDraggingBottomEdge()) original.setHeight (
jmax (ValueType(), original.getHeight() + distance.y));
182 bool hitTest (
int x,
int y)
override;
Specifies a set of gaps to be left around the sides of a rectangle.
A class that imposes restrictions on a Component's size or position.
The base class for all JUCE user-interface objects.
A graphics context, used for drawing a component or image.
Represents a mouse cursor image.
Contains position and status information about a mouse event.
A pair of (x, y) coordinates.
Manages a rectangle and allows geometric operations to be performed on it.
Represents the different sections of a resizable border, which allow it to resized in different ways.
bool isDraggingWholeObject() const noexcept
Returns true if dragging this zone will move the entire object without resizing it.
bool isDraggingBottomEdge() const noexcept
Returns true if dragging this zone will move the object's bottom edge.
Rectangle< ValueType > resizeRectangleBy(Rectangle< ValueType > original, const Point< ValueType > &distance) const noexcept
Resizes this rectangle by the given amount, moving just the edges that this zone applies to.
bool isDraggingLeftEdge() const noexcept
Returns true if dragging this zone will move the object's left edge.
bool isDraggingTopEdge() const noexcept
Returns true if dragging this zone will move the object's top edge.
bool isDraggingRightEdge() const noexcept
Returns true if dragging this zone will move the object's right edge.
int getZoneFlags() const noexcept
Returns the raw flags for this zone.
A component that resizes its parent component when dragged.
~ResizableBorderComponent() override
Destructor.
Zone getCurrentZone() const noexcept
Returns the zone in which the mouse was last seen.
This class acts as a pointer which will automatically become null if the object to which it points is...
constexpr Type jmin(Type a, Type b)
Returns the smaller of two values.
constexpr Type jmax(Type a, Type b)
Returns the larger of two values.