Page 1 of 1

TRVdxSpellChecker: Adding words to custom dictionary (Delphi)

Posted: Wed Dec 23, 2020 11:13 am
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

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

Posted: Wed Dec 23, 2020 11:58 am
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.

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

Posted: Wed Dec 23, 2020 12:28 pm
by johannes.burger
Thanks Sergey, this worked great!