BBjToolButton
Description
The BBjToolButton object provides methods for manipulating a GUI tool button control.
Implemented Interfaces
DragSource, DropTarget, Focusable, Injectable, TabTraversable,TextAlignable
Creation
BBjAPI > BBjSysGui > BBjWindow > BBjToolButton
A BBjToolButton object is created through the following BBjWindow methods:
Return Value |
Method |
---|---|
BBjToolButton |
addToolButton(int ID, number x, number y, number width, number height, string title) |
BBjToolButton |
addToolButton(int ID, number x, number y, number width, number height, string title, string flags) |
BBjToolButton |
addToolButton(int ID, string title) |
BBjToolButton |
addToolButton(int ID, string title, string flags) |
BBjToolButton |
addToolButton(string title) |
BBjToolButton |
addToolButton(string title, string flags) |
Methods of BBjToolButton
Return Value |
Method |
void |
|
boolean |
getBeep() |
int |
|
boolean |
|
int |
|
string |
|
int |
|
int |
|
boolean |
|
int |
|
boolean |
|
boolean |
|
void |
setAlignment(int align) |
void |
setBeep(boolean beep) |
void |
setDisableOnClick(boolean disable) |
void |
setHorizontalTextPosition(int selected) |
void |
|
void |
setImageFile(string file) |
void |
setImageSize(number height, int width) |
void |
setNoEdge(boolean noEdge) |
void |
setSelected(boolean selected) |
void |
setToggleable(boolean toggle) |
void |
setVerticalTextPosition(int selected) |
Methods of BBjToolButton implemented for DragSource
Return Value | Method |
---|---|
int | getDragActions() |
sting | getDragType() |
void | setDragActions(int actions) |
void | setDragType(string type) |
Methods of BBjToolButton implemented for DropTarget
Return Value | Method |
---|---|
int | getDropActions() |
void | setDropActions(int actions) |
BBjVector | getDropTypes() |
void | setDropTypes(BBjVector types) |
Methods of BBjToolButton implemented for Focusable
Return Value | Method |
---|---|
boolean | isFocusable() |
void | setFocusable(boolean focus) |
Methods of BBjButton implemented for Injectable
Return Value | Method |
---|---|
string | getInjectString() |
void | setInjectString(string injectString) |
Methods of BBjToolButton implemented for TabTraversable
Return Value | Method |
---|---|
boolean | isTabTraversable() |
void | setTabTraversable(boolean trav) |
Methods of BBjToolButton implemented for TextAlignable
Return Value | Method |
---|---|
int | getAlignment() |
void | setAlignment(int align) |
Methods of BBjToolButton inherited from BBjControl
Events
Callback Code |
Object-oriented Event |
Read Record Event |
Code |
---|---|---|---|
ON_DROP_TARGET_DROP |
D |
||
ON_GAINED_FOCUS |
f |
||
ON_FORM_VALIDATION |
V |
||
ON_LOST_FOCUS |
f |
||
ON_MOUSE_ENTER |
E |
||
ON_MOUSE_EXIT |
E |
||
ON_POPUP_REQUEST |
r |
||
ON_RIGHT_MOUSE_DOWN |
R |
||
ON_TOOL_BUTTON_PUSH |
b |
The BBjToolButton can be configured to fire the Tool Button Push Event via the right mouse button using the STBL("!COMPAT") key RCLICKTOOLBUTTON.
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 BBjToolButton can act as either a normal button or a click-on/click-off toggle button. It defines the following style names:
.BBjToolButton (the primary class name)
.BBjToolButton.bbj-checked (the toggle button is checked (on))
.BBjToolButton.bbj-disabled (the button is disabled)
.BBjToolButton.bbj-focused (the button is focused)
.BBjToolButton.bbj-toggle (this is a toggle-style tool button)
.BBjToolButton.bbj-transparent (button is set to transparent with setOpaque(0))
Remarks
By default, tool buttons are not focusable
or tab traversable. In BBj 11 and higher, applications that require all
tool buttons to be focusable can set the TBUTTON_FOCUSABLE !COMPAT setting to TRUE. Applications that require all tool buttons
to be tab traversable can set the TBUTTON_TAB_TRAVERSABLE !COMPAT setting to TRUE.
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 multiple buttons in rapid sequence, a process that can be common in applications like phone dialers. When the FAST_TOUCH_CLICK !OPTIONS setting is set to TRUE, BUI tool buttons on iOS and Android report ON_TOOL_BUTTON_PUSH immediately when the user touches and releases their finger from a button. 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_TOOL_BUTTON_PUSH event immediately, it appears in the event stream before the button reports gaining focus. Some applications are sensitive to precise sequence of events.
Constants inherited from BBjControl
Example
|
See Also
BBjConfig::getCompatibilitySetting()
TBUTTON Mnemonic - Create a Tool Button Control
CALLBACK Verb - Register BBj Subroutine
DWC Component: dwc-button
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.