Interface TextControl::setCustomDictionary

 


Description

In BBj 7.0 and higher, this method sets the name of the server-side file that will contain new words added to the dictionary.

Syntax

Return Value

Method

void

setCustomDictionary(string filename)

Parameters

Variable

Description

filename

The name of the custom dictionary on the server.

Return Value

None.

Remarks

This default custom dictionary filename is CUSTOM.DIC. This can be changed by specifying a filename in STBL("!DICTIONARY").

Example

rem ' setCustomDictionary

SYSGUI=UNT
OPEN (SYSGUI)"X0"

sysgui! = BBjAPI().getSysGui()
window! = sysgui!.addWindow(200,200,400,400,"Spell-Check setCustomDictionary",$00010003$)
cedit! = window!.addCEdit(102,25,50,350,325,"",$0100$)
cedit!.setLineWrap(1)

gosub InitText

cedit!.setCustomDictionary("Jabberwocky.dic")
print "Using custom dictionary: ",cedit!.getCustomDictionary()

Locale$ = stbl("!LOCALE","en_GB")
cedit!.setSpellChecked(1)

words!=cedit!.getMisspelledWords()
if words!.size() then
:  for word=0 to words!.size()-1;
:      word$ = words!.get(word);
:      print "Add to "+cedit!.getCustomDictionary()+": "+word$;
:      cedit!.addWord(word$);
:  next word

CALLBACK(ON_CLOSE,APP_CLOSE,sysgui!.getContext())

REM Process Events
PROCESS_EVENTS

APP_CLOSE:
RELEASE

InitText:
  Text! = new java.util.HashMap()
  while 1
    dread text$,err=*break
    cedit!.addParagraph(-1,text$)
  wend
return

data "'Twas brillig, and the slithy toves"
data "  Did gyre and gimble in the wabe:"
data "All mimsy were the borogoves,"
data "  And the mome raths outgrabe."
data ""
data ""Beware the Jabberwock, my son!"
data "  The jaws that bite, the claws that catch!"
data "Beware the Jubjub bird, and shun"
data "  The frumious Bandersnatch!""
data ""
data "He took his vorpal sword in hand:"
data "  Long time the manxome foe he sought --"
data "So rested he by the Tumtum tree,"
data "  And stood awhile in thought."
data ""
data "And, as in uffish thought he stood,"
data "  The Jabberwock, with eyes of flame,"
data "Came whiffling through the tulgey wood,"
data "  And burbled as it came!"
data ""
data "One, two! One, two! And through and through"
data "  The vorpal blade went snicker-snack!"
data "He left it dead, and with its head"
data "  He went galumphing back."
data ""
data ""And, has thou slain the Jabberwock?"
data "  Come to my arms, my beamish boy!"
data "O frabjous day! Callooh! Callay!'"
data "  He chortled in his joy."
data ""
data "'Twas brillig, and the slithy toves"
data "  Did gyre and gimble in the wabe;"
data "All mimsy were the borogoves,"
data "  And the mome raths outgrabe."

See Also

BBjAPI

BBjSysGui

BBjControl

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