44bool ResizableEdgeComponent::isVertical()
const noexcept
57 if (component ==
nullptr)
63 originalBounds = component->getBounds();
80 if (
auto* peer = component->getPeer())
81 if (&peer->getComponent() == component)
84 if (constrainer !=
nullptr)
90 if (component ==
nullptr)
107 if (constrainer !=
nullptr)
117 if (
auto* p = component->getPositioner())
126 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.
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.
bool isMouseOver(bool includeChildren=false) const
Returns true if the mouse is currently 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.
@ LeftRightResizeCursor
An arrow pointing left and right.
@ UpDownResizeCursor
an arrow pointing up and down.
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...
void setLeft(ValueType newLeft) noexcept
Moves the x position, adjusting the width so that the right-hand edge remains in the same place.
Represents the different sections of a resizable border, which allow it to resized in different ways.
~ResizableEdgeComponent() override
Destructor.
void mouseDown(const MouseEvent &) override
Called when a mouse button is pressed.
ResizableEdgeComponent(Component *componentToResize, ComponentBoundsConstrainer *constrainer, Edge edgeToResize)
Creates a resizer bar.
void paint(Graphics &) override
Components can override this method to draw their content.
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.
@ rightEdge
Indicates a vertical bar that can be dragged left/right to move the component's right-hand edge.
@ topEdge
Indicates a horizontal bar that can be dragged up/down to move the top of the component.
@ bottomEdge
Indicates a horizontal bar that can be dragged up/down to move the bottom of the component.
@ leftEdge
Indicates a vertical bar that can be dragged left/right to move the component's left-hand edge.
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...