Third-Party Tools | Addict 3, 4

Top  Previous  Next

Addict 3 and 4 is a spelling check and thesaurus component suite. Visit www.addictive-software.com for additional information.

All registered users of RichView Package get a 10% discount when registering Addict Professional + PlusPack (spell checker and thesaurus).

Installing

1.Install the Addict 3 or 4 packages.

2.Install RichView parser for Addict 3 and 4.

3.Open RichViewActions.inc, remove the dot from the line {.$DEFINE USERVADDICT3}.

4.Open the RichViewActions package. Add a link to the parser's package in "Requires" section. Install the package (or rebuild it, if already installed).

5.Create TRVAddictSpell3 and TRVThesaurus3 components, assign them to RVAddictSpell3 and RVAddicthesaurus3 properties of TRVAControlPanel component (if you do not see these properties, steps 1-4 were not completed)

6.Create and use TrvActionAddictSpell3 and TrvActionAddictThesaurus3 actions.

Using

Assign TrvActionAddictSpell3 and TrvActionAddictThesaurus3 to menu items or toolbar buttons.

If you need an autocorrection feature, see RVA_Addict3AutoCorrect procedure.

When changing the UI language, you should change languages of TRVAddictSpell3 and TRVThesaurus3 components using GetAddictSpellLanguage and GetAddictThesLanguage functions (see the example in the topic about RVA_ChooseLanguage function).

Live spelling check

The examples in this section assume that RVAddictSpell31: TRVAddictSpell3 component is placed on the Form1 form.

To enable a live spelling check, assign OnSpellingCheck event of TCustomRichViewEdit component:

procedure TForm1.RichViewEdit1SpellingCheck(Sender: TCustomRichView;

  const AWord: String; StyleNo: Integer; var Misspelled: Boolean);

begin

  Misspelled := not RVAddictSpell31.WordAcceptable(AWord);

end;

If you want to start a live spelling check when the user starts editing, assign rvlspOnChange to LiveSpellingMode property of TCustomRichViewEdit component.

If you want to start a live spelling check when the user loaded a document, use OnOpenFile event of TrvActionOpen action:

procedure TForm1.RvActionOpen1OpenFile(Sender: TObject; Editor: TCustomRichViewEdit;

  const FileName: String; FileFormat: TrvFileOpenFilter; CustomFilterIndex: Integer);

begin

  Editor.StartLiveSpelling;

end;

When the user pressed "Add" or "Ignore All" in the spell dialog, red underlines must be removed from all occurrences of the added/ignored word. Use RVAddictSpell31.OnParserIgnoreWord event:

procedure TForm3.RVAddictSpell31ParserIgnoreWord(Sender: TObject;

  Before: Boolean; State: Integer);

begin

  if not Before and (State in [IgnoreState_IgnoreAll, IgnoreState_Add]) then

    RichViewEdit1.LiveSpellingValidateWord(RVAddictSpell31.CurrentWord);

end;


RichView © Sergey Tkachenko