SPAOP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
wonderjuce::ZoomPort Class Reference

A GUI component that wraps another ComponentWithFocusPoint, adding the ability to zoom in and out and to scroll. More...

#include <ZoomPort.h>

Inheritance diagram for wonderjuce::ZoomPort:
Inheritance graph
[legend]
Collaboration diagram for wonderjuce::ZoomPort:
Collaboration graph
[legend]

Public Member Functions

 ZoomPort (const String &componentName=String::empty)
 Constructor. More...
 
virtual ~ZoomPort ()
 Destructor. More...
 
bool setWrappedComponent (ComponentWithFocusPoint *wrappedComponent)
 Sets the component that is wrapped by this ZoomPort. More...
 
void paint (Graphics &)
 
void resized ()
 
void setZoomFactor (float zoomFactor)
 Sets the zoom-factor. More...
 
float getZoomFactor ()
 Returns the current zoom-factor. More...
 

Detailed Description

A GUI component that wraps another ComponentWithFocusPoint, adding the ability to zoom in and out and to scroll.

Note that the child component is assumed to have the same size as this component: setting the zoom-factor to 1.0 will set the size of the wrapped component to the size of this component.

Constructor & Destructor Documentation

wonderjuce::ZoomPort::ZoomPort ( const String &  componentName = String::empty)

Constructor.

wonderjuce::ZoomPort::~ZoomPort ( )
virtual

Destructor.

Member Function Documentation

float wonderjuce::ZoomPort::getZoomFactor ( )

Returns the current zoom-factor.

Returns
The current zoom-factor.
See Also
setZoomFactor
void wonderjuce::ZoomPort::paint ( Graphics &  g)
void wonderjuce::ZoomPort::resized ( )
bool wonderjuce::ZoomPort::setWrappedComponent ( ComponentWithFocusPoint wrappedComponent)

Sets the component that is wrapped by this ZoomPort.

This may only be done once.

Parameters
wrappedComponentThe component to be wrapped in this ZoomPort.
Returns
true on success, false if a wrapped component is already set.
void wonderjuce::ZoomPort::setZoomFactor ( float  zoomFactor)

Sets the zoom-factor.

A zoom-factor of 1.0 will set the size of the wrapped component to the size of this ZoomPort. A zoom-factor x > 1.0 will set the size of the wrapped component to x * the size of this ZoomPort.

Parameters
zoomFactorA zoom-factor >= 1.0.