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

Name

Mover, LeftMover, RightMover, UpMover, DownMover - interactors for incremental scrolling

Synopsis

#include <ivplus/adjuster.h>

Description

Mover provides an incremental movement of a perspective in one of four directions: left, right, up or down. When displayed, the mover looks like an arrowhead (left arrow, right arrow, up arrow and down arrow). The user clicks on the mover with the mouse to move the perspective. Movers are used in scrollbars.

The relationship between the scrollbar mover components and the perspective of the subject interactor is not a subject-view. Each mover maintains a pointer to the associated interactor’s perspective solely to enable the mover to request the interactor to update its perspective. The movers do not need to know when the associated interactor’s perspective actually changes.

Mover is an abstract base class.

Class Hierarchy

Mover -> Adjuster -> Interactor

Constructors

DownMover(Interactor*, int delay = NO_AUTOREPEAT, int size = MoverSize, Painter* bg = nil)

DownMover(const char* instanceName, Interactor*, int delay = NO_AUTOREPEAT, int size = MoverSize, Painter* bg = nil)

LeftMover(Interactor*, int delay = NO_AUTOREPEAT, int size = MoverSize, Painter* bg = nil)

LeftMover(const char* instanceName, Interactor*, int delay = NO_AUTOREPEAT, int size = MoverSize, Painter* bg = nil)

RightMover(Interactor*, int delay = NO_AUTOREPEAT, int size = MoverSize, Painter* bg = nil)

RightMover(const char* instanceName, Interactor*, int delay = NO_AUTOREPEAT, int size = MoverSize, Painter* bg = nil)

UpMover(Interactor*, int delay = NO_AUTOREPEAT, int size = MoverSize, Painter* bg = nil)

UpMover(const char* instanceName, Interactor*, int delay = NO_AUTOREPEAT, int size = MoverSize, Painter* bg = nil)

Create an instance of a Mover object.

The passed Interactor* is a pointer to the associated interactor whose perspective will be moved.

The delay value is the delay, in tenths of a second, after which the auto-repeat feature of the mover will begin, once the mover is pressed. The left, right, up and down movers default to using a value of NO_AUTOREPEAT.

The size value specifies the height and width in pixels of the mover’s shape. The left, right, up and down movers default to using a value of MoverSize.

The bg value is a pointer to the Painter to use for drawing on the perspective’s canvas. The default value of bg is nil, in which case a Painter* will be created by the mover for its use.

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

Public Data

static const int MoverSize = 12;

Dimension, in pixels, of the mover’s shape. By default, a mover’s shape is MoverSize*MoverSize pixels.

typedef enum MoveType { MoveLeft, MoveRight, MoveUp, MoveDown, MoveUndef };

Specifies the kind of mover when instantiating Mover rather than one of its subclasses. The appearance and behavior of a mover created with type MoveUndef is undefined.

static const int NO_AUTOREPEAT = -1

The NO_AUTOREPEAT value is the default value for the auto repeat feature. The auto repeat feature is activated when the mover is pressed and held. After waiting a specified delay time, the mover continues to move the perspective until it is released. The delay value represents the length of time, in tenths of a second, to wait before activating auto repeat. The default value of NO_AUTOREPEAT disables the auto repeat feature.

Public Operations

void Adjuster::Handle(Event&)

Evaluates the event type and take appropriate action. If the event type is a DownEvent, then Highlight(true) is called to invert the mover 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 Adjuster::Highlight(boolean on)

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

void Adjuster::Reshape(Shape&)

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

Protected Data

int moveType

Stores the kind of mover this instance is.

Painter* bg

Stores the painter to use when the mover draws itself.

Protected Operations

void AdjustView(Event&)

Changes the interactor’s perspective. This is called after the mover is pressed and released, or called repeatedly during auto-repeat. If the Shift Key is pressed, the perspective is adjusted in large increments, otherwise it is adjusted in small increments.

void Adjuster::AutoRepeat()

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

void Adjuster::Flash()

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

void Adjuster::HandlePress()

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

Mover(Interactor*, int delay, int moveType, int size, Painter* bg)

Mover (const char* instanceName, Interactor*, int delay, int moveType, int size, Painter* bg)

virtual void Reconfig()

Set the width and height of the mover’s shape and check the status of the mover’s Painter bg. If bg is nil, bg is set to the default Painter, output.

virtual void Redraw(IntCoord l, IntCoord b, IntCoord r, IntCoord t)

Called when some portion of the mover needs to be redrawn, presumably because it was previously obscured or it has been pressed. If the mover is highlighted (pressed), the mover is drawn with the pressed in appearance. If the mover is not highlighted, it is drawn with its normal appearance. The mover evaluates which type of mover it is (left, right, up or down) and draws the appropriate shape (left arrow, right arrow, up arrow and down arrow).

void Adjuster::TimerOn()

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

void Adjuster::TimerOff()

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

X Resources

None.

Examples

No example for this abstract base class. See Adjuster(3X) for examples.

Files


adjuster.h
adjuster.C

See Also

Adjuster(3X) , Interactor(3X) , Perspective(3X) , Shape(3X) .


Table of Contents