Copyright: Copyright © 2008 Developer Express Inc. ALL RIGHTS RESERVED


Legend

 Protected

 Published

 ReadOnly


User Interface Elements (Overview)
User Interface Elements

Section_Navigator

Topics in this section describe the ExpressSpellChecker’s end-user capabilities.

•	Spelling Dialog

•	Spelling Options Dialog

•	Custom Dictionary Dialog

•	Spelling Complete Dialog

•	Check As You Type Mode


Spelling Dialog

User Interface Elements

If the spell checker finds a misspelled word, it invokes the Spelling dialog.

The Spelling dialog is provided in two layout styles:

•	The Outlook-style Spelling dialog

Displays a misspelled word and proposed corrections.

•	The Word-style Spelling dialog

Displays a sentence with a highlighted misspelled word and proposed corrections.  Besides error corrections, an end-user can make other changes in the sentence.


Spelling Options Dialog

User Interface Elements

The Spelling Options dialog is used by an end-user to specify rules for spell checking, open the Custom Dictionary dialog, and change dictionaries used for spell checking.


Custom Dictionary Dialog

User Interface Elements

The Custom Dictionary dialog is used by an end-user to edit words in a user-defined dictionary.


Spelling Complete Dialog

User Interface Elements

The The spelling check is complete dialog informs an end-user that spell checking has been completed.


Check As You Type Mode

User Interface Elements

In Check As You Type checking mode, the spell checker automatically checks a text-editing control’s contents when this control gains focus.

To inform an end-user about errors, the spell checker underlines misspelled words.  If the spell checker’s CheckAsYouTypeOptions.UnderlineStyle property is set to usAuto, misspellings are highlighted with straight lines in single-line text-editing controls.  Wavy lines are used to mark errors in multi-line text-editing controls.

Spelling corrections are performed using a built-in context menu.


Fundamentals (Overview)
Fundamentals

Section_Navigator

Topics in this section provide fundamental concepts of the ExpressSpellChecker.

•	Spell-Check Algorithms

This topic introduces the basic principles of spell-check implementation.


Spell-Check Algorithms

Fundamentals

The main aspects of our spell-check engine implementation include:

Text analysis

When parsing the text, some text elements can be treated specifically.  These elements include abbreviations, proper names, numbers, e-mail addresses, URLs (web addresses), and others.  They could simply be ignored or checked in a different way from other words in the text, dependent upon the spell-checker implementation and end-user options.

The ExpressSpellChecker provides spelling options that allow an end-user to avoid checking e-mail and web addresses, words with numbers, mixed case and uppercase words.

Dictionaries used by the spell checker

ISpell dictionary.  An ideal dictionary is comprised of all the words in a given language.  In real life, it can be much smaller and effectively split into several parts, dependent upon the language.  For several Indo-European languages, including English, words are derived from the base by adding affixes.  So, the size of the dictionary can be greatly reduced if base words, affixes and rules for adding affixes to base words are placed into separate files.  The complete list of words could be built in-place, when necessary.  This technique proves its effectiveness especially for synthetic languages (rich in verbal and inflective forms).  The approach that includes base words and affixes is used in the ISpell (ASpell) and OpenOffice spell-checker projects.

OpenOffice (Hunspell) dictionary.  Thanks to the OpenOffice project, spell-checker dictionaries of these projects may be freely used and distributed.  The ExpressSpellChecker supports this format since those dictionaries are quite complete and correct, and constantly amended by cooperative end-users.

User-defined dictionaries.  These dictionaries support the plain text format, and they are mostly used as stores for words not contained in other dictionaries.

Spelling suggestion algorithms

When a word is found as misspelled (that is, not found in a dictionary), a spell-checker generates a list of suggestions – words supposed to replace the mistake.  The final choice is always up to an end-user.

To provide suggested replacements for the misspelled word, the ExpressSpellChecker implementation uses the following correction algorithms:

•	Near-Miss Strategy

The misspelled word is subsequently modified by changing a letter, deleting or adding it, inserting a blank space, or interchanging two adjacent letters.  If these steps result in a word contained in a dictionary, then the "distance" between two words is calculated as a sum of steps required to perform the transformation.

•	Replacement Table

This algorithm is only used by OpenOffice dictionaries.  The Replacement Table contains patterns of frequently misspelled words.  With this algorithm, the search for suggested words takes less time, and results in more relevant corrections.  The Replacement Table algorithm has a higher priority than the Near-Miss Strategy algorithm.  As a result, the distance between the misspelled and suggested words is always 1.

Suggestion list order

After the list of suggestions is composed it needs to be ordered, so that an end-user doesn’t have to scroll through it searching for a match.  The implemented solution makes use of a modified Levenshtein distance algorithm, to provide the most relevant corrections in the list.


Getting Started

Section_Navigator

This topic describes how to create a simple application that uses the ExpressSpellChecker to check a TcxMemo control’s contents.

To provide a TcxMemo control with the spell-checking capabilities, follow the steps below:

1)	Drop a TcxMemo ( [image]) control from the Component Palette’s Express Editors 6 page, and the TdxSpellChecker ( [image]) component from the Dev Express page onto a form.

2)	Select the TdxSpellChecker component. In the Object Inspector, click the ellipsis button next to TdxSpellChecker.DictionaryItems to add dictionaries, which will be used for checking.

The TdxSpellChecker supports three types of dictionaries – ISpell, OpenOffice, and user-defined dictionaries.

3)	For each dictionary, specify the following setting details:

•	Dictionary file. Use the dictionary’s DictionaryPath property to specify the dictionary file’s location. By default, the dictionary file is located in the "Developer Express.VCL\ExpressSpellChecker\Demos\Data" folder.

•	Affix file. This file is required for the ISpell and OpenOffice dictionaries. These dictionaries use it to build words from an affix-compressed dictionary file (see the DictionaryPath property). Use the dictionary’s GrammarPath property to specify the affix file’s location. By default, the affix file is located in the "Developer Express.VCL\ExpressSpellChecker\Demos\Data" folder.

•	Language encoding. Use the dictionary’s Language property, to specify language specifics.  If this property is not specified, the host environment’s settings are used instead.

For the ISpell dictionary, use the dictionary’s CodePage property to specify the corresponding character encoding, to properly load the dictionary, if its code page is different than the host environment’s code page.

Setting the dictionary’s Alphabet property is optional. This property specifies the language alphabet that is used to improve suggestion analysis when building a suggestion list.

4)	Specify spelling options (see the spell checker’s SpellingOptions property), which will be used by the spell checker by default.  If necessary, most options can be changed at runtime using the Spelling Options dialog.

5)	Make certain that the spell checker’s AutoLoadDictionaries property is True.  If this feature is enabled, dictionaries are loaded automatically when the spell-checking application starts up.  To check the TcxMemo’s contents at runtime, use the TdxSpellChecker.Check method, as shown in the following example:

// Delphi

// ...

<SpellChecker>.Check(<Memo>);

6)	Run the application, enter the text containing misspellings in the TcxMemo, and run the spell-checking process to find errors in the entered text. When the spell checker finds the first wrong entry in the text, it displays the Spelling dialog, prompting you to make the necessary corrections.


Section Navigator
Choose a Section:

Fundamentals

User Interface Elements


dxISpellDecompressor Unit Overview
dxISpellDecompressor Unit

Classes

TdxAffixCompressionDictionary

TdxISpellDictionary

TdxOpenOfficeDictionary


TdxAffixCompressionDictionary
TdxAffixCompressionDictionary Object

Hierarchy          Properties          Methods          Events

Represents the base class for affix-compressed dictionaries (ISpell and OpenOffice dictionaries).

Unit

dxISpellDecompressor

TdxAffixCompressionDictionary = class(TdxCustomSpellCheckerDictionary)

Description

The TdxAffixCompressionDictionary declares the DictionaryPath and GrammarPath properties.  These properties specify dictionary files and rules used to build dictionaries from base words.

Do not use this class directly.  Use its descendants instead.


TdxAffixCompressionDictionary Hierarchy
Hierarchy

TPersistent

     |

TdxCustomSpellCheckerDictionary

     |

TdxAffixCompressionDictionary


Properties for TdxAffixCompressionDictionary
TdxAffixCompressionDictionary Properties

TdxAffixCompressionDictionary          Legend

In TdxAffixCompressionDictionary

DictionaryPath

GrammarPath

Derived from TdxCustomSpellCheckerDictionary

Active

Alphabet

CodePage

Enabled

Language

Loaded

SpellChecker

WordCount


Methods for TdxAffixCompressionDictionary
TdxAffixCompressionDictionary Methods

TdxAffixCompressionDictionary          Legend

Derived from TdxCustomSpellCheckerDictionary

 Activate

 Clear

 HasWord

 Load

 Unload


Events for TdxAffixCompressionDictionary
TdxAffixCompressionDictionary Events

TdxAffixCompressionDictionary          Legend

Derived from TdxCustomSpellCheckerDictionary

 OnLoaded

 OnLoading


TdxAffixCompressionDictionary.DictionaryPath

TdxAffixCompressionDictionary          See Also

Specifies the dictionary file from which a dictionary is created based on rules provided by the affix file.

property DictionaryPath: TFileName;


TdxAffixCompressionDictionary.GrammarPath

TdxAffixCompressionDictionary          See Also

Specifies the affix file used to build up a dictionary from the affix-compressed dictionary file specified by the DictionaryPath property.

property GrammarPath: TFileName;


TdxISpellDictionary
TdxISpellDictionary Object

Hierarchy          Properties          Methods          Events

Represents the ISpell dictionary.

Unit

dxISpellDecompressor

TdxISpellDictionary = class(TdxAffixCompressionDictionary)

Description

The TdxISpellDictionary represents a dictionary dynamically created at runtime (if specified in the spell checker’s DictionaryItems collection) from an affix-compressed dictionary file (specified by the DictionaryPath property) and an affix file (specified by the GrammarPath property).  When used with the TdxISpellDictionary, these files must support the ISpell format.

The dictionary load can be performed in either two modes – automatically or manually (see the spell checker’s AutoLoadDictionaries property).  To learn how to create a dictionary at runtime, see the spell checker’s LoadDictionaries and dictionary’s Load methods.

The TdxISpellDictionary object is referenced by the spell checker’s DictionaryItems.DictionaryType property.


TdxISpellDictionary Hierarchy
Hierarchy

TPersistent

     |

TdxCustomSpellCheckerDictionary

     |

TdxAffixCompressionDictionary

     |

TdxISpellDictionary


Properties for TdxISpellDictionary
TdxISpellDictionary Properties

