BBjListEdit

Description

The BBjListEdit object provides methods for manipulating a GUI list edit control.

Implemented Interfaces

DragSource, DropTarget, Editable, Focusable, MouseWheelEnabled, RecordSetBindable,RecordSetFillable,SimpleRecordSetBindable,TabTraversable, TextAlignable,TextControl,Validateable

Creation

BBjAPI > BBjSysGui > BBjWindow > BBjListEdit

A BBjListEdit object is created through the following BBjWindow methods:

Return Value

Method

BBjListEdit

addListEdit(int ID, number x, number y, number w, number h, string initialContents)

BBjListEdit

addListEdit(int ID, number x, number y, number w, number h, string initialContents, string flags)

BBjListEdit

addListEdit(int ID, string initialContents)

BBjListEdit

addListEdit(int ID, string initialContents, String flags)

BBjListEdit

addListEdit(string initialContents)

BBjListEdit

addListEdit(string initialContents, String flags)

Methods of BBjListEdit

Return Value

Method

void

addItem(string item)

void

closeList()

void

deselect()

BBjVector

getAllItems()

string

getEditText()

int

getFieldHeight()

string

getItemAt(int index)

int

getItemCount()

void

getOpenWidth()

int

getSelectedIndex()

void

insertItemAt(int index, string item)

void

insertItems(int index, BBjVector itemVector!)

void

insertItems(int index, string items$)

boolean

isEditable()

void

openList()

void

removeAllItems()

void

removeItemAt(int index)

void

select(int startIndex, int endIndex)

void

setImageAt(int index, BBjImage image!)

void

selectIndex(int index)

void

setEditable(boolean edit)

void

setEditText(string text)

void

setFieldHeight(int height)

void

setMaximumRowCount(int max)

void

setMaxLength(int length)

void

setOpenWidth(int width)

void

setTextAt(int index, string text)

Methods of BBjListEdit implemented for DragSource

Return Value Method
int getDragActions()
string getDragType()
void setDragActions(int actions)
void setDragType(string type)

Methods of BBjListEdit implemented for DropTarget

Return Value Method
int getDropActions()
void setDropActions(int actions)
BBjVector getDropTypes()
void setDropTypes(BBjVector types)

Methods of BBjListEdit implemented for Editable

Return Value Method
boolean isEditable()
void setEditable(boolean edit)

Methods of BBjListEdit implemented for Focusable

Return Value Method
boolean isFocusable()
void setFocusable(boolean focus)

Methods of BBjListEdit implemented for MouseWheelEnabled

Return Value Method
int getScrollWheelBehavior()
void setScrollWheelBehavior(int trav)

Methods of BBjListEdit implemented for RecordSetBindable

Return Value Method
void bindRecordSet(BBjRecordSet recordset!, string fieldname)
string getBoundFieldName()

Methods of BBjListEdit implemented for RecordSetFillable

Return Value Method
void fillFromRecordSet(BBjRecordSet recordset, string fieldname)

Methods of BBjListEdit implemented for SimpleRecordSetBindable

Return Value Method
BBjRecordSet getBoundRecordSet()
void unbindRecordSet()

Methods of BBjListEdit implemented for TabTraversable

Return Value Method
boolean isTabTraversable()
void setTabTraversable(boolean trav)

Methods of BBjListEdit implemented for TextAlignable

Return Value Method
int getAlignment()
void setAlignment(int align)

Methods of BBjListEdit implemented for TextControl

Return Value Method
void addWord(string word)
int getBottomMargin()
string getCustomDictionary()
BBjColor getDisabledTextColor()
boolean getDragEnabled()
int getHighlightOnFocus()
int getLeftMargin()
string getLocale()
int getMaxSuggestions()
BBjVector getMisspelledWords()
string getPlaceholder()
BBjColor getPlaceholderColor()
int getRightMargin()
BBjColor getSpellCheckColor()
string getSpellCheckLanguage()
boolean getSpellCheckOption(int option)
BBjVector getSuggestions(string word)
int getTopMargin()
void ignoreWord(string word)
boolean isMisspelled(string word)
boolean isSpellChecked()
void removeWord(string word)
void setBottomMargin(int margin)
void setCustomDictionary(string filename)
void setDisabledTextColor(BBjColor color!)
void setDragEnabled(boolean enabled)
void setHighlightOnFocus(int behavior)
void setLeftMargin(int margin)
void setLocale(string locale)
void setMaxSuggestions(int count)
void setPlaceholder(string placeholder)
void setPlaceholderColor(BBjColor color!)
void setRightMargin(int margin)
void setSpellCheckColor(BBjColor color!)
void setSpellChecked(boolean check)
void setSpellCheckLanguage(string language)
void setSpellCheckOption(int option, boolean value)
void setTopMargin(int margin)

Methods of BBjListEdit implemented for Validateable

Return Value Method
void accept(boolean valid)
string getValidationText()

Methods of BBjListEdit inherited from BBjControl

Events

Callback Code

Object-oriented Event

Read Record Event

Code

ON_CONTROL_VALIDATION

BBjControlValidationEvent

Control Validation Event

v

ON_DROP_TARGET_DROP

BBjDropTargetDropEvent

Drop Target Drop Event

D

ON_EDIT_KEYPRESS

BBjEditKeypressEvent

Edit Control Notify Event

N (Notify code 1)

ON_EDIT_MODIFY

BBjEditModifyEvent

Edit Control Modify Event

e

ON_GAINED_FOCUS

