BBjScrollBar
Description
The BBjScrollBar object provides methods for manipulating a GUI scroll bar control.
Note: The BBjScrollBar is a standalone BBjControl that should not be confused with scroll bars that can be created with optional flags on windows, child windows, or edit-type controls.
To enable scrolling behavior in a window, horizontal or vertical scrollbars must be enabled and tracking must be turned off. Use the window creation flags $00000004$ (horizontal scrolling) or $00000008$ (vertical scrolling), and set tracking to 0 with window creation flag $80000000$, BBjWindow::setTrack, or the TRACK Mnemonic - Toggle Tracking On/Off (SYSGUI).
Implemented Interfaces
DropTarget, Focusable, MouseWheelEnabled, TabTraversable
Creation
BBjAPI > BBjSysGui > BBjWindow > BBjScrollBar
A BBjScrollBar object is created through the following BBjWindow methods:
|
Return Value |
Method |
|---|---|
|
addHorizontalScrollBar(int ID) addHorizontalScrollBar(int ID, number x, number y, number width, number height) addHorizontalScrollBar( int ID, number x, number y, number width, number height, string flags) addHorizontalScrollBar(int ID, string flags) addHorizontalScrollBar(string flags) |
|
|
addVerticalScrollBar(int ID) addVerticalScrollBar(int ID, number x, number y, number width, number height) addVerticalScrollBar(int ID, number x, number y, number width, number height, string flags) addVerticalScrollBar(int ID, string flags) addVerticalScrollBar(string flags) |
Creation Flags
| Flag | Description |
|---|---|
| $0001$ | Sets the control to be initially disabled. |
| $0010$ | Sets the control to be initially invisible. |
| $0800$ | Draws a recessed client edge around the control. |
| $1000$ | Draws a raised edge around the control. |
Methods of BBjScrollBar
|
Return Value |
Method |
|---|---|
|
int |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void |
setBlockIncrement(int block) |
|
|
setScrollPosition(int pos) |
|
|
setScrollProp(int prop) |
|
|
setScrollRange(int min, int max) |
Methods of BBjScrollBar implemented for DropTarget
| Return Value | Method |
|---|---|
|
int |
|
|
void |
setDropActions(int actions) |
|
void |
setDropTypes(BBjVector types) |
Methods of BBjScrollBar implemented for Focusable
| Return Value | Method |
|---|---|
|
boolean |
|
|
void |
setFocusable(boolean focus) |
Methods of BBjScrollBar implemented for MouseWheelEnabled
| Return Value | Method |
|---|---|
|
int |
|
|
void |
setScrollWheelBehavior(int mode) |
Methods of BBjScrollBar implemented for TabTraversable
| Return Value | Method |
|---|---|
|
boolean |
|
|
void |
setTabTraversable(boolean trav) |
Methods of BBjScrollBar inherited from BBjControl
Events
|
Callback Code |
Object-oriented Event |
Read Record Event |
Code |
|---|---|---|---|
|
ON_CONTROL_SCROLL |
p |
||
|
ON_DROP_TARGET_DROP |
D |
||
|
ON_GAINED_FOCUS |
f |
||
|
ON_LOST_FOCUS |
f |
||
|
ON_MOUSE_ENTER |
E |
||
|
ON_MOUSE_EXIT |
E |
||
|
ON_POPUP_REQUEST |
r |
||
|
ON_RIGHT_MOUSE_DOWN |
R |
CSS
The visual appearance of BUI controls is defined using CSS (cascading style sheets) rules. Easily change the default colors, border, and other settings by customizing these rules, all without changing any application code. See CSS API for a high-level overview of BUI CSS.
The BUI BBjScrollBar defines the following style names:
|
Style Name |
Description |
|---|---|
|
.BBjScrollBar |
The top-level scrollbar control |
|
.BBjScrollBar.bbj-disabled |
The scrollbar when it is disabled |
|
.BBjScrollBar.bbj-horizontal |
A horizontal scrollbar |
|
.BBjScrollBar.bbj-vertical |
A vertical scrollbar |
|
.BBjScrollBar.thumb |
The draggable thumb |
|
.BBjScrollBar.horizontal-thumb |
The thumb of a horizontal scrollbar |
|
.BBjScrollBar-vertical-thumb |
The thumb of a vertical scrollbar |
|
.BBjScrollBar-internal |
The internal scrollbar element |
|
.BBjScrollBar-horizontal-internal |
The internal element of a horizontal scrollbar |
|
.BBjScrollBar-vertical-internal |
The internal element of a vertical scrollbar |
|
.BBjScrollBar-adjusting .BBjScrollBar-thumb |
The thumb while the scrollbar is being adjusted |
Remarks
In BBj 15.00 and higher, BUI implements two
different versions of the BBjScrollBar control. The default version is
supported on all desktop and touch platforms, and can be styled with custom
CSS. An optional version, selected by setting the NATIVE_SCROLLBAR !OPTIONS setting to TRUE, is implemented using a native browser
scrollbar. Because of the way touch platforms implement scrolling, this
native version is not available in touch-oriented browsers like Mobile
Safari on iOS.
Constants inherited from BBjControl
Example
|
See Also
SCROLL Mnemonic - Set Scrolling Attributes
CALLBACK Verb - Register BBj Subroutine
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.