
BBjInputN
Description
The BBjInputN object provides methods for manipulating a GUI InputN control.
Implemented Interfaces
DragSource, DropTarget, Editable, Focusable, RecordSetBindable,SimpleRecordSetBindable,TabTraversable,TextAlignable, TextControl,Validateable
Creation
BBjAPI > BBjSysGui > BBjWindow > BBjInputN
A BBjInputN object is created through the following BBjWindow methods:
Return Value |
Method |
---|---|
BBjInputN |
addInputN(int ID, int x, int y, int w, int h) |
BBjInputN |
addInputN(int ID, int x, int y, int w, int h, string flags) |
BBjInputN |
addInputN(int ID, int x, int y, int w, int h, string flags, string mask) |
BBjInputN |
addInputN(int ID, int x, int y, int w, int h, string flags, string mask, string rules) |
BBjInputN |
addInputN(int ID, int x, int y, int w, int h, string flags, string mask, string rules, float restore) |
BBjInputN |
addInputN(int ID, int x, int y, int w, int h, string flags, string mask, string rules, float restore, float value) |
Methods of BBjInputN
Return Value |
Method |
---|---|
int |
getBeep() |
int |
|
string |
|
string |
|
string |
|
int |
getError() |
boolean |
|
boolean |
|
int |
|
int |
|
string |
getMask() |
boolean |
|
boolean |
|
boolean |
|
string |
|
boolean |
|
float |
getValue() |
boolean |
|
void |
restore() |
void |
|
void |
setBeep(boolean beep) |
void |
setCaretPosition(int pos) |
void |
setCommaCharacter(string comma) |
void |
setDotCharacter(string dot) |
void |
setEditable(boolean editable) |
void |
setEditString(string edit) |
void |
setHighlight(boolean highlight) |
void |
setInsertMode(boolean insert) |
void |
setLength(int len) |
void |
setMargin(int marginWidth) |
void |
setMask(string mask) |
void |
setNegateable(boolean negateable) |
void |
setPassEnter(int pass) |
void |
setPassTab(boolean pass) |
void |
setRestore(float restore) |
void |
setUseEditCommas(boolean useCommas) |
void |
setValue(float value) |
Methods of BBjInputN implemented for DragSource
Return Value |
Method |
---|---|
int |
|
string |
|
void |
setDragActions(int actions) |
void |
setDragType(string type) |
Methods of BBjInputN implemented for DropTarget
Return Value |
Method |
---|---|
int |
|
void |
setDropActions(int actions) |
void |
setDropTypes(BBjVector types) |
Methods of BBjInputN implemented for Editable
Return Value |
Method |
---|---|
boolean |
|
void |
setEditable(boolean p_edit) |
Methods of BBjInputN implemented for Focusable
Return Value |
Method |
---|---|
boolean |
|
void |
setFocusable(boolean p_focus) |
Methods of BBjInputN implemented for RecordSetBindable
Return Value |
Method |
---|---|
void |
bindRecordSet(BBjRecordSet recordset, string fieldname) |
string |
Methods of BBjInputN implemented for SimpleRecordSetBindable
Return Value |
Method |
---|---|
void |
Methods of BBjInputN implemented for TabTraversable
Return Value |
Method |
---|---|
boolean |
|
void |
setTabTraversable(boolean trav) |
Methods of BBjInputN implemented for TextAlignable
Return Value |
Method |
---|---|
int |
|
void |
setAlignment(int p_align) |
Methods of of BBjInputN implemented TextControl
Return Value |
Method |
---|---|
void |
addWord(string word) |
int |
|
string |
|
boolean |
|
int |
|
int |
|
string |
|
int |
|
string |
|
int |
|
string |
|
boolean |
getSpellCheckOption(int option) |
getSuggestions(string word) |
|
int |
|
void |
ignoreWord(string word) |
boolean |
isMisspelled(string word) |
boolean |
|
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 BBjInputN implemented for Validateable
Return Value |
Method |
---|---|
void |
accept(boolean valid) |
string |
Methods of BBjInputN inherited from BBjControl
Events
Callback Code |
Object-oriented Event |
Read Record Event |
Code |
ON_CONTROL_VALIDATION |
v |
||
ON_DROP_TARGET_DROP |
D |
||
ON_EDIT_MODIFY |
e |
||
ON_GAINED_FOCUS |
f |
||
ON_INPUT_KEYPRESS |
N (Notify Code 1) |
||
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 BBjInputN is an <input type="text"> element, with extensive JavaScript logic to manage the complex masking rules. It defines the following style names:
.BBjInputN
.BBjInputN.bbj-disabled
.BBjInputN.bbj-focused
.BBjInputN.bbj-readonly
Remarks
When a BBjInputN control is programmatically set to a value that exceeds the mask precision, the value is truncated, not rounded. For example, if the mask is "###,###,##0.00-", then programmatically setting the control value to -12345.6789 will cause it to display "12,345.67-", the same value that it would show if the user attempted to type those characters directly into the control. This differs from the standard Numeric Output rules, which would round to "12,345.68-". In BBj 18 and higher, setting the INPUTN_MASK_ROUNDING !COMPATsetting to TRUE will cause the BBjInputN (and INPUTN-style grid cells) to round values that exceed the mask precision, consistent with standard numeric output rules.
By default, BBjInputN getText() and the equivalent CTRL(1) always return a string that can be directly passed to theNUM() function. This differs from the Visual PRO/5 INPUTN control, which returns a string that uses the localized decimal separator. In BBj 18 and higher, the INPUTN_LOCAL_DECIMAL !COMPATsetting can be set to TRUE to implement the Visual PRO/5 behavior. When this option is used, the application will typically use CVS(64) to convert the string to a format that can be passed to the NUM() function.
Constants inherited from BBjControl
Example
BBjInputN Example
REM Add a INPUTN 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 an INPUTN control that limits input to 10 characters, and inserting
REM the value 1 when the user hits the restore key (normally ESCAPE)
myInputN! = myWindow!.addInputN(101,50,100,90,30,$0804$,"##,###,###.00",$$,1,0)
REM Register the CALLBACK routines
CALLBACK(ON_EDIT_MODIFY,INPUTN_MODIFIED,mySysGui!.getContext(),myInputN!.getID())
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())
REM Process Events
PROCESS_EVENTS
REM Callback routine called when the contents of the INPUTN control are modified
INPUTN_MODIFIED:
REM Display a message with the INPUTN control contents
MESSAGE$="The INPUTN contents are: " + STR(myInputN!.getText())
LET X=MSGBOX(MESSAGE$)
RETURN
REM Callback routine called when the user closes the application window
APP_CLOSE:
RELEASE
RETURN
See Also
INPUTN Mnemonic - Create Numeric Edit (INPUTN) Control
CALLBACK Verb - Register BBj Subroutine
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.