Wintertree Software Inc.

Sentry Spelling Checker Engine - Technical Support

Home Site index Contact us Catalog Shopping Cart Products Support Search

You are here: Home > Support > Sentry Spelling Checker Engine


How to prevent MainLexFiles from being reset after Options dialog box displayed

Product: Sentry Spelling Checker Engine Windows SDK

Version: 5.11 - 5.14

Problem: The MainLexFiles property is reset after the Options dialog box is displayed. The problem occurs in the following scenario: MainLexFiles is initially set to a default value, such as "ssceam.tlx,ssceam2.clx". MainLexFiles is changed, either by calling SSCE_SetMainLexFiles or by setting the property in the system registry or INI file, to some other value, such as "ssceam.tlx,ssceam2.clx,mylex.tlx". After the Options dialog box is opened, MainLexFiles is set back to the default value ("ssceam.tlx,ssceam2.clx").

Description: This behavior is partly by design, although it may be changed in future releases. The Options dialog box contains a Main Dictionary Language list box. When the Options dialog box is closed by clicking the OK button, the MainLexFiles property is set to the list of lexicon files associated with the selected language in the Main Dictionary Language list box. For example, if the user selects "American English" as the main dictionary language, MainLexFiles would be set (by default) to "ssceam.tlx,ssceam2.clx". It is possible to specify a different list of files for association with a main dictionary language selection, so MainLexFiles could be set to (for example) "am1.tlx,am2.clx,am3.tlx" when "American English" is selected as the main dictionary language. By default, the list of lexicon files associated with American English is "ssceam.tlx,ssceam2.clx", and this is why MainLexFiles appears to be reset after the Options dialog box is displayed.

Solution: The solution is to change the list of lexicon files associated with a Main Dictionary Language selection so your set of files will be used when the Options dialog box is displayed. The behavior of the Main Dictionary Language list can be modified through special properties set in the system registry or INI file. The property names are preceded by a two-character language code such as "am" for American English, "fr" for French, etc. See "Language Codes" in the Core API Reference chapter of the Programmer's Guide for a complete list.

You can change the list of lexicon files associated with a particular language by defining a property named xx.MainLexFiles, where xx is a 2-letter code from the list mentioned in the previous paragraph. For example, to have the Sentry DLL open ssceam.tlx, ssceam2.clx, and mylex.tlx when American English is selected as the language, create the following property in the registry or INI file:

am.MainLexFiles = "ssceam.tlx,ssceam2.clx,mylex.tlx"

When this property is defined, the Sentry DLL will set MainLexFiles to "ssceam.tlx,ssceam2.clx,mylex.tlx" when the OK button is clicked in the Options dialog box and American English is selected in the Main Dictionary Language list box. Another example: To open uk1.tlx, uk2.clx, and uk3.tlx when British English is selected, create the following property:

br.MainLexFiles = "uk1.tlx,uk2.clx,uk3.tlx"

More information on the special properties that modify the behavior of the Main Dictionary Language list box is available in the Sentry programmer's guide: Sentry Windows API Reference / Sentry Properties / Main Dictionary Language Properties (located at the end of the list of properties; in some versions of the programmer's guide the heading "Main Dictionary Language Properties" does not appear, but the description begins with the text "In addition to the properties listed above...").


Home Site index Contact us Catalog Shopping Cart Products Support Search


Copyright © 2015 Wintertree Software Inc.