[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    Adjuster(3X) manual page Table of Contents

Name

Adjuster - base class for interactors that provide scrolling and zooming;
controls for other interactors which maintain a perspective

Synopsis

#include <ivplus/adjuster.h>

Description

Adjuster objects manipulate a perspective using a pushbutton-like interface. Adjusters provide auto-repeat. Pressing and holding down any mouse button on an adjuster for a specified time causes it to repeatedly perform its operation. The auto-repeat stops when the button is released.

Zoomer and Mover are derived from Adjuster. Zoomers adjust the perspective’s curwidth and curheight member variables to suggest reduction or magnification. The Enlarger zoomer derived class halves the perspective values while the Reducer zoomer derived class doubles them. There are four kinds of movers Left, Right, Down, and Up which adjust the perspective.

Adjusters work by requesting their subject interactor to change its perspective. This is done by calling the interactor’s Adjust() member function. Adjuster is an abstract base class.

Class Hierarchy

Adjuster -> Interactor

Constructors

Adjuster(Interactor*, int delay = NO_AUTOREPEAT)

Adjuster(const char* instanceName, Interactor*, int delay = NO_AUTOREPEAT)

Adjuster constructors take a pointer to the interactor whose perspective will be adjusted and a delay, (in tenths of a second) after which auto-repeat will begin once the adjuster is pressed. The value NO_AUTOREPEAT disables the auto-repeat feature. A positive value enables the auto-repeat feature, setting the delay to the passed value.

Since Adjuster is an abstract base class, these constructors are protected.

Public Data

static const int NO_AUTOREPEAT = -1;

static const int MoverSize = 12;

static const int ZoomerSize = 24;

Public Operations

virtual void Handle(Event&)

Evaluates the event type and takes appropriate action. If the event type is a DownEvent, then Highlight(true) is called to invert the adjuster and TimerOn() is called to activate the auto-repeat feature. If the event type is an UpEvent, then Highlight(false) is called and TimerOff() is called to turn off the auto-repeat timer.

virtual void Highlight(boolean on)

Highlights or un-highlights the Adjuster based on the value of on (true:highlight, false:un-highlight). Highlight(true) is called when the mouse button is pressed on the adjuster, and Highlight(false) is called when the mouse button is released. By default, the adjuster appears pressed when it is highlighted.

virtual void Reshape(Shape& s)

Sets the natural size, shrinkability and stretchability values for the Shape of the adjuster to the values of the passed shape s.

virtual boolean Traversable()

Always returns false since Adjuster is an abstract base class and cannot be traversed.

Protected Data

int delay

Autorepeat delay in tenths of a second.

boolean highlighted

Used to determine how the adjuster is to be drawn.

Perspective* shown

A pointer to a copy of the associated interactor’s current perspective. This is used to reflect the adjuster’s view of the associated interactor’s perspective. shown is used to compute new perspective values which are then passed to the associated interactor by calling its Adjust() member function.

int size

Stores the width and height of the adjuster’s shape.

boolean timer

Stores the setting specified by the TimerOn() and TimerOff() operations. If timer is true, the delay is used when autorepeating.

Interactor* view

Pointer to the associated interactor.

Protected Operations

virtual void AdjustView(Event&)

Defines how the adjuster changes the interactor’s perspective. It is called after the adjuster is pressed and released, or called repeatedly during auto-repeat. Derived classes should redefine this function to implement the desired behavior.

void AutoRepeat()

Performs the auto-repeat feature, adjusting the view on the perspective while the mouse button is held down on the adjuster.

void Flash()

Flashes the highlight of the adjuster by calling Highlight(false) followed by Highlight(true).

void HandlePress()

Handles calling the AutoRepeat() function. Monitors enter and leave events in the adjuster so auto-repeat can be turned off if the mouse leaves the adjuster and turned back on when the mouse enters the adjuster. Called after a DownEvent in the adjuster.

void TimerOff()

Tells the adjuster that no delay should be used in the auto-repeat function.

void TimerOn()

Tells the adjuster that a delay value greater than 0 has been passed to the constructor which should be used in timing the auto-repeat function.

X Resources

None.

Examples

No example for this abstract base class. See Mover(3X) and Zoomer(3X) for examples.

Files


adjuster.h
adjuster.C

See Also

Interactor(3X) , Mover(3X) , Perspective(3X) , Zoomer(3X) .


Table of Contents