class scrollbar


NAME

scrollbar - Scrollbar

SYNOPSIS

#include "scroll.h"

class scrollbar : public frame

DESCRIPTION

A scrollbar is a construction of two windows. The scrollbar itself and the slider that moves within the scrollbar. The slider can be moved within the scrollbar by dragging the slider with the mouse, or by clicking in the scrollbar on either side of the slider. Whenever the slider is moved, the scrollbar sends a SCROLL_POSITIONED message to its parent window.

Usually, a scrollbar is used together with a window which visualizes data that is too large for that window. The scrollbar enables the user to scroll the data through the window. The slider within the scrollbar represents the portion of the data which is visible in that window. The figure below shows how the dimensions of the scrollbar are defined:

Two sizes are involved in positioning the slider in the scrollbar:

  1. The bar_size, the total size of the scrollbar itself. This represents the total size of the data that is visualized.
  2. The slider_size, the size of the slider. This represents the size of the portion of the data which is visible inside the window.
The position of the slider inside the scrollbar represents the top or the left edge of the visible part of the data, relative to the total size of the data. The position of the slider is limited by the sizes of both the scrollbar and the slider. The position of the slider is limited to the range [0, bar_size - slider_size].

The sizes of the scrollbar and the slider, as well as the position of the slider are defined in logical coordinates, rather than the actual number of pixels of the scrollbar itself. The logical coordinates correspond to the data that is actually being viewed. This may be a number of pixels, but may also be the number of items in a list or the number of lines in a text document. The scrollbar object maps these logical coordinates to physical coordinates on the workstation's screen. Since the bar_size represents the total size of the data being viewed, this size dictates the ratio for the other sizes.
Member Functions
scrollbar Construct a scrollbar object

SEE ALSO

DIAGNOSTICS