Yes, the demo is there, in <TRichView dir>\ThirdParty\Addict\Demos\RichViewActions\
(there is also a demo without RichViewActions, but I assume you use RichViewActions for building user interface for ScaleRichView).
Instructions:
- I assume you already have RVAControlPanel1: TRVAControlPanel;
- place RVAddictSpell31: TRVAddictSpell3 on the form;
- place RVAAddictSpellInterface1: TRVAAddictSpellInterface on the form;
- assign RVAControlPanel1.SpellInterface = RVAAddictSpellInterface1
- assign RVAAddictSpellInterface1.AddictSpell = RVAddictSpell31
- assign RVAControlPanel1.SpellInterface = RVAAddictSpellInterface1
Now you can use TrvActionSpellingCheck to show the spelling dialog, and all live spelling commands are added to TRVAPopupMenu when you right click a misspelled word.
But one more step is needed: to start live spelling (spelling checking as-you-type).
To do it, assign TSRichViewEdit.OnSpellingCheck event:
Code: Select all
procedure TForm3.SRichViewEdit1SpellingCheck(Sender: TCustomRichView;
const AWord: TRVUnicodeString; StyleNo: Integer; var Misspelled: Boolean);
begin
Misspelled := not RVAddictSpell31.WordAcceptable(AWord);
end;
If you use a multi-document UI, like in ActionTestTabs demo, assign this event when copying properties to new editors
(in TForm3.AddEditor, add the line
srve.OnSpellingCheck := SRichViewEdit1SpellingCheck;
)
PS: thesaurus is implemented by
- placing RVThesaurus31: TRVThesaurus3 on the form
- assigning RVAAddictSpellInterface1.Thesaurus = RVThesaurus31
- using TrvActionThesaurus action
PPS: TRichView image lists provided for RichViewActions include glyphs for spelling check and for thesaurus.