50 if (component ==
nullptr)
56 originalBounds = component->getBounds();
59 const Zone zone { Zone::bottom | Zone::right };
61 if (
auto* peer = component->getPeer())
62 if (&peer->getComponent() == component)
65 if (constrainer !=
nullptr)
71 if (component ==
nullptr)
80 if (constrainer !=
nullptr)
82 else if (
auto pos = component->getPositioner())
83 pos->applyNewBounds (r);
85 component->setBounds (r);
90 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.
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.
bool isMouseButtonDown(bool includeChildren=false) const
Returns true if the mouse button is currently held down in this component.
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.
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.
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.
A graphics context, used for drawing a component or image.
@ BottomRightCornerResizeCursor
A platform-specific cursor for resizing the bottom-right-corner of a window.
Contains position and status information about a mouse event.
Point< int > getPosition() const noexcept
The position of the mouse when the event occurred.
int getDistanceFromDragStartY() const noexcept
Returns the difference between the mouse's current y position and where it was when the button was la...
int getDistanceFromDragStartX() const noexcept
Returns the difference between the mouse's current x position and where it was when the button was la...
ValueType getWidth() const noexcept
Returns the width of the rectangle.
Rectangle withSize(ValueType newWidth, ValueType newHeight) const noexcept
Returns a rectangle with the same top-left position as this one, but a new size.
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.
void paint(Graphics &) override
Components can override this method to draw their content.
~ResizableCornerComponent() override
Destructor.
void mouseDrag(const MouseEvent &) override
Called when the mouse is moved while a button is held down.
void mouseUp(const MouseEvent &) override
Called when a mouse button is released.
bool hitTest(int x, int y) override
Tests whether a given point is inside the component.
void mouseDown(const MouseEvent &) override
Called when a mouse button is pressed.
ResizableCornerComponent(Component *componentToResize, ComponentBoundsConstrainer *constrainer)
Creates a resizer.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...