BBjNavigator
Description
In BBj 4.00 and higher, the BBjNavigator object provides methods for manipulating a GUI navigator control. The Navigator panel contains four buttons – "|<" (First), "<" (Previous), ">" (Next) and ">|" (Last). Clicking on the buttons fires events that can be handled based on the needs of the application.
Implemented Interfaces
DropTarget, Editable, Focusable, MouseWheelEnabled, RecordSetBindable,SimpleRecordSetBindable,TabTraversable
Creation
BBjAPI > BBjSysGui > BBjWindow > BBjNavigator
A BBjNavigator object is created through the following BBjWindow methods:
|
Return Value |
Method |
|---|---|
|
BBjNavigator |
addNavigator(int ID, number x, number y, number w, number h, string title) addNavigator(int ID, number x, number y, number w, number h, string title, string flags) addNavigator(int ID, string title) addNavigator(int ID, string title, string flags) addNavigator(string title) addNavigator(string title, 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 BBjNavigator
|
Return Value |
Method |
|---|---|
|
boolean |
|
|
void |
setButtonWidth(int width) |
|
void |
setEditable(boolean editable) |
Methods Implemented for Interfaces
Events
|
Callback Code |
Object-oriented Event |
Read Record Event |
Code |
|---|---|---|---|
|
ON_DROP_TARGET_DROP |
D |
||
|
ON_GAINED_FOCUS |
f |
||
|
ON_LOST_FOCUS |
f |
||
|
ON_MOUSE_ENTER |
E |
||
|
ON_MOUSE_EXIT |
E |
||
|
ON_NAV_FIRST |
N (Notify code 1) |
||
|
ON_NAV_LAST |
N (Notify code 4) |
||
|
ON_NAV_NEXT |
N (Notify code 3) |
||
|
ON_NAV_PREVIOUS |
N (Notify code 2) |
||
|
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.
Refer to this very simple BBjNavigator program for reference:
|
With the default CSS styles, the BBjNavigator looks like this:
The BBjNavigator defines the following style names:
.BBjNavigator (The top level style)
.BBjNavigator-first (The "first" button)
.BBjNavigator-previous (The "previous" button)
.BBjNavigator-label (The label in the middle)
.BBjNavigator-next (The "next" button)
.BBjNavigator-last (The "last" button)
.BBjNavigator.bbj-disabled (Navigator is disabled)
.BBjNavigator.bbj-focused (Navigator is focused)
.BBjNavigator.bbj-readonly (Navigator is read-only)
The following CSS applies a green gradient to the Navigator:
|
With those custom CSS styles, the Navigator looks like this:
Remarks
Mobile touch-oriented browsers (e.g. Mobile
Safari in iOS, Chrome in Android) wait for 300 milliseconds after the
user taps an element before generating a click event. This delay makes
applications feel sluggish when the user tries to click on buttons in
rapid sequence. When the FAST_TOUCH_CLICK !OPTIONS setting is set to setting is set to , BUI
navigators on iOS and Android report ON_NAV_FIRST, ON_NAV_LAST, ON_NAV_NEXT
and ON_NAV_PREVIOUS immediately when the user touches and releases
their finger from the corresponding navigator buttons. This improves the
responsiveness for those events, but introduces some side effects that
the developer should be aware of. Because BUI is handling touch events
on these buttons, normal double-tap and pinch-zoom gestures don't work.
And because BUI is reporting the ON_NAV_* events immediately, it appears
in the event stream before the navigator reports gaining focus. Some applications
are sensitive to precise sequence of events.
Constants inherited from BBjControl
Example
|
See Also
CALLBACK Verb - Register BBj Subroutine
DWC Component: dwc-navigator
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.