29ResizableBorderComponent::Zone::Zone() noexcept {}
39bool ResizableBorderComponent::Zone::operator== (
const ResizableBorderComponent::Zone&
other)
const noexcept {
return zone ==
other.zone; }
40bool ResizableBorderComponent::Zone::operator!= (
const ResizableBorderComponent::Zone&
other)
const noexcept {
return zone !=
other.zone; }
118 if (component ==
nullptr)
126 originalBounds = component->getBounds();
128 if (
auto* peer = component->getPeer())
129 if (&peer->getComponent() == component)
132 if (constrainer !=
nullptr)
138 if (component ==
nullptr)
146 if (constrainer !=
nullptr)
156 if (
auto* p = component->getPositioner())
165 if (constrainer !=
nullptr)
188void ResizableBorderComponent::updateMouseZone (
const MouseEvent& e)
Specifies a set of gaps to be left around the sides of a rectangle.
ValueType getTop() const noexcept
Returns the gap that should be left at the top of the region.
ValueType getLeft() const noexcept
Returns the gap that should be left at the left of the region.
Rectangle< ValueType > subtractedFrom(const Rectangle< ValueType > &original) const noexcept
Returns a rectangle with these borders removed from it.
ValueType getRight() const noexcept
Returns the gap that should be left at the right of the region.
ValueType getBottom() const noexcept
Returns the gap that should be left at the bottom of the region.
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.
virtual void resizeEnd()
This callback happens when the resizer has finished dragging.
virtual void resizeStart()
This callback happens when the resizer is about to start dragging.
The base class for all JUCE user-interface objects.
int getHeight() const noexcept
Returns the component's height in pixels.
void setMouseCursor(const MouseCursor &cursorType)
Changes the mouse cursor shape to use when the mouse is over this component.
void repaint()
Marks the whole component as needing to be redrawn.
int getWidth() const noexcept
Returns the component's width in pixels.
Point< int > localPointToGlobal(Point< int > localPoint) const
Converts a point relative to this component's top-left into a screen coordinate.
LookAndFeel & getLookAndFeel() const noexcept
Finds the appropriate look-and-feel to use for this component.
Rectangle< int > getLocalBounds() const noexcept
Returns the component's bounds, relative to its own origin.
A graphics context, used for drawing a component or image.
Represents a mouse cursor image.
@ TopLeftCornerResizeCursor
A platform-specific cursor for resizing the top-left-corner of a window.
@ BottomLeftCornerResizeCursor
A platform-specific cursor for resizing the bottom-left-corner of a window.
@ NormalCursor
The standard arrow cursor.
@ LeftEdgeResizeCursor
A platform-specific cursor for resizing the left-edge of a window.
@ BottomEdgeResizeCursor
A platform-specific cursor for resizing the bottom-edge of a window.
@ TopEdgeResizeCursor
A platform-specific cursor for resizing the top-edge of a window.
@ BottomRightCornerResizeCursor
A platform-specific cursor for resizing the bottom-right-corner of a window.
@ RightEdgeResizeCursor
A platform-specific cursor for resizing the right-edge of a window.
@ TopRightCornerResizeCursor
A platform-specific cursor for resizing the top-right-corner of a window.
Contains position and status information about a mouse event.
Point< int > getOffsetFromDragStart() const noexcept
Returns the difference between the mouse's current position and where it was when the button was last...
Point< int > getPosition() const noexcept
The position of the mouse when the event occurred.
A pair of (x, y) coordinates.
ValueType y
The point's Y coordinate.
ValueType x
The point's X coordinate.
Manages a rectangle and allows geometric operations to be performed on it.
bool contains(ValueType xCoord, ValueType yCoord) const noexcept
Returns true if this coordinate is inside the rectangle.
ValueType getWidth() const noexcept
Returns the width of the rectangle.
ValueType getHeight() const noexcept
Returns the height of the rectangle.
Represents the different sections of a resizable border, which allow it to resized in different ways.
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.
MouseCursor getMouseCursor() const noexcept
Returns an appropriate mouse-cursor for this resize zone.
bool isDraggingRightEdge() const noexcept
Returns true if dragging this zone will move the object's right edge.
static Zone fromPositionOnBorder(Rectangle< int > totalSize, BorderSize< int > border, Point< int > position)
Given a point within a rectangle with a resizable border, this returns the zone that the point lies w...
void mouseDrag(const MouseEvent &) override
Called when the mouse is moved while a button is held down.
bool hitTest(int x, int y) override
Tests whether a given point is inside the component.
~ResizableBorderComponent() override
Destructor.
void mouseDown(const MouseEvent &) override
Called when a mouse button is pressed.
void mouseUp(const MouseEvent &) override
Called when a mouse button is released.
void mouseEnter(const MouseEvent &) override
Called when the mouse first enters a component.
void paint(Graphics &) override
Components can override this method to draw their content.
void mouseMove(const MouseEvent &) override
Called when the mouse moves inside a component.
void setBorderThickness(BorderSize< int > newBorderSize)
Specifies how many pixels wide the draggable edges of this component are.
BorderSize< int > getBorderThickness() const
Returns the number of pixels wide that the draggable edges of this component are.
ResizableBorderComponent(Component *componentToResize, ComponentBoundsConstrainer *constrainer)
Creates a resizer.
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.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...