What's New in TX Spell .NET for Windows Forms 3.0
Better suggestions and a user interface you can adapt are what TX Spell .NET for Windows Forms 3.0 brought. A new suggestion engine weighs how typos happen on a keyboard, a spell check dialog of its own works with any control, and events, context menu items and dictionaries from memory open the spell checker to code of your own.
Version 3.0 was released on September 12, 2012, for Windows Forms and WPF, as the blog article TX Spell .NET 3.0 Released: New Suggestion Engine, Customizable Dialog announced. Unlike the versions after it, it came out on its own, a few weeks after TX Text Control X8. The features below are the ones added since version 2.0; Version 4.0 followed in November 2013.
Version 3.0 at a Glance
| Area | What is new |
|---|---|
| Suggestions | Ranking that measures the distance between keys on the keyboard |
| Spell check dialog | A customizable SpellCheckDialog for TX Text Control and other controls |
| Events | Events for dictionaries, user dictionary words, dialog buttons, menu items and word changes |
| Dictionaries | Dictionaries loaded from and saved to string arrays |
| Context menus | GetMenuItems, which returns ready-made menu items |
| Code without a user interface | The TXSpell class |
| Service packs | Service Pack 1 in November 2012 and Service Pack 2 in June 2013 |
Suggestion Quality
Text Control reworked how suggestions for a misspelled word are found and ranked. The suggestion engine measures the distance between the keys of the keyboard in use and rates the candidates by it, so a typo caused by hitting a neighboring key ranks its intended word high. In Text Control's tests with thousands of documents, the expected word was ranked first or second in more than 97 percent of the cases.
The preview article Upcoming TX Spell .NET 3.0 Features gives the background: the goal had been more than 90 percent, and the test data came from internal chat protocols and documents with typical typos. Incorrect Words and Suggestions shows how suggestions are created today.
The Spell Check Dialog
Before version 3.0, the spell check dialog was part of TX Text Control. Version 3.0 brought a dialog of its own, which you open with Show of the object that TXSpellChecker.SpellCheckDialog returns:
- Any control. The dialog checks a TX Text Control, a
RichTextBox, aTextBoxor aGridView, and one dialog can check several controls in a single pass. - Customizable. Its buttons are DialogButton objects in three collections,
ChangeButtons,IgnoreButtonsandOptionButtons, which you can rename, disable, remove or extend with buttons of your own. ThePreview, theSuggestionListand theSuggestionDictionaryComboBoxhave settings of their own, such as the color of the incorrect word and the maximum number of suggestions. - Controlled by events.
SpellCheckDialogOpening,SpellCheckDialogClosingandDialogButtonClickedpass a SpellCheckDialogStateManager, which tells which word comes next and can set another one or close the dialog. - Options. OptionsDialog opens the built-in options dialog, and
OptionsDialogOpeningcan cancel it, for example to show a dialog of your own.
Spell Check Dialog, Customizing the Spell Check Dialog and Checking Multiple Controls describe the dialog as it works today.
New Events
Version 3.0 raises events when something changes in the spell checker:
- Dictionaries. DictionaryAdded and
DictionaryRemovedoccur when a dictionary is added to or removed fromDictionaries. - User dictionaries. UserDictionaryWordAdded and
UserDictionaryWordRemovedoccur when a word is added to or removed from a user dictionary. - Word changes.
IncorrectWordChangingandMisspelledWordChangingoccur when the dialog or the context menu is about to change a word, in a text or in a TX Text Control. - User interface. DialogButtonClicked and
MenuItemClickedoccur when the user clicks a button of the dialog or an item of the context menu.
Events lists all events of today's version.
Dictionaries From Memory
Dictionaries no longer have to be files. A new constructor of OpenOfficeDictionary takes the lines of the .dic and the .aff file as string arrays, together with the language, and user dictionaries can be loaded from and saved to string arrays as well. This lets dictionaries come from a database or from resources embedded in an assembly. The blog article TX Spell .NET 3.0: Loading Dictionaries from Embedded Resources showed this at the time; Loading and Managing Dictionaries and User Dictionaries show it with today's API.
About the Member List
The What's New documentation of version 3.0 counts the TXSpellChecker class and members such as CreateSuggestions, Suggestions and Dictionaries among the new ones, although blog articles published before the release, such as TX Spell .NET: Creating Custom Context Menus, already use them before version 3.0 was released. The list below follows the documentation of version 3.0 and shows the API of TX Spell .NET as it stood with that version.
Service Packs
| Service pack | Released | Setup |
|---|---|---|
| Service Pack 1 | November 22, 2012 | A new full version setup, installed with Repair |
| Service Pack 2 | June 25, 2013 | TX Spell .NET for Windows Forms 3.0 SP2.exe |
Service Pack 1 made version 3.0 compatible with Visual Studio 2012, as the blog article TX Spell .NET 3.0 SP1 - Visual Studio 2012 Compatibility Pack Released described. Service Pack 2 fixed known issues; TX Spell .NET 3.0 Service Pack 2 Released announced it. The download package holds no separate setup for Service Pack 1. Its setup of Service Pack 2 is dated June 24, 2013, and the full installer of version 3.0, TX Spell .NET for Windows Forms 3.0.exe, June 18, 2013.
New Classes, Properties, Methods and Events
These are the classes and members that the What's New documentation of version 3.0 lists. All names are relative to the TXTextControl.Proofing namespace, and each links to its current reference page.
New Classes
- DialogButton
- DialogButtonCollection
- DialogButtonEventArgs
- DictionaryAddedEventArgs
- DictionaryCollection
- DictionaryRemovedEventArgs
- IncorrectWordChangingEventArgs
- MenuItem
- MenuItemClickedEventArgs
- MisspelledWordChangingEventArgs
- OptionsDialogOpeningEventArgs
- Preview
- SpellCheckDialog
- SpellCheckDialogClosingEventArgs
- SpellCheckDialogOpeningEventArgs
- SpellCheckDialogStateManager
- SpelledWord
- SuggestionDictionaryComboBox
- SuggestionList
- TXSpell
- TXSpellChecker
- UserDictionaryWordAddedEventArgs
- UserDictionaryWordRemovedEventArgs
Members by Class
Next Steps
- Version 4.0: the version that followed, with hyphenation.
- Spell Check Dialog: the dialog in today's version.
- Context Menus: menus built with
GetMenuItems. - Older Versions: all versions from 3.0 to 6.0.