TdxISpellDictionary          Legend

Derived from TdxAffixCompressionDictionary

DictionaryPath

GrammarPath

Derived from TdxCustomSpellCheckerDictionary

Active

Alphabet

CodePage

Enabled

Language

Loaded

SpellChecker

WordCount


Methods for TdxISpellDictionary
TdxISpellDictionary Methods

TdxISpellDictionary          Legend

Derived from TdxCustomSpellCheckerDictionary

 Activate

 Clear

 HasWord

 Load

 Unload


Events for TdxISpellDictionary
TdxISpellDictionary Events

TdxISpellDictionary          Legend

Derived from TdxCustomSpellCheckerDictionary

 OnLoaded

 OnLoading


TdxOpenOfficeDictionary
TdxOpenOfficeDictionary Object

Hierarchy          Properties          Methods          Events

Represents the OpenOffice dictionary.

Unit

dxISpellDecompressor

TdxOpenOfficeDictionary = class(TdxAffixCompressionDictionary)

Description

The OpenOffice format uses Hunspell-based dictionaries.

The TdxOpenOfficeDictionary represents a dictionary dynamically created at runtime (if specified in the spell checker’s DictionaryItems collection) from a compressed dictionary file (specified by the DictionaryPath property) and an affix file (specified by the GrammarPath property).  When used with the TdxOpenOfficeDictionary, these files must support the OpenOffice (Hunspell) format.

The dictionary load can be performed in either two modes – automatically or manually (see the spell checker’s AutoLoadDictionaries property).  To learn how to create a dictionary at runtime, see the spell checker’s LoadDictionaries and dictionary’s Load methods.

The TdxOpenOfficeDictionary object is referenced by the spell checker’s DictionaryItems.DictionaryType property.


TdxOpenOfficeDictionary Hierarchy
Hierarchy

TPersistent

     |

TdxCustomSpellCheckerDictionary

     |

TdxAffixCompressionDictionary

     |

TdxOpenOfficeDictionary


Properties for TdxOpenOfficeDictionary
TdxOpenOfficeDictionary Properties

TdxOpenOfficeDictionary          Legend

Derived from TdxAffixCompressionDictionary

DictionaryPath

GrammarPath

Derived from TdxCustomSpellCheckerDictionary

Active

Alphabet

CodePage

Enabled

Language

Loaded

SpellChecker

WordCount


Methods for TdxOpenOfficeDictionary
TdxOpenOfficeDictionary Methods

TdxOpenOfficeDictionary          Legend

Derived from TdxCustomSpellCheckerDictionary

 Activate

 Clear

 HasWord

 Load

 Unload


Events for TdxOpenOfficeDictionary
TdxOpenOfficeDictionary Events

TdxOpenOfficeDictionary          Legend

Derived from TdxCustomSpellCheckerDictionary

 OnLoaded

 OnLoading


dxSpellChecker Unit Overview
dxSpellChecker Unit

Classes

TdxCustomSpellChecker

TdxCustomSpellCheckerDictionary

TdxSpellCheckerSpellingOptions

TdxSpellChecker

TdxSpellCheckerCheckAsYouTypeOptions

TdxSpellCheckerCustomCheckMode

TdxSpellCheckerDialogCheckMode

TdxSpellCheckerDictionaries

TdxSpellCheckerDictionaryItem

TdxSpellCheckerOutlookCheckMode

TdxSpellCheckerSuggestion

TdxSpellCheckerSuggestionList

TdxSpellCheckerWordCheckMode

TdxUserSpellCheckerDictionary


TdxCustomSpellChecker
TdxCustomSpellChecker Object

Hierarchy          Properties          Methods          Events

Represents the base class for the TdxSpellChecker component.

Unit

dxSpellChecker

TdxCustomSpellChecker = class(TComponent)

Description

Do not use this class directly.  Use its descendant instead.


TdxCustomSpellChecker Hierarchy
Hierarchy

TComponent

     |

TdxCustomSpellChecker


Properties for TdxCustomSpellChecker
TdxCustomSpellChecker Properties

TdxCustomSpellChecker          Legend

In TdxCustomSpellChecker

ActiveDictionaries

ActiveDictionaryCount

AutoLoadDictionaries

CheckAsYouTypeOptions

CheckMode

DialogLookAndFeel

Dictionaries

DictionaryCount

DictionaryItems

EnabledDictionaries

EnabledDictionaryCount

SpellingFormType

SpellingOptions

UserDictionaries

UserDictionaryCount

UseThreadedLoad


Methods for TdxCustomSpellChecker
TdxCustomSpellChecker Methods

TdxCustomSpellChecker          Legend

In TdxCustomSpellChecker

 AddWordToUserDictionary

 Check

 CheckContainer

 FindDictionaryByWord

 FindFirstEnabledUserDictionary

 GetSuggestions

 GetTwoWordsDistance

 HasEnabledUserDictionary

 HasWordInDictionaries

 IsValidWord

 LoadDictionaries

 PopulateLanguages

 ShowSpellingCompleteMessage

 UnloadDictionaries


Events for TdxCustomSpellChecker
TdxCustomSpellChecker Events

TdxCustomSpellChecker          Legend

In TdxCustomSpellChecker

 OnAddWord

 OnAfterCheck

 OnBeforeCheck

 OnCheckAsYouTypeFinish

 OnCheckAsYouTypePopup

 OnCheckAsYouTypeStart

 OnCheckControlInContainer

 OnCheckWord

 OnEnabledDictionariesLoaded

 OnGetSuggestions

 OnSpellingComplete


TdxCustomSpellChecker.ActiveDictionaries

TdxCustomSpellChecker          See Also

Provides indexed access to active dictionaries.

property ActiveDictionaries[Index:Integer]: TdxCustomSpellCheckerDictionary;

Description

Active dictionaries are those that are used during spell checking operations.

Dictionaries, that have been specified as enabled (see the TdxCustomSpellCheckerDictionary.Enabled property) and loaded by the spell checker (see the TdxCustomSpellCheckerDictionary.Loaded property), are considered as active dictionaries (see the TdxCustomSpellCheckerDictionary.Active property).

If Index is out of the collection range, the ActiveDictionaries property returns nil.  The total number of currently active dictionaries can be obtained via the ActiveDictionaryCount property.

ReadOnly Property


TdxCustomSpellChecker.ActiveDictionaryCount

TdxCustomSpellChecker          See Also

Returns the number of active dictionaries.

property ActiveDictionaryCount: Integer;

Description

To access active dictionaries, use the ActiveDictionaries property.

ReadOnly Property


TdxCustomSpellChecker.AutoLoadDictionaries

TdxCustomSpellChecker

Specifies whether the spell checker loads dictionaries automatically.

property AutoLoadDictionaries: Boolean;

Description

If the AutoLoadDictionaries property is True, dictionaries specified by the dictionary’s DictionaryPath property are loaded automatically when the spell-checking application starts up.  Otherwise, dictionaries must be loaded manually, using the spell checker’s LoadDictionaries method, before the checking process is started (see the spell checker’s Check method).

If the AutoLoadDictionaries mode is active and dictionaries are loaded in the application's main thread (the UseThreadedLoad property is False), the application can freeze for a certain time at start up, if dictionaries are large enough.

To prevent this, consider multithreaded loading, or disable the AutoLoadDictionaries mode, and load dictionaries at a later stage (using the spell checker’s LoadDictionaries method).

The default value of the AutoLoadDictionaries property is False.


TdxCustomSpellChecker.CheckAsYouTypeOptions

TdxCustomSpellChecker

Specifies the Check As You Type checking mode’s options.

property CheckAsYouTypeOptions: TdxSpellCheckerCheckAsYouTypeOptions;

Description

Refer to the TdxSpellCheckerCheckAsYouTypeOptions class description for details.


TdxCustomSpellChecker.CheckMode

TdxCustomSpellChecker

Returns the spell checker’s user interface mode.

property CheckMode: TdxSpellCheckerCustomCheckMode;

Description

The CheckMode property provides access to two user interface modes – Outlook-style and Word-style.

ReadOnly Property


TdxCustomSpellChecker.DialogLookAndFeel

TdxCustomSpellChecker          See Also

Specifies look and feel settings for built-in dialogs.

property DialogLookAndFeel: TcxLookAndFeel;

Description

Use the DialogLookAndFeel property to make the spell checker’s look and feel consistent with the look and feel of the control (or controls) whose content is to be checked.


TdxCustomSpellChecker.Dictionaries

TdxCustomSpellChecker

Provides indexed access to dictionaries stored in the DictionaryItems collection.

property Dictionaries[Index:Integer]: TdxCustomSpellCheckerDictionary;

Description

The Dictionaries property provides access to all dictionaries stored in the collection.

Index specifies the dictionary’s position in the collection.  If Index is out of the collection range, the Dictionaries property returns nil.  The total number of available dictionaries can be obtained via the DictionaryCount property.

ReadOnly Property


TdxCustomSpellChecker.DictionaryCount

TdxCustomSpellChecker          See Also

Returns the number of dictionaries in the DictionaryItems collection.

property DictionaryCount: Integer;

Description

The DictionaryCount property returns the total amount of dictionaries stored in the collection (regardless of the dictionary availability status – see the spell checker’s ActiveDictionaries and the dictionary’s Active properties).

For direct indexed access to dictionaries, use the Dictionaries property.

ReadOnly Property


TdxCustomSpellChecker.DictionaryItems

TdxCustomSpellChecker

Represents a collection of dictionaries.

property DictionaryItems: TdxSpellCheckerDictionaries;

Description

The collection contains all three types of dictionaries (ISpell, OpenOffice and user-defined dictionaries).

Certain dictionaries may be disabled (see the dictionary’s Enabled property), or not loaded yet (see the dictionary’s Active property) and are unavailable during the spell checking process.

Dictionaries of all kinds can be obtained via the Dictionaries property.

Separate access to either active or enabled dictionaries is provided via the ActiveDictionaries and EnabledDictionaries properties respectively.


TdxCustomSpellChecker.EnabledDictionaries

TdxCustomSpellChecker          See Also

Provides indexed access to enabled dictionaries.

property EnabledDictionaries[Index:Integer]: TdxCustomSpellCheckerDictionary;

Description

A dictionary is considered as enabled, if the dictionary’s Enabled property is True.

When the enabled dictionary is loaded (see the dictionary’s Loaded property), it becomes active (see the dictionary’s Active property), which means that it can be used for spell checking.

