home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic 4 Unleashed
/
Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso
/
vspell
/
vtsautop.frm
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1994-10-06
|
6KB
|
172 lines
vtsautop
VisualSpeller Auto PopUp Example
Form15
LoadTextButton
&LoadText
DoneButton
&Done
CheckButton
&Check
Text1
Text1
Label1
2Type text in box and press CHECK to spellcheck it!
Form_Load
Command1_Click
VTSpell1
CheckTextk
Text1
TextU
ResultCode
ClearCounts
WordCountS
VTST_MISSPELLED
spellpop@
PopUp&
answer
VTST_IGNORE_REPLACE
ResumeCheckM
speller
resultx
CheckWord9
VTST_WORD_MISSPELLED
AutoSuggest
SpellOptionsF
ReplaceCount
FullDictionaryName
Command2_Click
DictionaryStatus5
Command3_Click
Text1_Change
VTRC_NOCHECK#
VTSpell1_Misspelled
EventActionO
VTEV_CONTINUEg
text2
Command4_Click
MhSpellPro1_BadWord
Problem$
Start9
mhs_BadWord
IgnoreWord
CacheSize
Text2_Changes
sbefore0
SystemInfof
safter
VTSystemInfo
VTSpellSystemInfo
text3
CacheHit
text4:
CacheMiss
text5a
Milliseconds*
standard
Text4_Change
LoadStandard
OpenStandard
etime
float
SuggestOptions
MaxSuggestions
Command5_Click
seedict
vtsdinfoU
Command6_Clickd
VTST_CHECK_CANCELED
VTSP_ALLOW_JOINED_WORDS
VTEV_RESUMEE
VTSpell1_Found
gurng
Hyphenation
VTRC_RECHECK
GetAFile
SelectedFile
SelecteFile
GetAFileName
Text3_Change
Text5_Change
AutoPopUp
eedict
EHandler
MB_OKCANCEL
IDCANCEL
LoadTextFile
vtsautop
CheckButton_Click
DoneButton_Click
LoadTextButton_Click
ReplaceOccurred
CheckButton_Click
For spellchecker result coded
To build up messagesa
Here we will use the VBX internal misspell dialog
to automatically handle misspell conditions.i
Because of using the automatic popup, this will
be a "blind" spellcheck, in that the misspelled
words will not be highlighted.a
Make sure that automatic popups are enabled.
Because the popup will automatically occur,
there will be no events triggered.r
Clearing the counts sets the words checked anda
replaced counters to zero.h
This is the simplest spellchecking. Setting then
CheckText property to the text to spellcheck does
all the work of clearing the offsets and such.o
The spellchecking is started, and control returns
only when a condition occurs that requiresq
returning. Since automatic popups are enabled,
this is most commonly when the spellcheck ise
complete. However, it is possible for return
to be made on a Cancel (from the popup).e
Enable an error handler
Start the spellcheck
Get the result code
Now we fall into a loop. Result codes of lessd
than or equal to zero are all status conditions,
which we need to handle. A positive condition is
an error condition, so we let that fall out of
the loop.
Spellcheck complete!c
Throw up a box with the count
of words checked and replaced.
Spellcheck complete!
Words Checked
Words Replaced
Exit loop.o
User punched the cancel buttone
on the popup box. Show a message
and exit.
Canceled
Technically, with automatic popups enabled,
nothing should fall to here, but Just In Case,
the DoEvents will allow some timesharing ford
other processes. Then, we resume the spellcheck
by setting the ResumeCheck property (VTRC_NOCHECK
says to not recheck the last word, in case it
was a replace, or we could use VTRC_RECHECK if
we wanted the replaced word rechecked). This
picks up where the spellcheck left off, using
the same text loaded by CheckText. When this
returns, we get the result code again, and loop
back to the top of the loop.o
This is IMPORTANT - if any wordsd
have been replaced, we need tol
read the text back out andt
replace the original text (in
the text control). Otherwise
we will have lost the replaces!
Disable the error handler
ExitI
Display the error
Continue
DoneButton_Click
Exit this form)
Form_Load
The quifk rown fxo jumps ovr the lazi dog's bac.
LoadTextButton_Click
This allows a text file to be loaded into the
text control, for convenience.l
*.txt