BBjGainedFocusEvent

Control Focus Gained/Lost Event

f

ON_LIST_CANCEL

BBjListCancelEvent

List Button and List Edit Notify Events

N (Notify code 4)

ON_LIST_CHANGE

BBjListChangeEvent

List Button and List Edit Notify Events

N (Notify code 5)

ON_LIST_CLICK

BBjListClickEvent

List Item Click Event

l (lower case L)

ON_LIST_CLOSE

BBjListCloseEvent

List Button and List Edit Notify Events

N (Notify code 3)

ON_LIST_OPEN

BBjListOpenEvent

List Button and List Edit Notify Events

N (Notify code 1)

ON_LIST_SELECT

BBjListSelectEvent

List Button and List Edit Notify Events

N (Notify code 2)

ON_LOST_FOCUS

BBjLostFocusEvent

Control Focus Gained/Lost Event

f

ON_MOUSE_ENTER

BBjMouseEnterEvent

Mouse Enter/Exit Event

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

BUI logoCSS

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.

In BBj 13.0 and higher, the default BUI BBjListEdit is implemented as a custom control, to allow for CSS styling that isn't possible with native browser select elements. The native browser select elements provide a better user experience on mobile phone and tablet browsers; this option can be set to TRUE to specify that style.

The native listedit is really a hybrid -- it combines a text box with a native browser select element. It defines the following style names:

Style Name Description
.BBjListEdit.bbj-native The top level control.
.BBjListEdit-text The text input area, taking up most of the width of the control.
.BBjListEdit-list The list portion, taking up just enough space to the right of the control to show a dropdown arrow.

The custom listbutton defines the following style names:

Style Name Description
.BBjListEdit The top level control.
.BBjListEdit-text The text input area, taking up most of the width of the control.
.BBjListEdit-button The button on the right edge of the control, showing a dropdown arrow.
.BBjListEdit-imageWrapper The right side of the button, which contains the dropdown arrow.
.BBjListEdit-image The dropdown arrow image.
.BBjListEdit-listPanel The dropdown container for the list.
.BBjListEdit-listBox The dropdown list.
.BBjListEdit-item An individual item in the dropdown list.
.BBjListEdit-item.bbj-selected The selected item.
.BBjListEdit.bbj-disabled The control is disabled.
.BBjListEdit.bbj-focused The control is focused.
.BBjListEdit.bbj-readonly The control is readonly.

This section uses the list sample from the BBj BUI Showcase (code, demo).

With the default styles, the custom BBjListButton looks like this:

With the styles shown below, it looks like this:

.BBjListButton, .BBjListButton-button, .BBjListEdit-button

{

  color: white !important;

  box-shadow: 2px 2px 5px hsla(0,0%,0%,.7);

  text-shadow: 0px 0px 1px hsla(0,0%,0%,.8);

  border-radius: 5px;

  background: navy !important;

  background-image: -webkit-radial-gradient(160% 100% at 50% 0% ,hsla(0,0%,100%,.3) 50%,hsla(0,0%,100%,0) 52%) !important;

  background-image: radial-gradient(160% 100% at 50% 0% ,hsla(0,0%,100%,.3) 50%,hsla(0,0%,100%,0) 52%) !important;

  overflow: hidden;

}

.BBjListEdit

{

  border-radius: 5px;

}

.BBjListEdit-button

{

  border-width: 0px;

}

.BBjListButton-image, .BBjListEdit-image

{

  border-top-color: white;

}

.BBjListButton-listBox, .BBjListEdit-listBox

{

  overflow-x: hidden !important;

  box-shadow: 2px 2px 5px hsla(0,0%,0%,.7);

See STBL("!OPTIONS","NATIVE_BROWSER_LIST")

Remarks

None.

Constants inherited from BBjControl

Example

rem 'Add a list edit control to a window

rem 'Obtain the instance of the BBjAPI object
let myAPI! = BBjAPI()

rem 'Open the SysGui device
SYSGUI = UNT
OPEN (SYSGUI) "X0"

rem 'Obtain the instance of the BBjSysGui object
let mySysGui! = myAPI!.getSysGui()

rem 'Set addWindow param values
X = 10
Y = 10
WIDTH = 200
HEIGHT = 200
TITLE$ = "BBj Window"

rem 'Set the current context
mySysGui!.setContext(0)

rem 'Create a window
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$)

rem 'Add a list edit control to the window
myListEdit! = myWindow!.addListEdit(101,50,100,90,60,"",$0000$)

rem 'Add items into the list edit
FOR I = 1 TO 4
    ITEM$ = "ITEM " + STR(I)
    myListEdit!.addItem(ITEM$)
NEXT I

rem 'Register the CALLBACK routines
CALLBACK(ON_LIST_SELECT,LIST_ITEM_SELECTED,mySysGui!.getContext(),myListEdit!.getID())
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

rem 'Process Events
process_events

rem 'Callback routine called when the user selects an item in the list edit control
LIST_ITEM_SELECTED:
    rem 'Display a message with the select list edit item
    MESSAGE$ = "The item selected is: " + STR(myListEdit!.getItemAt(myListEdit!.getSelectedIndex()))
    let X = MSGBOX(MESSAGE$)
return

rem 'Callback routine called when the user closes the application window
APP_CLOSE:
release

See Also

BBjAPI

BBjSysGui

BBjWindow

LISTEDIT Mnemonic - Create a List Edit Control

CALLBACK Verb - Register BBj Subroutine

DWC Component: dwc-combobox

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.