|
Live spelling check |
Top Previous Next |
|
Live spelling check marks misspelled words with special underlines (wavy line of TRVStyle.LiveSpellingColor color). Spelling check is executed in background thread. Starting and finishing spelling check In TRichView: Spelling check is started by calling StartLiveSpelling method. In TRichViewEdit: Spelling check is started:
Spelling check is stopped by ClearLiveSpellingResults method. Checking Words RichView Package does not have its own spelling check engine and dictionaries. You need to use third-party components. Currently the following components are supported:
Let me know if you are interested in supporting other spelling checkers. Files required for these spell-checkers can be downloaded from Resources for RichView web page. The live spelling thread calls OnSpellingCheck event for each word in the document. Word is defined as a run of characters between delimiters. Additionally, '&' is treated as a delimiter. Apostrophes are processed specially, see RichViewApostropheInWord global variable. Single quote character is processed specially: if it's inside word, it's treated as a part of word (for example "it's" or "I'll"). If it's to the left/right, it's treated as a delimiter. URLs are ignored, see RVIsCustomURL function. Making Corrections Call LiveSpellingValidateWord if user added word in a custom dictionary or ignore list. Call GetCurrentMisspelling to get or to correct the current misspelled word. For example, you can use this method to implement popup menu:
Alternatively, misspelled word can be selected on the step 1 (before displaying popup menu). Memory Usage Live spelling support adds 8 extra bytes per each item. If you do not use it, you can compile your application with RVDONOTUSELIVESPELL compiler define (see RV_Defs.inc file) |