BBjButton
Description
The BBjButton object provides methods for manipulating a GUI button control.
Implemented Interfaces
DragSource, DropTarget, Focusable, Injectable, TabTraversable,TextAlignable
Creation
BBjAPI > BBjSysGui > BBjWindow > BBjButton
A BBjButton object is created through the following BBjWindow methods:
Return Value |
Method |
---|---|
BBjButton |
addButton(int ID, number x, number y, number w, number h, String title) |
BBjButton |
addButton(int ID, number x, number y, number w, number h, String title, String flags) |
BBjButton | addButton(int ID, String title) |
BBjButton | addButton(int ID, String title, String flags) |
BBjButton | addButton(String title) |
BBjButton | addButton(String title, String flags) |
Methods of BBjButton
Return Value |
Method |
---|---|
void |
|
void |
|
boolean |
getBeep() |
boolean |
|
string |
|
int |
|
int |
|
boolean |
|
int |
|
void |
setBeep(boolean beep) |
void |
setDisableOnClick(boolean disable) |
void |
|
void |
setImageFile(string file) |
void |
setImageSize(number width, int height) |
void |
setNoEdge(boolean noEdge) |
void |
setVerticalAlignment(int alignment) |
Methods of BBjButton implemented for DragSource
Return Value | Method |
---|---|
int | getDragActions() |
sting | getDragType() |
void | setDragActions(int actions) |
void | setDragType(string type) |
Methods of BBjButton implemented for DropTarget
Return Value | Method |
---|---|
int | getDropActions() |
void | setDropActions(int actions) |
BBjVector | getDropTypes() |
void | setDropTypes(BBjVector types) |
Methods of BBjButton 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 BBjButton implemented for TabTraversable
Return Value | Method |
---|---|
boolean | isTabTraversable() |
void | setTabTraversable(boolean trav) |
Methods of BBjButton implemented for TextAlignable
Return Value | Method |
---|---|
int | getAlignment() |
void | setAlignment(int align) |
Methods of BBjButton inherited from BBjControl
BBjButton's DWC Properties , Shadow Parts , Hosted Classes , and CSS Custom Properties
Events
Callback Code | Object-oriented Event | Read Record Event | Code |
---|---|---|---|
ON_BUTTON_PUSH | BBjButtonPushEvent | Push Button Event | B |
ON_DROP_TARGET_DROP | BBjDropTargetDropEvent | Drop Target Drop Event | D |
ON_FORM_VALIDATION | BBjFormValidationEvent | Form Validation Event | V |
ON_GAINED_FOCUS | BBjGainedFocusEvent | Control Focus Gained/Lost Event | f |
ON_LOST_FOCUS | BBjLostFocusEvent | Control Focus Gained/Lost Event | f |
ON_MOUSE_ENTER | BBjMouseEnterEvent | E | |
ON_MOUSE_EXIT | BBjMouseExitEvent | Mouse Enter/Exit Event |
E |
ON_POPUP_REQUEST | BBjPopupRequestEvent | Popup Request Event | r |
ON_RIGHT_MOUSE_DOWN | BBjRightMouseDownEvent | Right Mouse Button Down Event |
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 BBjButton is implemented as a <div> element. It has two variants, .BBjButton.bbj-default, applied to any button with a control ID of 1, and .BBjButton.bbj-cancel, applied to any button with a control ID of 2. The BBjButton defines the following style names:
.BBjButton
.BBjButton.bbj-cancel
.BBjButton.bbj-default
.BBjButton.bbj-disabled
.BBjButton.bbj-focused
.BBjButton.bbj-transparent
There are many different options for styling the BBjButton. One simple choice would be to add rounded borders:
|
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 multiple buttons in rapid sequence, a process that can be common in applications like phone dialers. When the FAST_TOUCH_CLICK !OPTIONSsetting is set to TRUE, BUI buttons on iOS and Android report ON_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_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
BUTTON Mnemonic - Create a Push 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.