TRVdxSpellChecker: Adding words to custom dictionary (Delphi)

General TRichView support forum. Please post your questions here
Post Reply
johannes.burger
Posts: 5
Joined: Wed Jul 08, 2020 10:09 am

TRVdxSpellChecker: Adding words to custom dictionary (Delphi)

Post by johannes.burger »

I have recently added spell checking to my Delphi application. When I press F7, I get the standard dialog to correct/add/ignore misspelled words and this works fantastic.

I have also implemented a right-click to correct words, which also works great.

I now want to add "Add to dictionary" functionality to the right click but I struggle to remove the red underline once the new word has been added to the custom dictionary. The words save correctly to the custom.dic file. What must I do to refresh the TRichViewEdit once a word was added to remove the underline? I use the following to add the word: RVdxSpellChecker1.AddWordToUserDictionary(sNewWord); I tried to Unload, Load and Update Rules but nothing worked.

I also want to implement an "Ignore" option. I tried the RVdxSpellChecker1.IgnoreList.Add(sIgnoreWord) option but that also does not remove the red underline.

Many thanks,
Johan
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRVdxSpellChecker: Adding words to custom dictionary (Delphi)

Post by Sergey Tkachenko »

When adding a word to a dictionary, or when executing "Ignore All" command, call RichViewEdit.LiveSpellingValidateWord method.

If you use RichViewActions, I recommend using TRVAPopupMenu and TRVADXSpellInterface components, they will do all the work automatically.
johannes.burger
Posts: 5
Joined: Wed Jul 08, 2020 10:09 am

Re: TRVdxSpellChecker: Adding words to custom dictionary (Delphi)

Post by johannes.burger »

Thanks Sergey, this worked great!
Post Reply