BBjCEdit

Creation Path


BBjAPI

|

+--BBjSysGui

|

+--BBjWindow

|

+--BBjCEdit

 

Description

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

A BBjCEdit object is created through the following BBjWindow methods:

Return Value

Method

BBjCEdit

addCEdit(int ID, int x, int y, int width, int height, string title)

BBjCEdit

addCEdit(int ID, int x, int y, int width, int height, 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()

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 p_edit)

Methods of BBjCEdit implemented for Focusable

Return Value

Method

boolean

isFocusable()

void

setFocusable(boolean p_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 Validateable

Return Value

Method

void

accept(boolean valid)

string

getValidationText()

Methods of BBjCEdit implemented for MouseWheelEnabled

Return Value

Method

int

getScrollWheelBehavior()

void

setScrollWheelBehavior(int trav)

Methods of BBjCEdit 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_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

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 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.

Constants 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
RETURN

See Also

BBjAPI

BBjSysGui

BBjWindow

CEDIT Mnemonic - Create Multi-Line Text Edit Control

CALLBACK Verb - Register BBj Subroutine

Focusable

MouseWheelEnabled

RecordSetBindable

TabTraversable

Validateable

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



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.