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

Name

Perspective - describes the visible portion of an interactor

Synopsis

#include <ivplus/perspective.h>

Description

perspective describes which part of an interactor’s total displayable data is visible in the interactor’s canvas. The main use of perspectives is for scrolling, panning, and zooming interactors. The member variables <x0, y0> define the origin of the interactor’s display area; width and height define the total height of the available data. The member variables <curx, cury> define the lower-left corner portion of the interactor’s canvas in which the data will be displayed. <curx, cury> is relative to <x0, y0>. curwidth and curheight define how much of the total area is displayed in the canvas.

The member variables sx, sy, lx, and ly specify small and large increments in each dimension. These increments are used by scrollers and movers to implement line and page scrolling. The large increments are generally set to the size of one page. A page is usually the amount of data that can be displayed in the canvas at any particular time. Some interactors, such as lists and text editors define a page such that it allows an overlap of one small increment. This is useful when scrolling text.

MList, MEditor and its derived classes are examples of interactors which maintain a perspective.

Class Hierarchy

Perspective->Resource

Constructors

Perspective()

Defines a new perspective with all member variables initialized to zero.

Perspective(Perspective& p)

Defines a new perspective with all member variables initialized to the same values as those in the passed Perspective.

Public Data

IntCoord x0, y0

Origin of the viewable data.

int width, height

Total size of the viewable data.

IntCoord curx, cury

Current position of the view, relative to <x0, y0>.

int curwidth, curheight

Current size of the view.

int sx, sy

Small scrolling increments.

int lx, ly

Large scrolling increments.

Public Operations

void Attach(Interactor*)

Adds to the list of interactors that are interested in updates to the perspective. Each interactor on the list is considered a view of the perspective. These interactors reflect the perspective visually. Examples include scrollbars and sliders.

void Detach(Interactor*)

Removes an interactor from the list of those interested in updates. This operation should be called from the interactor’s destructor.

void Init(IntCoord x0, IntCoord y0, IntCoord width, IntCoord height)

Initializes the perspective’s display area.

void Update()

Notifies all the interactors interested in the perspective that it has changed.The perspective’s interactor should call Update() after modifying its perspective.

boolean operator==(Perspective&)

Tests for equality with the passed Perspective.

boolean operator!=(Perspective&)

Tests for inequality with passed Perspective.

Perspective& operator=(Perspective&)

Copies the passed Perspective.

Protected Data

ViewList* views;

The list of interactors interested in the perspective.

Protected Operations

None.

X Resources

None.

Examples

None.

Files


perspective.h

See Also

Adjuster(3X) , Interactor(3X) , Mover(3X) , Panner(3X) , Resource(3X) , Scroller(3X) . ScrollBar(3X) .


Table of Contents