See Scroller(3X) for a discussion of the relationship between the interactor and the scroller component.
See Mover(3X) for a discussion of the relationship between the associated interactor and the movers.
ScrollBar is an abstract base class. There are two classes derived from ScrollBar: VScrollBar and HScrollBar.
A scrollbar appears to the user to contain three visual areas, an arrow button in each direction, a trough, and a bar which slides along the trough. The bar may slide by increments or pages. An increment is equivalent to the small increment of the associated interactor’s perspective. A page is equivalent to the large increment of the associated interactor’s perspective. A page is generally one screen of data, allowing for an overlap the size of one increment.
An example is an interactor which displays lines of text. The interactor can display 5 lines of text at a time. It can display up to 20 fixed width characters on each line. The interactor would set the increment used by vertical scrollbars to be the height of a single line. The interactor would set the page used by vertical scrollbars to be the height of 4 lines. Vertical scrolling in pages would produce a one line overlap. The interactor would set the increment used by horizontal scrollbars to be the width of a single character. The interactor would set the page used by horizontal scrollbars to be the width of 19 characters. Horizontal scrolling in pages would produce a one character overlap.
The behavior of the scrollbar in response to mouse clicks or drags in the areas of the scrollbar is described in the following table:
Mouse Button | Scroll Bar Area Behavior |
Left Press | |
Left Drag | |
Ctrl Left Press | |
Middle Drag | |
When the bar tracks the position of the mouse pointer in a vertical scrollbar, the y-component of the mouse pointer position is tracked. In a horizontal scrollbar, the x-component of the mouse pointer position is tracked. The components of a scrollbar are not individually traversable, although the scrollbar itself can be traversed. Class HierarchyScrollBar->MonoScene->Scene->Interactor ConstructorsScrollBar(Interactor*,int size);ScrollBar(const char* instanceName, Interactor*, int size)Create a scrollbar with a size of size and associate it with the given interactor. Since ScrollBar is an abstract base class, these constructors are protected. Public Operationsvirtual void Focused(boolean)Calls the Focused() operation of the focus frame which is wrapped around the scrollbar. virtual void Handle(Event&)Handles enter and leave events or displaying the keyboard location cursor when the keyboardFocusPolicy X resource is pointer and the highlightOnEnter resource is True. virtual void Reconfig()Retrieves the X resource scrollbarWidth and stores it in the size data member. virtual boolean Traversable()Returns true if the scrollbar can be traversed by the keyboard traversal mechanism. virtual boolean Traversable(boolean)Sets whether or not this interactor will be traversable by the keyboard traversal mechanism. Protected DataInteractor* interactorPointer to the associated interactor. int sizeStores the width of a vertical scrollbar or the height of a horizontal scrollbar. FocusFrame* focusFramePointer to the focusFrame object used to draw the highlight border. X ResourcesscrollbarWidth :[int]Sets the width (height) of the scrollbar in coordinates. This value is the width of a vertical scrollbar and the height of a horizontal scrollbar. Default Keyboard TranslationsSee VScrollBar(3X) and HScrollBar(3X). ExamplesNo example for this abstract base class. See VScrollBar(3X) and HScrollBar(3X) for examples. Files scrollbar.h scrollbar.C