BBjEditBox

Description

The BBjEditBox object provides methods for manipulating a GUI edit box control.

Implemented Interfaces

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

In BBj 12.0 and higher, removed MouseWheelEnabled

Creation

A BBjEditBox object is created through the following BBjWindow methods:

BBjAPI > BBjSysGui > BBjWindow > BBjEditBox

Return Value

Method

BBjEditBox

addEditBox(int ID, number x, number y, number width, number height, string title)

BBjEditBox

addEditBox(int ID, number x, number y, number width, number height, string title, string flags)

BBjEditBox

addEditBox(int ID, number x, number y, number width, number height, string title, string flags, string type)

BBjEditBox

addEditBox(int ID, String title)

BBjEditBox

addEditBox(int ID, String title, String flags)

BBjEditBox

addEditBox(int ID, String title, String flags, string type)

BBjEditBox

addEditBox(String title)

BBjEditBox

addEditBox(String title, String flags)

BBjEditBox

addEditBox(String title, String flags, string type)

Methods of BBjEditBox

Return Value

Method

string

getEditType()

int

getMaxLength()

boolean

getPassHomeDelete()

string

getSelectedText()

BBjVector

getSelection()

boolean

isEditable()

boolean

isPasswordVisible()

void

select(int offset1, int offset2)

void

setEditable(boolean edit)

void

setMaxLength(int length)

void

setPassHomeDelete(boolean pass)

void

setPasswordVisible(boolean visible)

Methods of BBjEditBox implemented for DragSource

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

Methods of BBjEditBox implemented for DropTarget

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

Methods of BBjEditBox implemented for Editable

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

Methods of BBjEditBox implemented for Focusable

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

Methods of BBjEditBox implemented for RecordSetBindable

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

Methods of BBjEditBox implemented for SimpleRecordSetBindable

Return Value Method
BBjRecordSet getBoundRecordSet()
void unbindRecordSet()

Methods of BBjEditBox implemented for TabTraversable

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

Methods of of BBjEditBox implemented 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 BBjEditBox implemented for TextAlignable

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

Methods of BBjEditBox implemented for Validateable

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

Methods of BBjEditBox 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

N (Notify code 1)

ON_EDIT_MODIFY

BBjEditModifyEvent

Edit Control Modify Event

e

ON_GAINED_FOCUS

BBjGainedFocusEvent

Control Focus Gained/Lost Event

f

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.

The BBjEditBox is implemented as either an <input type="text"> element or an <input type="password"> element, depending on whether the password style is specified on creation. It defines the following style names:

.BBjEditBox (primary style name)

.BBjEditBox.bbj-disabled (edit box is disabled)

.BBjEditBox.bbj-focused (edit box is focused)

.BBjEditBox.bbj-readonly (edit box is readonly)

.BBjEditBox.bbj-password (password-style edit box)

Remarks

None.

Constants inherited from BBjControl

Example

rem 'Add an edit box 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 edit box on the window
myEditBox! = myWindow!.addEditBox(101,50,100,90,30,"",$0008$)

rem 'Register the CALLBACK routines
CALLBACK(ON_EDIT_MODIFY,EDIT_BOX_MODIFIED,mySysGui!.getContext(),myEditBox!.getID())
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

rem 'Process Events
process_events

rem 'Callback routine called when the contents of the Edit Box are modified
EDIT_BOX_MODIFIED:
    rem 'Display a message with the edit box contents
    MESSAGE$="The edit box contents are: " + STR(myEditBox!.getText())
    let X = MSGBOX(MESSAGE$)
return

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

See Also

BBjAPI

BBjSysGui

BBjWindow

EDIT Mnemonic - Create An Edit Control

CALLBACK Verb - Register BBj Subroutine

DWC Component: dwc-field

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