If Index is out of the collection range, the EnabledDictionaries property returns nil.  To obtain the total number of currently enabled dictionaries, use the EnabledDictionaryCount property.

ReadOnly Property


TdxCustomSpellChecker.EnabledDictionaryCount

TdxCustomSpellChecker          See Also

Returns the number of the currently enabled dictionaries.

property EnabledDictionaryCount: Integer;

Description

To access enabled dictionaries, use the EnabledDictionaries property.

ReadOnly Property


TdxCustomSpellChecker.SpellingFormType

TdxCustomSpellChecker

Specifies the Spelling dialog’s style.

type

  TdxSpellCheckerSpellingFormType = (sftOutlook, sftWord);

property SpellingFormType: TdxSpellCheckerSpellingFormType;

Description

Values include:

Value	Meaning	Sample
sftOutlook	Outlook-style dialog
sftWord	Word-style dialog

The default value of the SpellingFormType property is sftOutlook.


TdxCustomSpellChecker.SpellingOptions

TdxCustomSpellChecker

Specifies spell-checking options.

property SpellingOptions: TdxSpellCheckerSpellingOptions;

Description

Refer to the TdxSpellCheckerSpellingOptions class description for details.


TdxCustomSpellChecker.UserDictionaries

TdxCustomSpellChecker

Provides indexed access to user-defined dictionaries.

property UserDictionaries[Index:Integer]: TdxUserSpellCheckerDictionary;

Description

If Index is out of the collection range, the UserDictionaries property returns nil.  To obtain the total number of user-defined dictionaries, use the UserDictionaryCount property.

ReadOnly Property


TdxCustomSpellChecker.UserDictionaryCount

TdxCustomSpellChecker

Returns the number of user-defined dictionaries.

property UserDictionaryCount: Integer;

Description

To access user-defined dictionaries, use the UserDictionaries property.

ReadOnly Property


TdxCustomSpellChecker.UseThreadedLoad

TdxCustomSpellChecker

Specifies whether dictionaries are to be loaded in a separate thread.

property UseThreadedLoad: Boolean;

Description

If the UseThreadedLoad property is True, dictionaries are loaded in the background (see the LoadDictionaries method).  Otherwise, they are loaded in the main application's thread.

Since large dictionary files take time to load, you may want to inform an end-user that the operation is complete (e.g. switch the cursor back from the hourglass, or enable a button that is used to start spell-checking).  For this purpose, use the OnEnabledDictionariesLoaded event that allows you to determine the finish time of the threaded load.

The default value of the UseThreadedLoad property is False.


TdxCustomSpellChecker.AddWordToUserDictionary

TdxCustomSpellChecker

Adds a word to a user-defined dictionary.

procedure AddWordToUserDictionary(const AWord: WideString);

Description

The AddWordToUserDictionary method finds the first instance of a user-defined dictionary in the spell checker’s ActiveDictionaries collection (see the FindFirstEnabledUserDictionary method), and calls the dictionary’s AddWord method.

The call dispatching is dependent upon the OnAddWord event handler implementation.  If a handler is assigned, and the event’s AHandled parameter is set to True, the default word appending routine is not executed.

Since the AddWordToUserDictionary method raises the OnAddWord event, don't use this method within the event handler to prevent an infinite loop. Instead, use the dictionary’s AddWord method.

AWord specifies the word to be added to the dictionary.

If you need to use a user-defined dictionary other than the first dictionary in the collection, use the UserDictionaries property.


TdxCustomSpellChecker.Check

TdxCustomSpellChecker          See Also

Checks spelling in the AEdit control.

procedure Check(AEdit: TCustomEdit);

procedure Check(AEdit: TcxCustomTextEdit);

Description

The first overload performs the spell check for standard text-editing controls that derive from the TCustomEdit.

The second overload performs the spell check for Developer Express text-editing controls.


TdxCustomSpellChecker.CheckContainer

TdxCustomSpellChecker

Checks spelling in text-editing controls placed onto the container.

procedure CheckContainer(AContainer: TWinControl; ARecursive: Boolean);

Description

The CheckContainer method checks controls in tab order.  The method doesn’t check the contents of disabled controls.

ARecursive specifies whether the check is performed at all hierarchical levels.  Set ARecursive to True, to check all child text-editing controls.  Otherwise, checking will only be performed for controls that belong to the container.


TdxCustomSpellChecker.FindDictionaryByWord

TdxCustomSpellChecker          See Also

Searches for the first dictionary (that contains AWord) in the ActiveDictionaries collection.

function FindDictionaryByWord(const AWord: WideString): TdxCustomSpellCheckerDictionary;

Description

If a match was found, the FindWord method returns the TdxCustomSpellCheckerDictionary instance.  Otherwise, nil is returned.


TdxCustomSpellChecker.FindFirstEnabledUserDictionary

TdxCustomSpellChecker

Searches for the first enabled user-defined dictionary in the UserDictionaries collection.

function FindFirstEnabledUserDictionary: TdxUserSpellCheckerDictionary;

Description

If a match was found, the FindFirstEnabledUserDictionary method returns a reference to the TdxUserSpellCheckerDictionary instance.  Otherwise, nil is returned.


TdxCustomSpellChecker.GetSuggestions

TdxCustomSpellChecker

Obtains suggested corrections for the misspelled AWord.

function GetSuggestions(const AWord: WideString): TdxSpellCheckerSuggestionList;

Description

If AWord represents a properly spelled word, this method returns an empty collection.


TdxCustomSpellChecker.GetTwoWordsDistance

TdxCustomSpellChecker

Returns a distance between two words.

function GetTwoWordsDistance(const AWord1, AWord2: WideString): Integer;

Description

The GetTwoWordsDistance method uses the modified Levenshtein algorithm.  The word is subsequently modified by one letter.  After each modification, the method checks the letter’s position in the word.  If the letter occupies either outermost position, the method returns 3.  Otherwise, 2 is returned.


TdxCustomSpellChecker.HasEnabledUserDictionary

TdxCustomSpellChecker          See Also

Checks whether the spell checker owns a custom dictionary.

function HasEnabledUserDictionary: Boolean;

Description

The HasUserDictionary method returns True if at least one custom dictionary is stored in the ActiveDictionaries collection.


TdxCustomSpellChecker.HasWordInDictionaries

TdxCustomSpellChecker          See Also

Checks whether AWord is contained in active dictionaries.

function HasWordInDictionaries(const AWord: WideString): Boolean;

Description

The HasWordInDictionaries method returns True if AWord is found in one of the active dictionaries (see the ActiveDictionaries property).


TdxCustomSpellChecker.IsValidWord

TdxCustomSpellChecker          See Also

Checks whether AWord is correct.

function IsValidWord(const AWord: WideString): Boolean;

Description

The IsValidWord method returns True, if AWord is found in the dictionary, or it is to be skipped (if specified via spelling options – see the SpellingOptions property).

The IsValidWord method raises the OnCheckWord event.  If the OnCheckWord event is handled, the IsValidWord method doesn’t perform the default check (if the event’s AHandled parameter is True), and returns the result specified by the event’s AValid parameter.


TdxCustomSpellChecker.LoadDictionaries

TdxCustomSpellChecker          See Also

Loads dictionaries into the memory from dictionary files.

procedure LoadDictionaries(AIgnoreDisabled: Boolean = True);

Description

The LoadDictionaries method loads dictionaries contained in the DictionaryItems collection.  This method only loads enabled dictionaries (the dictionary’s Enabled property is True), if AIgnoreDisabled is True.  Otherwise, all dictionaries are loaded.

The LoadDictionaries method is called automatically when the spell-check application starts up, if the AutoLoadDictionaries property is True.

Dictionaries are loaded in a separate thread, if the UseThreadedLoad property is True.

If dictionary files are large enough, it may affect the application performance, if they are loaded at start up.  You may want consider loading dictionaries at a later time.  For this purpose, disable the auto load mode, and use the LoadDictionaries method to load dictionaries manually.


TdxCustomSpellChecker.PopulateLanguages

TdxCustomSpellChecker

Populate strings with the language names of all dictionaries (except for user-defined dictionaries) contained in the spell checker’s DictionaryItems collections.

procedure PopulateLanguages(AList: TStrings);


TdxCustomSpellChecker.ShowSpellingCompleteMessage

TdxCustomSpellChecker          See Also

Invokes the The spelling check is complete dialog.

procedure ShowSpellingCompleteMessage; virtual;

Description

The The spelling check is complete dialog is initialized automatically when the spell check (see the Check method) reaches the end of the text.

Use the ShowSpellingCompleteMessage method to invoke the dialog, if the OnSpellingComplete event is handled and the event’s AHandled parameter is set to True (setting this parameter to True doesn’t display the default dialog).


TdxCustomSpellChecker.UnloadDictionaries

TdxCustomSpellChecker          See Also

Unloads dictionaries from the memory.

procedure UnloadDictionaries;

Description

The UnloadDictionaries method unloads all the dictionaries that were previously loaded, to release the memory occupied by dictionaries.

Note that unloaded dictionaries cannot be used for spell checking.


TdxCustomSpellChecker.OnAddWord

TdxCustomSpellChecker          See Also

Enables you to control how words are added to user-defined dictionaries.

type

  TdxSpellCheckerAddWordEvent = procedure(AUserDictionary: TdxUserSpellCheckerDictionary; const AWord: WideString; var AHandled: Boolean) of object;

property OnAddWord: TdxSpellCheckerAddWordEvent;

Description

Fires when AWord is about to be added to AUserDictionary.

Since this event is raised by the spell checker’s AddWordToUserDictionary method, use the AUserDictionary‘s AddWord method within the OnAddWord event handler instead (if required), to prevent the infinite loop.

AHandled specifies whether the default behavior is required. Set AHandled to True, to prevent the default code execution (setting AHandled to True prevents the default addition of AWord to AUserDictionary).


TdxCustomSpellChecker.OnAfterCheck

TdxCustomSpellChecker

Allows you to perform post-processing after the spell checker has completed the spell-checking process.

type

  TdxSpellCheckerEvent = procedure(Sender: TdxCustomSpellChecker) of object;

property OnAfterCheck: TdxSpellCheckerEvent;

Description

Fires after the spell checker has finished all the spell-checking operations (see the OnSpellingComplete event and ShowSpellingCompleteMessage method).

The event is raised by the Check and CheckContainer methods.

Sender specifies the spell checker that performs the spell check.


TdxCustomSpellChecker.OnBeforeCheck

TdxCustomSpellChecker

Allows you to perform pre-processing before the spell checker begins the error check.

type

  TdxSpellCheckerEvent = procedure(Sender: TdxCustomSpellChecker) of object;

