
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, int x, int y, int width, int height, string title) |
BBjButton |
addButton(int ID, int x, int y, int width, int height, 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(int width, int height) |
void |
setNoEdge(boolean noEdge) |
void |
setVerticalAlignment(int alignment) |
Methods of BBjButton implemented for DragSource
Return Value |
Method |
---|---|
int |
|
string |
|
void |
setDragActions(int actions) |
void |
setDragType(string type) |
Methods of BBjButton implemented for DropTarget
Return Value |
Method |
---|---|
int |
|
void |
setDropActions(int actions) |
void |
setDropTypes(BBjVector types!) |
Methods of BBjButton implemented for Focusable
Return Value |
Method |
---|---|
boolean |
|
void |
setFocusable(boolean focus) |
Methods of BBjButton implemented for Injectable
Return Value |
Method |
---|---|
string |
|
void |
setInjectString(string injectString) |
Methods of BBjButton implemented for TabTraversable
Return Value |
Method |
---|---|
boolean |
|
void |
setTabTraversable(boolean trav) |
Methods of BBjButton implemented for TextAlignable
Return Value |
Method |
---|---|
int |
|
void |
setAlignment(int p_align) |
Methods of BBjButton inherited from BBjControl
Events
Callback Code |
Object-oriented Event |
Read Record Event |
Code |
ON_BUTTON_PUSH |
B |
||
ON_DROP_TARGET_DROP |
D |
||
ON_FORM_VALIDATION |
V |
||
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 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:
.BBjButton { border-radius: 10px; } |
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
rem ' BBjButton |
See Also
BUTTON Mnemonic - Create a Push Button Control
CALLBACK Verb - Register BBj Subroutine
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.