The Scroll type
This object is a scrollbar. It is specially designed to interact with a
canvas. The scrollbar allows vertical scrolling when it is positioned in a
row (usually left or right of the canvas), and it allows horizontal
scrolling when it is in a column. The scrollbar should be attached to a
canvas. That canvas can then be queried for its size and origin, so that
the scrollbar can display that info.
The scrollbar normally contains arrows and a bar to indicate the visible
part in the whole. On creation, the designer of the window can choose not
to display that bar (then arrows will then be larger). The minimum and
maximum origins can be set. This will allow the bar to be displayed
accurately and the scrolling can be restricted to stay between these two
extremes. Because the origin may be in any user defined unit, it may be
necessary to provide a routine to convert a size (of the canvas) into the
unit used for the origin of the canvas.
The user can scroll the canvas by indicating (hitting/doing) the scroll
arrows. The designer of the window can set the distances which should be
scrolled in the case of a HIT (minimum scroll distance), or a
DO (maximum scroll distance) on the scroll arrows.
The Type Word
When creating this type of object, the type parameter is:
PW('TYPE_SCROLL')
The tags
Here are the tags for this object.
A creation tag
Use this tag only when creating the object, not when changing it.
- PW('SCROLL_NOBAR')
-
When this tag is encountered on creation of the scroll object, then only
the arrows will exist, and no scrollbar. In the case, the arrow items may
be bigger.
The change (and creation) tags
- PW('SCROLL_CALCSIZE')
-
Set the routine which can be used to calculate the size of the visible area
(the bar), to draw the scrollbar. The parameter should be an action
routine, preferrably
SCROLL_ROUTINE
. The add_info parameter
to the PWactivate call contains the size of the canvas, as a PROforma
number. This should be converted into the size in the metric and type as
used as paramter of PW('SCROLL_MINIMUM')
and
PW('SCROLL_MAXIMUM')
.
- PW('SCROLL_CANVAS')
-
Set the canvas to which this scroll object is linked. The parameter should
should be a canvas object.
- PW('SCROLL_MINIMUM')
-
Set the minimum value for the scrolling. The parameter is a number and can
be in any chosen metric. The scrollbar will not allow you to scroll further
back than this minimum. The metric used should match the metric used as
origin of the canvas. The default minimum is 0.
- PW('SCROLL_MAXIMUM')
-
Set the maximum value for the scrolling. The parameter is a number and can
be in any chosen metric. The scrollbar will not allow you to scroll further
than this maximum. The metric used should match the metric used as origin
of the canvas. The default maximum is 0.
- PW('SCROLL_MINDIST')
-
Set the distance to scroll when the scroll arrow is activated with a HIT.
If the maxdist is not set, it will default to this value as well. If the
distance is negative, the scrolling distance will be (size+mindist).
- PW('SCROLL_MAXDIST')
-
Set the distance to scroll when the scroll arrow is activated with a
DO
. If the mindist is not set, it will default to this value as
well. If the distance is negative, the scrolling distance will be
(size+maxdist).
- PW('SCROLL_SCROLL')
-
Force a scroll without an event on the scroll arrows. The scrolling
distance is passed as parameter. The direction is right/down for positive,
left/up for negative distance. Particularly useful to normalise the
scrollbar after a window scale operation (in this case distance=0).
PROGS, Professional & Graphical Software
last edited 1996 June 05 (wl)