property OnBeforeCheck: TdxSpellCheckerEvent;

Description

Fires when the spell checker is about to start the spell check.

The event is raised by the Check and CheckContainer methods.

Use the OnBeforeCheck event, to make certain that required dictionaries have been loaded and prevent the runtime exception.

Sender specifies the spell checker control.


TdxCustomSpellChecker.OnCheckAsYouTypeFinish

TdxCustomSpellChecker

Allows you to perform specific actions after checking has been completed.

type

  TdxSpellCheckerCheckAsYouTypeEvent = procedure(Sender: TdxCustomSpellChecker; AControl: TWinControl) of object;

property OnCheckAsYouTypeFinish: TdxSpellCheckerCheckAsYouTypeEvent;

Description

Sender specifies the spell checker control.

AControl specifies the control whose content is checked.


TdxCustomSpellChecker.OnCheckAsYouTypePopup

TdxCustomSpellChecker

Allows you to perform specific actions after the context menu has been invoked.

type

  TdxSpellCheckerCheckAsYouTypePopupEvent = procedure(ASender: TdxCustomSpellChecker; APopupMenu: TComponent; var AHandled: Boolean) of object;

property OnCheckAsYouTypePopup: TdxSpellCheckerCheckAsYouTypePopupEvent;

Description

Sender specifies the spell checker control.

AHandled specifies whether the default context menu is required.  Set AHandled parameter to True, to prevent the default context menu from being displayed.


TdxCustomSpellChecker.OnCheckAsYouTypeStart

TdxCustomSpellChecker

Allows you to perform specific actions before the checking process starts.

type

  TdxSpellCheckerCheckAsYouTypeStartEvent = procedure(Sender: TdxCustomSpellChecker; AControl: TWinControl; var AAllow: Boolean) of object;

property OnCheckAsYouTypeStart: TdxSpellCheckerCheckAsYouTypeStartEvent;

Description

Sender specifies the spell checker control.

AControl specifies the control whose content is checked.

AAllow specifies whether checking is allowed.  Set AAllow to True, to allow checking in the control.


TdxCustomSpellChecker.OnCheckControlInContainer

TdxCustomSpellChecker

Allows you to perform specific actions before the checking process starts in controls in a container.

type

  TdxSpellCheckerCheckControlInContainerEvent = procedure(Sender: TdxCustomSpellChecker; AControl: TWinControl; var AAllow: Boolean; var AContinue: Boolean) of object;

property OnCheckControlInContainer: TdxSpellCheckerCheckControlInContainerEvent;

Description

Sender specifies the spell checker control.

AControl specifies the control whose content is checked.

AAllow specifies whether checking is allowed.  Set AAllow to True, to allow checking in controls.

AContinue specifies whether checking can be performed in the next control.  Set AContinue to True, to allow checking in the next control.


TdxCustomSpellChecker.OnCheckWord

TdxCustomSpellChecker          See Also

Allows you to manually determine if a word is misspelled.

type

  TdxSpellCheckerCheckWordEvent = procedure(Sender: TdxCustomSpellChecker; const AWord: WideString; out AValid: Boolean; var AHandled: Boolean) of object;

property OnCheckWord: TdxSpellCheckerCheckWordEvent;

Description

Fires every time the spell checker processes a word.  The current word is passed as the AWord parameter.  AValid specifies whether the current word is misspelled.  Set AValid to True, to inform the spell checker that AWord is correct.  Otherwise, set AValid to False.

Sender specifies the spell checker that performs the spell check.

AHandled specifies whether the default behavior is required. Set AHandled to True, to prevent the default check of the current word.


TdxCustomSpellChecker.OnEnabledDictionariesLoaded

TdxCustomSpellChecker          See Also

Fires when the threaded load of enabled dictionaries has been completed.

type

  TdxSpellCheckerEvent = procedure(Sender: TdxCustomSpellChecker) of object;

property OnEnabledDictionariesLoaded: TdxSpellCheckerEvent;

Description

Fires after all enabled dictionaries have been loaded using multiple threads (the multithreaded execution is performed, if the spell checker’s UseThreadedLoad property is True).

The OnEnabledDictionariesLoaded event doesn’t fire if loading is performed in the application's main thread.

You can use this event to inform an end-user that the spell checker is now ready.

Sender specifies the spell checker that loads dictionaries.


TdxCustomSpellChecker.OnGetSuggestions

TdxCustomSpellChecker

Allows you to perform specific actions when the list of suggestions is being obtained.

type

  TdxSpellCheckerGetSuggestionsEvent = procedure(Sender: TdxCustomSpellChecker; ASuggestions: TdxSpellCheckerSuggestionList) of object;

property OnGetSuggestions: TdxSpellCheckerGetSuggestionsEvent;

Description

Sender specifies the spell checker.

ASuggestions specifies the list of suggestions.


TdxCustomSpellChecker.OnSpellingComplete

TdxCustomSpellChecker          See Also

Allows you to provide a custom behavior after the spell check has been completed.

type

  TdxSpellCheckerSpellingComplete = procedure(Sender: TdxCustomSpellChecker; var AHandled: Boolean) of object;

property OnSpellingComplete: TdxSpellCheckerSpellingComplete;

Description

Sender specifies the spell checker.

AHandled specifies whether the default behavior is required. Set AHandled to True, to prevent the display of the default The spelling check is complete dialog.


TdxCustomSpellCheckerDictionary
TdxCustomSpellCheckerDictionary Object

Hierarchy          Properties          Methods          Events

Represents the base class for dictionaries.

Unit

dxSpellChecker

TdxCustomSpellCheckerDictionary = class(TPersistent)

Description

The spell checker uses three types of dictionaries – ISpell, OpenOffice, and user-defined.  Dictionaries are specified using the spell checker’s DictionaryItems property.

Do not use this class directly.  Use its descendants instead.


TdxCustomSpellCheckerDictionary Hierarchy
Hierarchy

TPersistent

     |

TdxCustomSpellCheckerDictionary


Properties for TdxCustomSpellCheckerDictionary
TdxCustomSpellCheckerDictionary Properties

TdxCustomSpellCheckerDictionary          Legend

In TdxCustomSpellCheckerDictionary

Active

Alphabet

CodePage

Enabled

Language

Loaded

SpellChecker

WordCount


Methods for TdxCustomSpellCheckerDictionary
TdxCustomSpellCheckerDictionary Methods

TdxCustomSpellCheckerDictionary          Legend

In TdxCustomSpellCheckerDictionary

 Activate

 Clear

 HasWord

 Load

 Unload


Events for TdxCustomSpellCheckerDictionary
TdxCustomSpellCheckerDictionary Events

TdxCustomSpellCheckerDictionary          Legend

In TdxCustomSpellCheckerDictionary

 OnLoaded

 OnLoading


TdxCustomSpellCheckerDictionary.Active

TdxCustomSpellCheckerDictionary          See Also

Returns whether the dictionary is used for spell checking.

property Active: Boolean;

Description

The Active property returns True if a dictionary is specified as enabled (see the Enabled property), and it has been loaded by the spell checker (see the Loaded property) from a dictionary file.

ReadOnly Property


TdxCustomSpellCheckerDictionary.Alphabet

TdxCustomSpellCheckerDictionary

Specifies the corresponding language’s alphabet.

property Alphabet: WideString;

Description

This property is optional.

The spell checker uses the alphabet to improve generation of suggestions performed by letter additions and replacements.


TdxCustomSpellCheckerDictionary.CodePage

TdxCustomSpellCheckerDictionary

Specifies the dictionary’s code page.

property CodePage: Cardinal;

Description

To properly load a dictionary from a dictionary file, set the CodePage property to the dictionary file’s code page.

The default value of the CodePage property is CP_ACP.


TdxCustomSpellCheckerDictionary.Enabled

TdxCustomSpellCheckerDictionary          See Also

Specifies whether the dictionary is enabled.

property Enabled: Boolean;

Description

Set the Enabled property to True, to inform the spell checker that you want the dictionary to take part in spell checking. This dictionary will be later loaded from a dictionary file (see the DictionaryPath property), and will be available for spell-checking operations.

The default value of the Enabled property is True.


TdxCustomSpellCheckerDictionary.Language

TdxCustomSpellCheckerDictionary

Specifies the dictionary’s language.

property Language: DWORD;

Description

If the language is not specified then the default language (defined with the host environment’s settings) is used.

The default value of the Language property is 0.


TdxCustomSpellCheckerDictionary.Loaded

TdxCustomSpellCheckerDictionary          See Also

Returns whether the dictionary is loaded into memory.

property Loaded: Boolean;

Description

The Loaded property returns True if the dictionary is loaded (see the Load method), or False if the dictionary is unloaded (see the Unload method).

If the dictionary is enabled (see the Enabled property) and loaded, this dictionary is considered as active (see the Active property).  Only active dictionaries are used for spell checking.

ReadOnly Property


TdxCustomSpellCheckerDictionary.SpellChecker

TdxCustomSpellCheckerDictionary

Returns a spell checker to which the dictionary belongs.

property SpellChecker: TdxCustomSpellChecker;

ReadOnly Property


TdxCustomSpellCheckerDictionary.WordCount

TdxCustomSpellCheckerDictionary

Returns the number of words in the dictionary.

property WordCount: Integer;

ReadOnly Property


TdxCustomSpellCheckerDictionary.Activate

TdxCustomSpellCheckerDictionary          See Also

Makes a dictionary available for spell checking.

procedure Activate;

Description

The Activate method specifies the dictionary as enabled (see the Enabled property) and loads it from a dictionary file (see the Load method and the DictionaryPath property).

If the dictionary is activated, it is used for spell checking.


TdxCustomSpellCheckerDictionary.Clear

TdxCustomSpellCheckerDictionary          See Also

Unloads a dictionary from the memory, and makes it disabled.

procedure Clear;

Description

The Clear method invokes the Unload method to unload the dictionary (if it was previously loaded – see the Loaded property), and disables the dictionary (by setting the Enabled property to False).


TdxCustomSpellCheckerDictionary.HasWord

TdxCustomSpellCheckerDictionary          See Also

Checks whether AWord is contained in the dictionary.

function HasWord(const AWord: WideString): Boolean; virtual;

Description

The HasWord method returns True if AWord is found in the dictionary.


TdxCustomSpellCheckerDictionary.Load

TdxCustomSpellCheckerDictionary          See Also

Loads the dictionary into the memory from a dictionary file.

type

TdxSpellCheckerDictionaryLoadMode = (dlmDefault, dlmDirectLoad, dlmThreadedLoad);

procedure Load(AMode: TdxSpellCheckerDictionaryLoadMode = dlmDefault);

Description

If the load was successful, the Loaded property is set to True.

Values include:

Value	Meaning
dlmDefault	Obtains a setting specified by the spell checker’s UseThreadedLoad property.
dlmDirectLoad	The dictionary is loaded in the application’s main thread.
dlmThreadedLoad	The dictionary is loaded in a separate thread.


TdxCustomSpellCheckerDictionary.Unload

TdxCustomSpellCheckerDictionary

Unloads the dictionary from the memory.

procedure Unload;

Description

If the dictionary is a custom dictionary (see the TdxUserSpellCheckerDictionary) and the TdxUserSpellCheckerDictionary.Options is udSaveOnUnload, the Unload method saves the dictionary’s content to the file specified by the TdxUserSpellCheckerDictionary.DictionaryPath property.

When the unload is finished, the Loaded property is set to False.

Unlike the Clear method, the Unload method doesn’t change the dictionary’s availability status (see the Enabled property).


TdxCustomSpellCheckerDictionary.OnLoaded

TdxCustomSpellCheckerDictionary          See Also

Allows you to perform specific actions after the dictionary has been loaded into the memory.

type

  TdxSpellCheckerDictionaryLoadedEvent = procedure(Sender: TdxCustomSpellCheckerDictionary) of object;

property OnLoaded: TdxSpellCheckerDictionaryLoadedEvent;

Description

Sender specifies the loaded dictionary.


TdxCustomSpellCheckerDictionary.OnLoading

TdxCustomSpellCheckerDictionary          See Also

Allows you to perform specific actions when a dictionary is about to be loaded.

type

  TdxSpellCheckerDictionaryLoadingEvent = procedure(Sender: TdxCustomSpellCheckerDictionary; var AHandled: Boolean) of object;

property OnLoading: TdxSpellCheckerDictionaryLoadingEvent;

Description

Use the OnLoading event, if you need to validate dictionary files.

Sender specifies the dictionary to be loaded.

AHandled specifies whether the default behavior is required. Set AHandled to True, to prevent the default code execution, and inform the spell checker that the dictionary has been loaded (the Loaded property is set to True).


TdxSpellCheckerSpellingOptions
TdxSpellCheckerSpellingOptions Object

Hierarchy          Properties          Events

Contains spell-checking options.

Unit

dxSpellChecker

TdxSpellCheckerSpellingOptions = class(TPersistent)

Description

The TdxSpellCheckerSpellingOptions allows you to specify the way spell checking will be performed.

This object is referenced by the spell checker’s SpellingOptions property.


TdxSpellCheckerSpellingOptions Hierarchy
Hierarchy

TPersistent

     |

TdxSpellCheckerSpellingOptions


Properties for TdxSpellCheckerSpellingOptions
TdxSpellCheckerSpellingOptions Properties

TdxSpellCheckerSpellingOptions          Legend

In TdxSpellCheckerSpellingOptions

CheckFromCursorPos

CheckSelectedTextFirst

IgnoreEmails

IgnoreMixedCaseWords

IgnoreRepeatedWords

IgnoreUpperCaseWords

IgnoreUrls

IgnoreWordsWithNumbers


Events for TdxSpellCheckerSpellingOptions
TdxSpellCheckerSpellingOptions Events

TdxSpellCheckerSpellingOptions          Legend

In TdxSpellCheckerSpellingOptions

 OnChanged


TdxSpellCheckerSpellingOptions.CheckFromCursorPos

TdxSpellCheckerSpellingOptions

Specifies whether spell checking is to be started from the cursor’s current position.

property CheckFromCursorPos: Boolean;

Description

If the CheckFromCursorPos property is True, the spell checker is searches for misspellings starting from the cursor’s current position.

If set to False, the check is performed from the beginning of the text.

The default value of the CheckFromCursorPos property is False.


TdxSpellCheckerSpellingOptions.CheckSelectedTextFirst

TdxSpellCheckerSpellingOptions

Specifies whether the current selection is checked first.

property CheckSelectedTextFirst: Boolean;

Description

If the CheckSelectedTextFirst property value is True, the spell checker first searches for errors within the selected text.  When the selected text is checked, an end-user is prompted to check the text outside of the current selection.

If this property is set to False, the check is performed from the beginning of the text.

The default value of the CheckSelectedTextFirst property is True.


TdxSpellCheckerSpellingOptions.IgnoreEmails

TdxSpellCheckerSpellingOptions

Specifies whether the spell checker ignores email addresses.

property IgnoreEmails: Boolean;

Description

If the IgnoreEmails property is True, the spell checker ignores words that contain the "@" character.

The default value of the IgnoreEmails property is True.


TdxSpellCheckerSpellingOptions.IgnoreMixedCaseWords

TdxSpellCheckerSpellingOptions

Specifies whether the spell checker ignores mixed case words.

property IgnoreMixedCaseWords: Boolean;

Description

If the IgnoreMixedCaseWords property is True, the spell checker ignores words containing multiple upper-case letters, as well as lower-case letters.

This property doesn’t affect capitalized words.

The default value of the IgnoreMixedCaseWords property is True.


TdxSpellCheckerSpellingOptions.IgnoreRepeatedWords

TdxSpellCheckerSpellingOptions

Specifies whether the spell checker ignores repeated words.

property IgnoreRepeatedWords: Boolean;

Description

By default, the spell checker considers repeated words as a mistake. If you want to allow repeated words in text, set the IgnoreRepeatedWords property to True.

The default value of the IgnoreRepeatedWords property is False.


TdxSpellCheckerSpellingOptions.IgnoreUpperCaseWords

TdxSpellCheckerSpellingOptions

Specifies whether the spell checker ignores words containing all letters in uppercase.

property IgnoreUpperCaseWords: Boolean;

Description

If the IgnoreUpperCaseWords property is True, the spell checker ignores uppercase words.

The default value of the IgnoreUpperCaseWords property is True.


TdxSpellCheckerSpellingOptions.IgnoreUrls

TdxSpellCheckerSpellingOptions

Specifies whether the spell checker ignores Internet or file addresses.

property IgnoreUrls: Boolean;

Description

If the IgnoreUrls property is True, the spell checker ignores URLs - sequences of letters starting with: "http://", "https://", "ftp://", "www.", "file://", "\\", "gopher://", "nntp://", "news://".

The default value of the IgnoreUrls property is True.


TdxSpellCheckerSpellingOptions.IgnoreWordsWithNumbers

TdxSpellCheckerSpellingOptions

Specifies whether the spell checker ignores words containing digits.

property IgnoreWordsWithNumbers: Boolean;

Description

If the IgnoreWordsWithNumbers property is True, words with digits are ignored.

The default value of the IgnoreWordsWithNumbers property is True.


TdxSpellCheckerSpellingOptions.OnChanged

TdxSpellCheckerSpellingOptions

Allows you to perform specific actions after a spelling option has been changed.

type

  TdxSpellCheckerSpellingOptionsChangedEvent = procedure(Sender: TdxSpellCheckerSpellingOptions) of object;

property OnChanged: TdxSpellCheckerSpellingOptionsChangedEvent;

Description

Sender specifies the TdxSpellCheckerSpellingOptions instance that contains the changed option.


TdxSpellChecker
 TdxSpellChecker Object

Hierarchy          Properties          Methods          Events

The spell checker component.

Unit

dxSpellChecker

TdxSpellChecker = class(TdxCustomSpellChecker)

Description

Use the TdxSpellChecker component to add Microsoft® Office® style spell-checking capabilities to your applications.

The TdxSpellChecker can check text utilizing both standard and Developer Express text-editing controls.


TdxSpellChecker Hierarchy
Hierarchy

TComponent

     |

TdxCustomSpellChecker

     |

TdxSpellChecker


Properties for TdxSpellChecker
TdxSpellChecker Properties

TdxSpellChecker          Legend

Derived from TdxCustomSpellChecker

ActiveDictionaries

ActiveDictionaryCount

AutoLoadDictionaries

CheckAsYouTypeOptions

CheckMode

DialogLookAndFeel

Dictionaries

DictionaryCount

DictionaryItems

EnabledDictionaries

EnabledDictionaryCount

SpellingFormType

SpellingOptions

UserDictionaries

UserDictionaryCount

UseThreadedLoad


Methods for TdxSpellChecker
TdxSpellChecker Methods

TdxSpellChecker          Legend

Derived from TdxCustomSpellChecker

 AddWordToUserDictionary

 Check

 CheckContainer

 FindDictionaryByWord

 FindFirstEnabledUserDictionary

 GetSuggestions

 GetTwoWordsDistance

 HasEnabledUserDictionary

 HasWordInDictionaries

 IsValidWord

 LoadDictionaries

 PopulateLanguages

 ShowSpellingCompleteMessage

 UnloadDictionaries


Events for TdxSpellChecker
TdxSpellChecker Events

TdxSpellChecker          Legend

Derived from TdxCustomSpellChecker

 OnAddWord

 OnAfterCheck

 OnBeforeCheck

 OnCheckAsYouTypeFinish

 OnCheckAsYouTypePopup

 OnCheckAsYouTypeStart

 OnCheckControlInContainer

 OnCheckWord

 OnEnabledDictionariesLoaded

 OnGetSuggestions

 OnSpellingComplete


TdxSpellCheckerCheckAsYouTypeOptions
TdxSpellCheckerCheckAsYouTypeOptions Object

Hierarchy          Properties          Events

Contains the Check As You Type checking mode’s options.

Unit

dxSpellChecker

TdxSpellCheckerCheckAsYouTypeOptions = class(TPersistent)

Description

The TdxSpellCheckerCheckAsYouTypeOptions allows you to specify how the Check As You Type checking mode’s operations are to be performed.

This object is referenced by the spell checker’s CheckAsYouTypeOptions property.


TdxSpellCheckerCheckAsYouTypeOptions Hierarchy
Hierarchy

TPersistent

     |

TdxSpellCheckerCheckAsYouTypeOptions


Properties for TdxSpellCheckerCheckAsYouTypeOptions
TdxSpellCheckerCheckAsYouTypeOptions Properties

TdxSpellCheckerCheckAsYouTypeOptions          Legend

In TdxSpellCheckerCheckAsYouTypeOptions

Active

ModifyControlPopupMenu

PopupMenu

PopupMenuItems

SuggestionCount

UnderlineColor

UnderlineStyle


Events for TdxSpellCheckerCheckAsYouTypeOptions
TdxSpellCheckerCheckAsYouTypeOptions Events

TdxSpellCheckerCheckAsYouTypeOptions          Legend

In TdxSpellCheckerCheckAsYouTypeOptions

 OnChanged


TdxSpellCheckerCheckAsYouTypeOptions.Active

TdxSpellCheckerCheckAsYouTypeOptions

Specifies whether the Check As You Type checking mode is active.

property Active: Boolean;

Description

Set the Active property to True, to activate the Check As You Type checking mode

The default value of the Active property is False.


TdxSpellCheckerCheckAsYouTypeOptions.ModifyControlPopupMenu

TdxSpellCheckerCheckAsYouTypeOptions

Specifies whether the control’s context menu can be replaced with the spell checker’s context menu used for misspelled word correction.

property ModifyControlPopupMenu: Boolean;

Description

If the ModifyControlPopupMenu property is True, the spell checker checks whether the control’s (whose content is checked) context menu can be changed.

If this modification is allowed, the spell checker provides the context menu used in the Check As You Type checking mode.

The default value of the ModifyControlPopupMenu property is True.


TdxSpellCheckerCheckAsYouTypeOptions.PopupMenu

TdxSpellCheckerCheckAsYouTypeOptions

Specifies the custom context menu.

property PopupMenu: TComponent;


TdxSpellCheckerCheckAsYouTypeOptions.PopupMenuItems

TdxSpellCheckerCheckAsYouTypeOptions

Specifies menu items for the context menu.

type

TdxSpellCheckerPopupMenuItem = (scmiAddToDictionary, scmiDelete, scmiIgnoreAll, scmiSpelling, scmiSuggestions);

TdxSpellCheckerPopupMenuItems = set of TdxSpellCheckerPopupMenuItem;

property PopupMenuItems: TdxSpellCheckerPopupMenuItems;

Description

Values include:

Value	Meaning
scmiAddToDictionary	Adds a word to the user-defined dictionary.
scmiDelete	Deletes a word from the text.
scmiIgnoreAll	Ignores all entries of the misspelled word in the text.
scmiSpelling	Invokes the Spelling dialog.
scmiSuggestions	Provides suggested words.

The default value of the PopupMenuItems property is [scmiAddToDictionary,scmiDelete,scmiIgnoreAll,scmiSpelling,scmiSuggestions].


TdxSpellCheckerCheckAsYouTypeOptions.SuggestionCount

TdxSpellCheckerCheckAsYouTypeOptions

Specifies the number of allowed suggestions in the context menu.

property SuggestionCount: Integer;

Description

The SuggestionCount property specifies the maximum number of suggestions in the context menu.  The real number of provided suggestions depends upon the list of suggestions returned by the GetSuggestions method for the given misspelled word.

The default value of the SuggestionCount property is 5.


TdxSpellCheckerCheckAsYouTypeOptions.UnderlineColor

TdxSpellCheckerCheckAsYouTypeOptions

Specifies the color of a line used to mark misspelled words.

property UnderlineColor: TColor;

The default value of the UnderlineColor property is clRed.


TdxSpellCheckerCheckAsYouTypeOptions.UnderlineStyle

TdxSpellCheckerCheckAsYouTypeOptions

Specifies the style of a line used to mark misspelled words.

type

TdxSpellCheckerUnderlineStyle = (usAuto, usWavyLine, usLine);

property UnderlineStyle: TdxSpellCheckerUnderlineStyle;

Description

Values include:

Value	Meaning
usAuto	A straight line is painted in the single-line text-editing controls.  A wavy line is painted in the multi-line text-editing controls.
usWavyLine	A wavy line is painted.
usLine	A line is painted.

The default value of the UnderlineStyle property is usWavyLine.


TdxSpellCheckerCheckAsYouTypeOptions.OnChanged

TdxSpellCheckerCheckAsYouTypeOptions

Allows you to perform specific actions after the TdxSpellCheckerCheckAsYouTypeOptions’s option has been changed.

type

  TdxSpellCheckerCheckAsYouTypeOptionsChangedEvent = procedure(ASender: TdxSpellCheckerCheckAsYouTypeOptions) of object;

property OnChanged: TdxSpellCheckerCheckAsYouTypeOptionsChangedEvent;

Description

Sender specifies the TdxSpellCheckerCheckAsYouTypeOptions instance that contains the changed option.


TdxSpellCheckerCustomCheckMode
TdxSpellCheckerCustomCheckMode Object

Hierarchy          Properties          Methods

Represents the base class for the Outlook-style and Word-style checking modes.

Unit

dxSpellChecker

TdxSpellCheckerCustomCheckMode = class(TPersistent)

Description

Do not use this class directly.  Use its descendants instead.


TdxSpellCheckerCustomCheckMode Hierarchy
Hierarchy

TPersistent

     |

TdxSpellCheckerCustomCheckMode


Properties for TdxSpellCheckerCustomCheckMode
TdxSpellCheckerCustomCheckMode Properties

TdxSpellCheckerCustomCheckMode          Legend

In TdxSpellCheckerCustomCheckMode

Adapter

LastCode

MisspelledWord

Parser

SpellChecker


Methods for TdxSpellCheckerCustomCheckMode
TdxSpellCheckerCustomCheckMode Methods

TdxSpellCheckerCustomCheckMode          Legend

In TdxSpellCheckerCustomCheckMode

 Add

 CanUndo

 Change

 ChangeAll

 Delete

 DeleteAll

 GetNextMisspelledWord

 GetSuggestions

 Ignore

 IgnoreAll

 UndoLast


TdxSpellCheckerCustomCheckMode.Adapter

TdxSpellCheckerCustomCheckMode

Returns a wrapper for a linked text-editing control.

property Adapter: TdxSpellCheckerCustomEditAdapter;

ReadOnly Property


TdxSpellCheckerCustomCheckMode.LastCode

TdxSpellCheckerCustomCheckMode

Returns the last checking action’s status.

type

  TdxSpellCheckerSpellingCode = (scNoError, scMisspelled, scRepeatedWords);

property LastCode: TdxSpellCheckerSpellingCode;

Description

Values include:

Value	Meaning
scNoError	No misspelled word has been found.
scMisspelled	A misspelled word has been found.
scRepeatedWords	Repeated words have been found.

ReadOnly Property


TdxSpellCheckerCustomCheckMode.MisspelledWord

TdxSpellCheckerCustomCheckMode

Returns the misspelled word found after the most recent checking action performed by the GetNextMisspelledWord method.

property MisspelledWord: WideString;

ReadOnly Property


TdxSpellCheckerCustomCheckMode.Parser

TdxSpellCheckerCustomCheckMode

Returns the text parser.

property Parser: TdxSpellCheckerTextParser;

ReadOnly Property


TdxSpellCheckerCustomCheckMode.SpellChecker

TdxSpellCheckerCustomCheckMode

Returns the spell checker.

property SpellChecker: TdxCustomSpellChecker;

ReadOnly Property


TdxSpellCheckerCustomCheckMode.Add

TdxSpellCheckerCustomCheckMode

Adds a misspelled word found by the GetNextMisspelledWord method to a user-defined dictionary.

procedure Add; virtual;


TdxSpellCheckerCustomCheckMode.CanUndo

TdxSpellCheckerCustomCheckMode

Checks whether the most recent checking action can be cancelled.

function CanUndo: Boolean; virtual;

Description

The CanUndo method returns True, if the last checking action can be cancelled.


TdxSpellCheckerCustomCheckMode.Change

TdxSpellCheckerCustomCheckMode

Changes a misspelled word with AWord.

procedure Change(const AWord: WideString); virtual;

Description

The GetNextMisspelledWord method searches for the misspelled word, and if this word is found, writes it to the MisspelledWord property.

Use the Change method to replace the found misspelled word.

AWord specifies the suggested word.


TdxSpellCheckerCustomCheckMode.ChangeAll

TdxSpellCheckerCustomCheckMode

Maps a misspelled word to the corresponding AWord.

procedure ChangeAll(const AWord: WideString); virtual;

Description

The GetNextMisspelledWord method searches for the misspelled word, and if this word is found, writes it to the MisspelledWord property.

The ChangeAll method binds the found misspelled word and the corresponding AWord, so that the similar misspelled words will be changed with AWord in the next checking actions.

AWord specifies the suggested word.


TdxSpellCheckerCustomCheckMode.Delete

TdxSpellCheckerCustomCheckMode

Deletes a misspelled word specified by the MisspelledWord property.

procedure Delete; virtual;


TdxSpellCheckerCustomCheckMode.DeleteAll

TdxSpellCheckerCustomCheckMode

Marks a misspelled word specified by the MisspelledWord property as a word to be deleted in next checking actions.

procedure DeleteAll; virtual;


TdxSpellCheckerCustomCheckMode.GetNextMisspelledWord

TdxSpellCheckerCustomCheckMode

Searches for the next misspelled word.

function GetNextMisspelledWord: Boolean; virtual;

Description

If a misspelled word has been found, the GetNextMisspelledWord method writes it to the MisspelledWord property, and returns True.


TdxSpellCheckerCustomCheckMode.GetSuggestions

TdxSpellCheckerCustomCheckMode

Obtains suggested corrections for the misspelled AWord.

function GetSuggestions(const AWord: WideString): TdxSpellCheckerSuggestionList; virtual;

Description

If AWord represents a properly spelled word, this method returns an empty collection.


TdxSpellCheckerCustomCheckMode.Ignore

TdxSpellCheckerCustomCheckMode

Skips a misspelled word specified by the MisspelledWord property.

procedure Ignore; virtual;


TdxSpellCheckerCustomCheckMode.IgnoreAll

TdxSpellCheckerCustomCheckMode

Marks a misspelled word specified by the MisspelledWord property as a word to be skipped in next checking actions.

procedure IgnoreAll; virtual;


TdxSpellCheckerCustomCheckMode.UndoLast

TdxSpellCheckerCustomCheckMode

Cancels the last checking action performed over a misspelled word specified by the MisspelledWord property.

procedure UndoLast; virtual;


TdxSpellCheckerDialogCheckMode
TdxSpellCheckerDialogCheckMode Object

Hierarchy          Properties          Methods

Represents the base class for dialog-based (Outlook-style and Word-style) checking modes.

Unit

dxSpellChecker

TdxSpellCheckerDialogCheckMode = class(TdxSpellCheckerCustomCheckMode)

Description

Do not use this class directly.  Use its descendants instead.


TdxSpellCheckerDialogCheckMode Hierarchy
Hierarchy

TPersistent

     |

TdxSpellCheckerCustomCheckMode

     |

TdxSpellCheckerDialogCheckMode


Properties for TdxSpellCheckerDialogCheckMode
TdxSpellCheckerDialogCheckMode Properties

TdxSpellCheckerDialogCheckMode          Legend

In TdxSpellCheckerDialogCheckMode

Languages

Derived from TdxSpellCheckerCustomCheckMode

Adapter

LastCode

MisspelledWord

Parser

SpellChecker


Methods for TdxSpellCheckerDialogCheckMode
TdxSpellCheckerDialogCheckMode Methods

TdxSpellCheckerDialogCheckMode          Legend

In TdxSpellCheckerDialogCheckMode

 ShowDialog

Derived from TdxSpellCheckerCustomCheckMode

 Add

 CanUndo

 Change

 ChangeAll

 Delete

 DeleteAll

 GetNextMisspelledWord

 GetSuggestions

 Ignore

 IgnoreAll

 UndoLast


TdxSpellCheckerDialogCheckMode.Languages

TdxSpellCheckerDialogCheckMode

Represents languages supported by the host environment.

property Languages: TdxSpellCheckerLanguages;

ReadOnly Property


TdxSpellCheckerDialogCheckMode.ShowDialog

TdxSpellCheckerDialogCheckMode

Invokes the Spelling dialog used by end-users for spelling corrections.

function ShowDialog: Integer; virtual;


TdxSpellCheckerDictionaries
TdxSpellCheckerDictionaries Object

Hierarchy          Properties          Methods

Represents a collection of dictionaries of various types.

Unit

dxSpellChecker

TdxSpellCheckerDictionaries = class(TCollection)

Description

The TdxSpellCheckerDictionaries object is referenced by the spell checker’s DictionaryItems property.


TdxSpellCheckerDictionaries Hierarchy
Hierarchy

TCollection

     |

TdxSpellCheckerDictionaries


Properties for TdxSpellCheckerDictionaries
TdxSpellCheckerDictionaries Properties

TdxSpellCheckerDictionaries          Legend

In TdxSpellCheckerDictionaries

Items


Methods for TdxSpellCheckerDictionaries
TdxSpellCheckerDictionaries Methods

TdxSpellCheckerDictionaries          Legend

In TdxSpellCheckerDictionaries

 Add


TdxSpellCheckerDictionaries.Items

TdxSpellCheckerDictionaries

Provides indexed access to items in the collection.

property Items[Index:Integer]: TdxSpellCheckerDictionaryItem;

Description

Index specifies the dictionary’s position in the collection.


TdxSpellCheckerDictionaries.Add

TdxSpellCheckerDictionaries

Adds a dictionary item to the collection.

function Add: TdxSpellCheckerDictionaryItem;

Description

The Add method returns a reference to the newly created item.


TdxSpellCheckerDictionaryItem
TdxSpellCheckerDictionaryItem Object

Hierarchy          Properties

Represents a dictionary item in the TdxSpellCheckerDictionaries collection.

Unit

dxSpellChecker

TdxSpellCheckerDictionaryItem = class(TCollectionItem)

Description

The TdxSpellCheckerDictionaryItem object is referenced by the TdxSpellCheckerDictionaries.Items property.


TdxSpellCheckerDictionaryItem Hierarchy
Hierarchy

TCollectionItem

     |

TdxSpellCheckerDictionaryItem


Properties for TdxSpellCheckerDictionaryItem
TdxSpellCheckerDictionaryItem Properties

TdxSpellCheckerDictionaryItem          Legend

In TdxSpellCheckerDictionaryItem

Collection

DictionaryType


TdxSpellCheckerDictionaryItem.Collection

TdxSpellCheckerDictionaryItem

Represents a collection to which the dictionary item belongs.

property Collection: TdxSpellCheckerDictionaries;

ReadOnly Property


TdxSpellCheckerDictionaryItem.DictionaryType

TdxSpellCheckerDictionaryItem

Specifies the dictionary’s type represented by the item.

property DictionaryType: TdxCustomSpellCheckerDictionary;

Description

The spell checker uses three types of dictionaries – ISpell, OpenOffice (Hunspell), and custom (plain text) dictionaries.


TdxSpellCheckerOutlookCheckMode
TdxSpellCheckerOutlookCheckMode Object

Hierarchy          Properties          Methods

Represents the Outlook -style checking mode.

Unit

dxSpellChecker

TdxSpellCheckerOutlookCheckMode = class(TdxSpellCheckerDialogCheckMode)

Description

In this mode, the Outlook-style Spelling dialog is used (see the spell checker’s SpellingFormType property).

The TdxSpellCheckerOutlookCheckMode object is referenced by the spell checker’s CheckMode property.


TdxSpellCheckerOutlookCheckMode Hierarchy
Hierarchy

TPersistent

     |

TdxSpellCheckerCustomCheckMode

     |

TdxSpellCheckerDialogCheckMode

     |

TdxSpellCheckerOutlookCheckMode


Properties for TdxSpellCheckerOutlookCheckMode
TdxSpellCheckerOutlookCheckMode Properties

TdxSpellCheckerOutlookCheckMode          Legend

Derived from TdxSpellCheckerDialogCheckMode

Languages

Derived from TdxSpellCheckerCustomCheckMode

Adapter

LastCode

MisspelledWord

Parser

SpellChecker


Methods for TdxSpellCheckerOutlookCheckMode
TdxSpellCheckerOutlookCheckMode Methods

TdxSpellCheckerOutlookCheckMode          Legend

Derived from TdxSpellCheckerDialogCheckMode

 ShowDialog

Derived from TdxSpellCheckerCustomCheckMode

 Add

 CanUndo

 Change

 ChangeAll

 Delete

 DeleteAll

 GetNextMisspelledWord

 GetSuggestions

 Ignore

 IgnoreAll

 UndoLast


TdxSpellCheckerSuggestion
TdxSpellCheckerSuggestion Object

Hierarchy          Properties

Represents a suggested replacement for a misspelled word.

Unit

dxSpellChecker

TdxSpellCheckerSuggestion = class(TObject)

Description

The TdxSpellCheckerSuggestion provides the suggested replacement (see the Word property), as well as the distance between the misspelled and suggested words (see the Distance property).


TdxSpellCheckerSuggestion Hierarchy
Hierarchy

TObject

     |

TdxSpellCheckerSuggestion


Properties for TdxSpellCheckerSuggestion
TdxSpellCheckerSuggestion Properties

TdxSpellCheckerSuggestion          Legend

In TdxSpellCheckerSuggestion

Dictionary

Distance

Word


TdxSpellCheckerSuggestion.Dictionary

TdxSpellCheckerSuggestion

Returns the dictionary that contains the suggested word.

property Dictionary: TdxCustomSpellCheckerDictionary;

ReadOnly Property


TdxSpellCheckerSuggestion.Distance

TdxSpellCheckerSuggestion

Returns the distance between the misspelled and suggested words.

property Distance: Integer;

Description

The distance specifies the proximity between the misspelled and suggested words.

ReadOnly Property


TdxSpellCheckerSuggestion.Word

TdxSpellCheckerSuggestion

Returns the suggested word.

property Word: WideString;

ReadOnly Property


TdxSpellCheckerSuggestionList
TdxSpellCheckerSuggestionList Object

Hierarchy          Properties          Methods

Represents a collection of suggestions prepared for a misspelled word.

Unit

dxSpellChecker

TdxSpellCheckerSuggestionList = class(TcxObjectList)

Description

The TdxSpellCheckerSuggestionList object is returned by the spell checker’s GetSuggestions method, or it is referenced by the OnGetSuggestions event’s ASuggestions parameter.


TdxSpellCheckerSuggestionList Hierarchy
Hierarchy

TcxObjectList

     |

TdxSpellCheckerSuggestionList


Properties for TdxSpellCheckerSuggestionList
TdxSpellCheckerSuggestionList Properties

TdxSpellCheckerSuggestionList          Legend

In TdxSpellCheckerSuggestionList

Items


Methods for TdxSpellCheckerSuggestionList
TdxSpellCheckerSuggestionList Methods

TdxSpellCheckerSuggestionList          Legend

In TdxSpellCheckerSuggestionList

 Add

 Delete

 FixCapitalization

 RemoveDuplicates

 SaveToStrings

 SortByDistance

 SortByWord


TdxSpellCheckerSuggestionList.Items

TdxSpellCheckerSuggestionList

Provides indexed access to suggestions.

property Items[Index:Integer]: TdxSpellCheckerSuggestion;

Description

Index specifies the suggested word’s position in the collection.

ReadOnly Property


TdxSpellCheckerSuggestionList.Add

TdxSpellCheckerSuggestionList

Adds a suggestion to the suggestions collection.

procedure Add(const AWord: WideString; ADictionary: TdxCustomSpellCheckerDictionary; ADistance: Integer);

Description

AWord specifies the suggested word to be added to the suggestions collection.

ADictionary specifies the dictionary that contains the suggested word.

ADistance specifies the proximity between the misspelled and suggested words.


TdxSpellCheckerSuggestionList.Delete

TdxSpellCheckerSuggestionList

Deletes a suggestion by its index.

procedure Delete(AIndex: Integer);


TdxSpellCheckerSuggestionList.FixCapitalization

TdxSpellCheckerSuggestionList

Analyzes the misspelled word’s case, and converts suggested replacements to the corresponding case.

procedure FixCapitalization(const AMask: WideString);

Description

The FixCapitalization method doesn’t apply transformation to the mixed case words.


TdxSpellCheckerSuggestionList.RemoveDuplicates

TdxSpellCheckerSuggestionList

Deletes duplicated suggestions in the suggestions collection.

procedure RemoveDuplicates;


TdxSpellCheckerSuggestionList.SaveToStrings

TdxSpellCheckerSuggestionList

Writes suggested words from the suggestions collection to strings.

procedure SaveToStrings(AStrings: TStrings);

Description

AStrings specifies strings to which suggested words are to be written from the suggestions collection.


TdxSpellCheckerSuggestionList.SortByDistance

TdxSpellCheckerSuggestionList

Sorts suggestions by distance.

procedure SortByDistance;

Description

The distance specifies the proximity between the suggested and misspelled words.


TdxSpellCheckerSuggestionList.SortByWord

TdxSpellCheckerSuggestionList

Sorts suggestions in alphabetical order.

procedure SortByWord;


TdxSpellCheckerWordCheckMode
TdxSpellCheckerWordCheckMode Object

Hierarchy          Properties          Methods

Represents the Word-style checking mode.

Unit

