OS-based spell checking available in TRichView components
Recently, option for an automated spell-checking has been added into TRichView component in Delphi:
RichEdit1.SpellChecking:=True;
And no matter if this property is set at designtime or runtime. This functionality is based on operation system capabilities and is available from Windows 8 onwards.
The equipment of Delphi built-in RichEdit components is quite wide but there are the situations when we need something more complex. For these purposes, we've been using TRichView components from Sergey Tkachenko for more than 15 years. They offers advanced features for formatting RTF, loading and saving, displaying various text objects, images, barcodes etc.
However, there was no ability to use OS-based spell checking available until now and developers were forced to use miscellaneous external spelling systems. Unfortunately, most of them are incomplete or obsolete so their reliabilty was very ambiguous. Thus, I addressed Mr. Tkachenko as for implementation of OS-based spell checking in one of the future versions of TRichView and luckily, version 22.4 comes with this long awaited feature.
I'd like to consider the most basic way of spell checking process, i.e. emphasizing the typing errors with red wavy line so user see immediately what is wrong. For achieving this, only three easy steps are necessary:
- put new RVSpellChecker component onto desired form
- register your TRichViewEdit or TDBRichViewEdit for spell checking: RVSpellChecker1.RegisterEditor(DBRichEdit1);
- set a proper language for RVSpellChecker's Language property, for example here is setting the Czech laguage: RVSpellChecker1.Language:='cs-CZ';
That't it! The steps described above can be done manually at designtime or dynamically at runtime, as you like.
Then, highligting the typing errors is done by very familiar way:
About the Author
Ing. Karel Janecek, MBA, MSc.www.torry.net