JUCE
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
Public Types | Public Member Functions | Protected Member Functions
ResizableEdgeComponent Class Reference

A component that resizes its parent component when dragged. More...

Inherits Component.

List of all members.

Public Types

enum  Edge { leftEdge, rightEdge, topEdge, bottomEdge }

Public Member Functions

 ResizableEdgeComponent (Component *componentToResize, ComponentBoundsConstrainer *constrainer, Edge edgeToResize)
 Creates a resizer bar.
 ~ResizableEdgeComponent ()
 Destructor.
bool isVertical () const noexcept

Protected Member Functions

void paint (Graphics &g)
void mouseDown (const MouseEvent &e)
void mouseDrag (const MouseEvent &e)
void mouseUp (const MouseEvent &e)

Detailed Description

A component that resizes its parent component when dragged.

This component forms a bar along one edge of a component, allowing it to be dragged by that edges to resize it.

To use it, just add it to your component, positioning it along the appropriate edge. Make sure you reposition the resizer component each time the parent's size changes, to keep it in the correct position.

See also:
ResizbleBorderComponent, ResizableCornerComponent

Member Enumeration Documentation

Enumerator:
leftEdge 

Indicates a vertical bar that can be dragged left/right to move the component's left-hand edge.

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.


Constructor & Destructor Documentation

ResizableEdgeComponent::ResizableEdgeComponent ( Component componentToResize,
ComponentBoundsConstrainer constrainer,
Edge  edgeToResize 
)

Creates a resizer bar.

Pass in the target component which you want to be resized when this one is dragged. The target component will usually be this component's parent, but this isn't mandatory.

Remember that when the target component is resized, it'll need to move and resize this component to keep it in place, as this won't happen automatically.

If the constrainer parameter is non-zero, then this object will be used to enforce limits on the size and position that the component can be stretched to. Make sure that the constrainer isn't deleted while still in use by this object.

See also:
ComponentBoundsConstrainer

Destructor.


Member Function Documentation

void ResizableEdgeComponent::paint ( Graphics g) [protected, virtual]

Reimplemented from Component.

void ResizableEdgeComponent::mouseDown ( const MouseEvent e) [protected, virtual]

Reimplemented from Component.

void ResizableEdgeComponent::mouseDrag ( const MouseEvent e) [protected, virtual]

Reimplemented from Component.

void ResizableEdgeComponent::mouseUp ( const MouseEvent e) [protected, virtual]

Reimplemented from Component.


The documentation for this class was generated from the following file: