
BBjListBox
Description
The BBjListBox object provides methods for manipulating a GUI listbox control.
Implemented Interfaces
DragSource, DropTarget, Editable, Focusable, MouseWheelEnabled, RecordSetBindable,RecordSetFillable,Scrollable, SimpleRecordSetBindable,TabTraversable, TextAlignable,Validateable
Creation
BBjAPI > BBjSysGui > BBjWindow > BBjListBox
A BBjListBox object is created through the following BBjWindow methods:
Return Value |
Method |
BBjListBox |
addListBox(int ID, int x, int y, int width, int height, string initialContents) |
BBjListBox |
addListBox(int ID, int x, int y, int width, int height, string initialContents, string flags) |
Methods of BBjListBox
Return Value |
Method |
void |
addItem(string item) |
void |
|
void |
deselectIndex(int index) |
string |
getItemAt(int index) |
int |
|
boolean |
|
int |
|
void |
insertItemAt(int index, string item) |
void |
insertItems(int index, BBjVector itemVector!) |
void |
insertItems(int index, string items$) |
boolean |
|
void |
|
void |
removeItemAt(int index) |
void |
selectIndex(int index) |
void |
setEditable(boolean edit) |
void |
setImageAt(int index, BBjImage image!) |
void |
setMultipleSelection(int multi) |
void |
setSelectedIndices(BBjVector itemVector!) |
void |
setTextAt(int index, string text) |
Methods of BBjListBox implemented for DragSource
Return Value |
Method |
int |
|
string |
|
void |
setDragActions(int actions) |
void |
setDragType(string type) |
Methods of BBjListBox implemented for DropTarget
Return Value |
Method |
int |
|
void |
setDropActions(int actions) |
void |
setDropTypes(BBjVector types) |
Methods of BBjListBox implemented for Editable
Return Value |
Method |
boolean |
|
void |
setEditable(boolean p_edit) |
Methods of BBjListBox implemented for Focusable
Return Value |
Method |
boolean |
|
void |
setFocusable(boolean p_focus) |
Methods of BBjListBox implemented for MouseWheelEnabled
Return Value |
Method |
int |
|
void |
setScrollWheelBehavior(int trav) |
Methods of BBjListBox implemented for RecordSetBindable
Return Value |
Method |
void |
bindRecordSet(BBjRecordSet recordset, string fieldname) |
string |
Methods of BBjListBox implemented for RecordSetFillable
Return Value |
Method |
void |
fillFromRecordSet(BBjRecordSet recordset, string fieldname) |
Methods of BBjListBox implemented for Scrollable
Return Value |
Method |
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
boolean |
|
boolean |
|
void |
setHorizontalScrollBarPosition(int position) |
void |
setVerticalScrollBarPosition(int position) |
Methods of BBjListBox implemented for SimpleRecordSetBindable
Return Value |
Method |
void |
Methods of BBjListBox implemented for TabTraversable
Return Value |
Method |
boolean |
|
void |
setTabTraversable(boolean trav) |
Methods of BBjListBox implemented for TextAlignable
Return Value |
Method |
int |
getAlignment() |
void |
setAlignment(int p_align) |
Methods of BBjListBox implemented for Validateable
Return Value |
Method |
void |
accept(boolean valid) |
string |
Methods of BBjListBox inherited from BBjControl
Events
Callback Code |
Object-oriented Event |
Read Record Event |
Code |
ON_CONTROL_SCROLL |
p |
||
ON_CONTROL_VALIDATION |
v |
||
ON_DROP_TARGET_DROP |
D |
||
ON_GAINED_FOCUS |
f |
||
ON_LIST_CLICK |
l (lower case L) |
||
ON_LIST_DOUBLE_CLICK |
l (lower case L) |
||
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 BBjListBox defines the following style names:
.BBjListBox (the top level control)
.BBjListBox-item (an individual item within the list)
.BBjListBox-item.bbj-selected (a selected item)
.BBjListBox.bbj-disabled (the control is disabled)
.BBjListBox.bbj-focused (the control is focused)
.BBjListBox.bbj-readonly (the control is read only)
This section uses the list sample from the BBj BUI Showcase (code, demo).
With the default styles, the BBjListBox looks like this:
With the styles shown below, it looks like this:
.BBjListBox { border-top-left-radius: 10px; border-bottom-left-radius: 10px; overflow-x: hidden !important; background: #f2f5f6 !important; /* Old browsers */ background: -moz-linear-gradient(top, #f2f5f6 0%, #e3eaed 37%, #c8d7dc 100%) !important; /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f2f5f6), color-stop(37%,#e3eaed), color-stop(100%,#c8d7dc)) !important; /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #f2f5f6 0%,#e3eaed 37%,#c8d7dc 100%) !important; /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #f2f5f6 0%,#e3eaed 37%,#c8d7dc 100%) !important; /* Opera 11.10+ */ background: -ms-linear-gradient(top, #f2f5f6 0%,#e3eaed 37%,#c8d7dc 100%) !important; /* IE10+ */ background: linear-gradient(to bottom, #f2f5f6 0%,#e3eaed 37%,#c8d7dc 100%) !important; /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f2f5f6', endColorstr='#c8d7dc',GradientType=0 ) !important; /* IE6-9 */ } .BBjListBox-item { } .BBjListBox-item:hover { font-size: 24px; color: white !important; background: #1e5799 !important; /* Old browsers */ background: -moz-linear-gradient(top, #1e5799 0%, #2989d8 50%, #207cca 51%, #7db9e8 100%) !important; /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1e5799), color-stop(50%,#2989d8), color-stop(51%,#207cca), color-stop(100%,#7db9e8)) !important; /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%) !important; /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%) !important; /* Opera 11.10+ */ background: -ms-linear-gradient(top, #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%) !important; /* IE10+ */ background: linear-gradient(to bottom, #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%) !important; /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=0 ) !important; /* IE6-9 */ } |
Remarks
None.
Constants inherited from BBjControl
Example
REM Add a list box control to a window |
See Also
LISTBOX Mnemonic - Create a List Box Control
CALLBACK Verb - Register BBj Subroutine
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.