1. The Client Interface
1.1. BiScrollers
The interface BiScrollers.Mesa contains the main client interface to BiScrollers.
There are different user interfaces available for a BiScroller. A BiScrollerStyle represents a user interface. They are accessed by name. If GetStyle is given a NIL name, it will choose a default.
The Cedar Viewers package is organized so that `Viewers' is a class (in the Simula or SmallTalk sense), of which clients can make subclasses (each represented by a ViewerClasses.ViewerClass). `BiScrollers' is a subclass of `Viewers', and it is also prepared for sublcassing (each sublcass is represented by a BiScrollers.BiScrollerClass). A client of BiScrollers typically creates a subclass of `BiScrollers' by calling NewBiScrollerClass, and then creating instances (i.e., actual Viewers) with CreateBiScroller.
A BiScroller is much like a Viewer. It has a PaintProc, a NotifyProc, a tipTable, and so on. The difference is in the scrolling. BiScrollers do not have ViewerClasses.ScrollProcs. The scrolling is almost entirely managed by the BiScrollers package. All the client has to do is provide a way to determine the bounds of its interesting display. This is done with a BiScrollers.ExtremaProc.
A client of BiScrollers uses its own coordinate system. In the PaintProc, the coordinate system of the given Graphics.Context is the client's coordinate system. In the NotifyProc, the element corresponding $Coords in the TIP-table is a BiScrollers.ClientCoords, which is in client coordinates. In the ExtremaProc, the direction is given in client coordinates, and the results should be returned in client coordinates. The BiScrollers implementation manages the relation between the client coordinates and the Viewer's coordinates.
The ExtremaProc is how the client tells BiScrollers the bounds of the area in client coordinates that the client paints in. If a client, in its current state, will paint an area S ‚ R2, and is given a direction vector dir, it should return vmin and vmax such that