Skip to content

Spell Check Demo ​

Folder: Demos\SpellCheck. Project: SpellCheck.dproj.

Demonstrates TSynSpellCheck: the check of the spelling with the spell checker of Windows, the indication of the errors and the suggestions in the popup menu.

UnitContent
dmCommandsA data module with the TSynSpellCheck (language en-US) and the actions of the category SynEdit Spell Check: TSynSpellCheckFile, TSynSpellCheckLine, TSynSpellCheckSelection, TSynSpellCheckWord and TSynSpellCheckAsYouType.
Unit1The main form with the editor, a menu and the popup menu of the editor.

How the popup menu works ​

When the popup menu of the editor opens (pmnuEditorPopup), the form looks for a spelling error at the position of the caret with ErrorAtPos. If there is one, the menu is filled with the suggestions of the Windows ISpellChecker (SpellChecker.Suggest) and with the actions to add the word to the dictionary, to ignore it once or always, and to delete it.

INFO

The spell checker needs at least one language installed in Windows. If SpellChecker is nil the demo hides the spelling menu.

Released under the MPL 1.1 / GPL 2 dual license.