BBjCEdit

Description

In BBj 5.00 and higher, the BBjCEdit object provides methods for manipulating a GUI CEdit control.

Implemented Interfaces

DragSource, DropTarget, Editable, Focusable, MouseWheelEnabled, RecordSetBindable,Scrollable.SimpleRecordSetBindable,TabTraversable,TextControl,Validateable,

Creation

BBjAPI > BBjSysGui > BBjWindow > BBjCEdit

A BBjCEdit object is created through the following BBjWindow methods:

Return Value

Method

BBjCEdit

addCEdit(int ID, number x, number y, number w, number h, string title)

BBjCEdit

addCEdit(int ID, number x, number y, number w, number h, string title, string flags)

BBjCEdit

addCEdit(int ID, string title)

BBjCEdit

addCEdit(int ID, string title, String flags)

BBjCEdit

addCEdit(string title)

BBjCEdit

addCEdit(string title, String flags)

Methods of BBjCEdit

Return Value

Method

void

addParagraph(int index, string paragraph)

void

addParagraphs(int index, BBjVector paragraphs!)

void

appendToParagraph(int parNum, string text)

BBjVector

getAllParagraphs()

int getCurrentParagraphIndex()

boolean

getDrawBorder()

boolean

getHorizontalScrollable()

boolean

getIgnoreEnters()

boolean

getIgnoreTabs()

boolean

getLimitToOneParagraph()

int

getLineCountLimit()

boolean

getLineWrap()

int

getMaxParagraphSize()

int

getMaxLength()

int

getNumberOfParagraphs()

boolean

getOvertypeMode()

string

getParagraph(int parNum)

BBjVector

getSelection()

int

getTabSize()

boolean

getVerticalScrollable()

boolean

getWrapStyleWord()

void

highlight(int parIndex1, int off1, int parIndex2, int off2)

boolean

isEditable()

void

removeAll()

void

removeParagraph(int parIndex)

void

setDrawBorder(boolean draw)

void

setEditable(boolean editable)

void

setHorizontalScrollable(boolean scroll)

void

setIgnoreEnters(boolean ignore)

void

setIgnoreTabs(boolean ignore)

void

setLimitToOneParagraph(boolean limit)

void

setLineCountLimit(int limit)

void

setLineWrap(boolean wrap)

void

setMaxParagraphSize(int size)

void

setMaxLength(int length)

void

setOvertypeMode(boolean overtype)

void

setTabSize(int size)

void

setVerticalScrollable(boolean scroll)

void

setWrapStyleWord(boolean word)

Methods of BBjCEdit implemented for DragSource

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

Methods of BBjCEdit implemented for DropTarget

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

Methods of BBjCEdit implemented for Editable

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

Methods of BBjCEdit implemented for Focusable

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

Methods of BBjCEdit implemented for RecordSetBindable

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

Methods of BBjCEdit implemented for Scrollable

Return Value Method
int getHorizontalScrollBarHeight()
int getHorizontalScrollBarPosition()
int getHorizontalScrollBarWidth()
int getVerticalScrollBarHeight()
int getVerticalScrollBarPosition()
int getVerticalScrollBarWidth()
boolean isHorizontalScrollBarVisible()
boolean isVerticalScrollBarVisible()
void setHorizontalScrollBarPosition(int position)
void setVerticalScrollBarPosition(int position)

Methods of BBjCEdit implemented SimpleRecordSetBindable

Return Value Method
BBjRecordSet getBoundRecordSet()
void unbindRecordSet()

Methods of BBjCEdit implemented for TabTraversable

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

Methods of BBjCEdit 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 BBjCEdit implemented for MouseWheelEnabled

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

Methods of BBjCEdit implemented for Validateable

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

ClosedMethods of BBjButton inherited from BBjControl

Events

Callback Code

Object-oriented Event

Read Record Event

Code

ON_CONTROL_SCROLL

BBjControlScrollEvent

Scrollbar Move Event

p

ON_CONTROL_VALIDATION

BBjControlValidationEvent

Control Validation Event

v

ON_DROP_TARGET_DROP

BBjDropTargetDropEvent

Drop Target Drop Event

D

ON_EDIT_KEYPRESS (BBj 24.10 and higher) 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 BBjCEdit is implemented as a <textarea> element. It defines the following styles:

.BBjCEdit

.BBjCEdit.bbj-bordered

.BBjCEdit.bbj-disabled

.BBjCEdit.bbj-focused

.BBjCEdit.bbj-readonly

To modify the optional border:

.BBjCEdit.bbj-bordered
{
  border: 1px solid #7f9db9;
}

By default, the BUI BBjCEdit is not user-resizable because resizing it can conflict with other controls on the page. That option can be added like this:

.BBjCEdit
{
  resize: both;
}

Remarks

In BBj 10 and higher, the BBjCEdit honors the documented $0004$ flag ("Draws a border around the control"). This flag was previously ignored in BBj, so some applications didn't set it, even if they wanted borders. Set the CEDIT_BORDER !COMPAT setting to TRUE to show borders around all CEDIT controls, regardless of the state of the $0004$ flag.

ClosedConstants inherited from BBjControl

Example

rem 'Add a custom 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 button on the window
myCEdit! = myWindow!.addCEdit(101,50,100,90,30,"",$0008$)

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

rem 'Process Events
process_events

rem 'Callback routine called when the contents of the CEDIT box are modified
CEDIT_MODIFIED:
    rem 'Display a message with the CEdit contents
    MESSAGE$ = "The CEdit contents are: " + STR(myCEdit!.getText())
    let X = MSGBOX(MESSAGE$)
return

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

ClosedVersion History

  • BBj 24.10: Added support for ON_EDIT_KEYPRESS BBjEditKeypressEvent.
  • BBj 5.00: BBjCEdit added.

See Also

BBjAPI

BBjSysGui

BBjWindow

CEDIT Mnemonic - Create Multi-Line Text Edit Control

CALLBACK Verb - Register BBj Subroutine

DWC Component: dwc-textarea

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