2 Bitmaps, Viewports, and Windows

2.5 Scrolling windows

When a window has scroll bars and is attached to a bitmap that is larger than the window's screen clipping area, the mouse and scroll bars can be used interactively to move the position of the bitmap inside of the window's screen clipping area.

Create a scrolling window with a larger associated bitmap. Note that if you create a scrolling window whose bitmap is the same size as the window's screen clipping area, the scroll bars are present but are not active.

(setq *scrollbitmap* (make-bitmap :width 200 :height 200))
(setq *scrollwindow*
        (make-window :width 100 
                     :height 100 
                     :title "Scroll Window"
                     :scroll t 
                     :bitmap *scrollbitmap*))

(draw-circle *scrollwindow* (make-position 100 100) 100 :width 5)

Each scroll bar is gray and has a lighter bubble, a round shape inside the scroll bar. The location of each bubble in the scroll bar shows which area of the bitmap is being displayed in that direction. If the bubble is at the top of the vertical scroll bar and at the left end of the horizontal scroll bar, the upper left area of the bitmap is displayed.

To scroll the bitmap with the scroll bars, move the mouse over the scroll bar. The mouse cursor changes to a solid block shape when the mouse is in the scroll bar region. A right mouse click moves the bubble to the current mouse position and moves the bitmap inside the scroll window a corresponding amount. Try moving the mouse along the scroll bar and clicking the mouse button at a new location. Hold any mouse button down when the mouse cursor is in the scroll bar region, and move the mouse along the region with the button held down. When you release the mouse button, the bubble and bitmap move to the current mouse position. This procedure is known as dragging the bubble.

The Window Tool Kit - 9 SEP 1996

Generated with Harlequin WebMaker