dxSpellChecker

TdxSpellCheckerWordCheckMode = class(TdxSpellCheckerDialogCheckMode)

Description

In this mode, the Word-style Spelling dialog is used (see the spell checker’s SpellingFormType property).

The TdxSpellCheckerWordCheckMode object is referenced by the spell checker’s CheckMode property.


TdxSpellCheckerWordCheckMode Hierarchy
Hierarchy

TPersistent

     |

TdxSpellCheckerCustomCheckMode

     |

TdxSpellCheckerDialogCheckMode

     |

TdxSpellCheckerWordCheckMode


Properties for TdxSpellCheckerWordCheckMode
TdxSpellCheckerWordCheckMode Properties

TdxSpellCheckerWordCheckMode          Legend

In TdxSpellCheckerWordCheckMode

MisspelledSentence

Derived from TdxSpellCheckerDialogCheckMode

Languages

Derived from TdxSpellCheckerCustomCheckMode

Adapter

LastCode

MisspelledWord

Parser

SpellChecker


Methods for TdxSpellCheckerWordCheckMode
TdxSpellCheckerWordCheckMode Methods

TdxSpellCheckerWordCheckMode          Legend

In TdxSpellCheckerWordCheckMode

 ChangeSentence

Derived from TdxSpellCheckerDialogCheckMode

 ShowDialog

Derived from TdxSpellCheckerCustomCheckMode

 Add

 CanUndo

 Change

 ChangeAll

 Delete

 DeleteAll

 GetNextMisspelledWord

 GetSuggestions

 Ignore

 IgnoreAll

 UndoLast


TdxSpellCheckerWordCheckMode.MisspelledSentence

TdxSpellCheckerWordCheckMode

Returns a misspelled sentence found in the most recent checking action.

property MisspelledSentence: TdxSpellCheckerSentence;

ReadOnly Property


TdxSpellCheckerWordCheckMode.ChangeSentence

TdxSpellCheckerWordCheckMode

Replaces a misspelled sentence specified by the MisspelledSentence property.

procedure ChangeSentence(const ASentence: WideString); virtual;

Description

In the Word-style dialog, the ChangeSentence method updates a sentence that has been changed by an end-user in the Not in Dictionary: box.

Use the ChangeSentence method if you derive a dialog from the Word-style dialog.

ASentence specifies the sentence with which a misspelled sentence is to be replaced.


TdxUserSpellCheckerDictionary
TdxUserSpellCheckerDictionary Object

Hierarchy          Properties          Methods          Events

Represents a user-defined dictionary.

Unit

dxSpellChecker

TdxUserSpellCheckerDictionary = class(TdxCustomSpellCheckerDictionary)

Description

The TdxUserSpellCheckerDictionary is a dictionary of the plain text format.  In these dictionaries, each word is placed on a new line.

With this dictionary type, you can construct your own dictionaries, or even allow end-users to add their specific terms to the properly spelled word lists.

The TdxUserSpellCheckerDictionary object is referenced by the spell checker’s DictionaryItems.DictionaryType property.


TdxUserSpellCheckerDictionary Hierarchy
Hierarchy

TPersistent

     |

TdxCustomSpellCheckerDictionary

     |

TdxUserSpellCheckerDictionary


Properties for TdxUserSpellCheckerDictionary
TdxUserSpellCheckerDictionary Properties

TdxUserSpellCheckerDictionary          Legend

In TdxUserSpellCheckerDictionary

DictionaryPath

Options

Derived from TdxCustomSpellCheckerDictionary

Active

Alphabet

CodePage

Enabled

Loaded

SpellChecker

WordCount


Methods for TdxUserSpellCheckerDictionary
TdxUserSpellCheckerDictionary Methods

TdxUserSpellCheckerDictionary          Legend

In TdxUserSpellCheckerDictionary

 AddWord

 LoadFromStrings

 SaveToStrings

Derived from TdxCustomSpellCheckerDictionary

 Activate

 Clear

 HasWord

 Load

 Unload


Events for TdxUserSpellCheckerDictionary
TdxUserSpellCheckerDictionary Events

TdxUserSpellCheckerDictionary          Legend

Derived from TdxCustomSpellCheckerDictionary

 OnLoaded

 OnLoading


TdxUserSpellCheckerDictionary.DictionaryPath

TdxUserSpellCheckerDictionary          See Also

Specifies the dictionary file from which a user-defined dictionary is loaded, or where the dictionary is stored.

property DictionaryPath: TFileName;

Description

The spell checker saves words to the dictionary file, if the Options property is udSaveOnUnload.


TdxUserSpellCheckerDictionary.Options

TdxUserSpellCheckerDictionary

Contains options for the user-defined dictionary.

type

TdxUserSpellCheckerDictionaryOption = (udFileMustExist, udSaveOnUnload);

TdxUserSpellCheckerDictionaryOptions = set of TdxUserSpellCheckerDictionaryOption;

property Options: TdxUserSpellCheckerDictionaryOptions;

Description

Values include:

Value	Meaning
udFileMustExist	Specifies whether dictionary content is to be loaded from a dictionary file specified by the DictionaryPath property.  If this option is active and the dictionary file is not specified, a runtime exception will be thrown.
udSaveOnUnload	Saves in-memory dictionary content to a dictionary file specified by the DictionaryPath property.  If this option is active and the dictionary file is not specified, a runtime exception will be thrown.

The default value of the Options property is [udSaveOnUnload].


TdxUserSpellCheckerDictionary.AddWord

TdxUserSpellCheckerDictionary          See Also

Adds a word to the dictionary.

procedure AddWord(const AWord: WideString);

Description

AWord specifies the word to be added to the custom dictionary.


TdxUserSpellCheckerDictionary.LoadFromStrings

TdxUserSpellCheckerDictionary

Reads words from strings to the dictionary.

procedure LoadFromStrings(AStrings: TStrings);

Description

AStrings specifies strings from which words are to be loaded into the dictionary.


TdxUserSpellCheckerDictionary.SaveToStrings

TdxUserSpellCheckerDictionary

Writes words from the dictionary to strings.

procedure SaveToStrings(AStrings: TStrings);

Description

AStrings specifies strings to which words are to be written from the dictionary.


dxSpellCheckerDialogs Unit Overview
dxSpellCheckerDialogs Unit

Routines

dxShowCustomDictionaryDialog

dxShowOutlookSpellingDialog

dxShowSpellingOptionsDialog

dxShowWordSpellingDialog


dxShowCustomDictionaryDialog
dxShowCustomDictionaryDialog Function

See Also

Invokes the Custom Dictionary dialog used by end-users for editing words in custom dictionaries.

Unit

dxSpellCheckerDialogs

Declaration

function dxShowCustomDictionaryDialog(ADictionary: TdxUserSpellCheckerDictionary; ALookAndFeel: TcxLookAndFeel = nil): Integer;

Description

If you want to use a custom dialog, derive it from the TdxCustomDictionaryForm (defined in the dxCustomDictionaryDialog unit), and use the dxCustomDictionaryDialogClass constant (defined in the dxSpellCheckerDialogs unit), to inform the spell checker that the custom dialog is to be invoked.

ADictionary specifies the user-defined dictionary whose content is to be edited using the Custom Dictionary dialog.

ALookAndFeel specifies the dialog’s look and feel settings.


dxShowOutlookSpellingDialog
dxShowOutlookSpellingDialog Function

See Also

Invokes the Outlook-style Spelling dialog used by end-users for spelling corrections.

Unit

dxSpellCheckerDialogs

Declaration

function dxShowOutlookSpellingDialog(ASpellChecker: TdxCustomSpellChecker): Integer;

Description

If you want to use a custom dialog, derive it from the TdxCustomSpellCheckerForm or TfmSpellCheckerOutlookForm (these classes are defined in the dxSpellCheckerOutlookDialog unit), and use the dxSpellCheckerOutlookDialogClass constant (defined in the dxSpellCheckerDialogs unit), to inform the spell checker that the custom dialog is to be invoked.

ASpellChecker specifies the spell checker for which the Spelling dialog is to be invoked.


dxShowSpellingOptionsDialog
dxShowSpellingOptionsDialog Function

See Also

Invokes the Spelling Options dialog used by end-users to specify spelling options.

Unit

dxSpellCheckerDialogs

Declaration

function dxShowSpellingOptionsDialog(ASpellChecker: TdxCustomSpellChecker; ALookAndFeel: TcxLookAndFeel = nil): Integer;

Description

If you want to use a custom dialog, derive it from the TfmSpellCheckerSpellingOptionsForm (defined in the dxSpellCheckerSpellingOptionsDialog unit), and use the dxSpellCheckerSpellingOptionsDialogClass constant (defined in the dxSpellCheckerDialogs unit), to inform the spell checker that the custom dialog is to be invoked.

ASpellChecker specifies the spell checker for which the Spelling Options dialog is to be invoked.

ALookAndFeel specifies the dialog’s look and feel settings.


dxShowWordSpellingDialog
dxShowWordSpellingDialog Function

See Also

Invokes the Word-style Spelling dialog used by end-users for spelling corrections.

Unit

dxSpellCheckerDialogs

Declaration

function dxShowWordSpellingDialog(ASpellChecker: TdxCustomSpellChecker): Integer;

Description

If you want to use a custom dialog, derive it from the TdxCustomSpellCheckerForm or TfmSpellCheckerWordForm (these classes are defined in the dxSpellCheckerWordDialog unit), and use the dxSpellCheckerWordDialogClass constant (defined in the dxSpellCheckerDialogs unit), to inform the spell checker that the custom dialog is to be invoked.

ASpellChecker specifies the spell checker for which the Spelling dialog is to be invoked.


Overview

Section_Navigator

The ExpressSpellChecker provides Microsoft® Office® style misspelling correction capability for text-editing controls.

Main features include:

•	Built-in support for ISpell and OpenOffice (Hunspell) dictionaries.

•	Support for user-defined dictionaries – an end-user can add a plain text dictionary to the spell checker in addition to ISpell and OpenOffice dictionaries.

•	Spelling dialog – allows an end-user to correct mistakes in a number of ways, or add new words to a user-defined dictionary while checking the text.  The Spelling dialog comes with two built-in styles – Outlook and Word.  You can extend these dialogs as needed.

•	Support for the Check As You Type spell-checking mode.  This mode is only available for Developer Express text-editing controls (provided by the ExpressEditors Library).  In this mode, errors are underlined while typing and error correction is performed using a customizable built-in context menu.

•	Spelling Options dialog – allows an end-user to specify how error checking is to be performed.