New Features and Update Notes

TX Text Control 16.0 provides the following new features:

Windows Presentation Framework

TX Text Control now supports the development of WPF applications (.exe) and WPF browser applications (.xbap). Four new controls WPF.TextControl, WPF.ButtonBar, WPF.RulerBar and WPF.StatusBar have been added to the TX Text Control class library. They can be found in the new TXTextControl.WPF namespace. These controls offer the same feature set as the Windows Forms controls.

Ribbon Support

TX TextControl provides now support for ribbon user interfaces. The new InputFormat class contains a large set of properties representing all character and paragraph formatting attributes at the text input position. The TextControl.InputFormat and WPF.TextControl.InputFormat properties provide access to these properties. All properties are automatically updated, when the input position changes so that the class can be used in a XAML data binding without code behind. The chapter Data binding with TX Text Control show how to use this class. Additionally the Selection class has been extended with the IncreaseIndent, DecreaseIndent, GrowFont and ShrinkFont methods.

Table Header

A header can be defined for each table in a TX Text Control document. A table header consists of one or more table rows, which are repeated on top of each page when a single table extends over several pages. The table attributes dialog box has been extended so that an end-user can define a table header. The new TableRow.IsHeader property can be used to set this feature programmatically. If a header is defined for a table which extends over several columns of a page, the header is displayed on top of each column.

Windows Forms Browser Applications

The Windows Forms TextControl can now be used in a browser-based application with the same functionality as in a Windows Forms application including loading and saving files on the client machine with every supported format. The BrowserTextControl and its toolbars are therefore no longer necessary and have been removed from the TXTextControl class library.

Spell Checking

TX Text Control provides a new spell checker interface so that every spell checker can easily be used with a TextControl, ServerTextControl or WPF.TextControl. Every time the text of a document changes a SpellCheckText event is raised. The event's data contains the text that must be checked on misspelled words. The event's data can receive an array of MisspelledWord objects to inform TextControl about the positions of all misspelled words. These words are underlined with a red zigzag line. Spell checking is only active, if the IsSpellCheckingEnabled property has been set to true. A programmer has access to all misspelled words in the document through a MisspelledWordCollection, which can be obtained with the TextControl.MisspelledWords, ServerTextControl.MisspelledWords and WPF.TextControl.MisspelledWords properties. Similar properties are available for headers, footers and text frames. In text fields spell checking can be disabled with the TextField.IsSpellCheckingEnabled property.

Mail Merge

The DocumentServer.MailMerge class now supports merging of nested blocks. The component recursively descents into the tree structure and merges the contained fields with the corresponding relational data. Also, it is now possible to merge images into merge fields that have been prefixed with the string "image:". This allows to always merge the most recent version of a company logo into templates, for instance. Furthermore, the events now are all in line. DocumentServer.MailMerge.DataRowMergedEventArgs and DocumentServer.MailMerge.FieldMergedEventArgs now allow for subsequently changing the merged data using the internal TX Text Control Unicode format. Similarly, the new DocumentServer.MailMerge.ImageFieldMergedEventArgs allow to access the merged image as instance of the Image class.

Text Part Collection

A TX Text Control document consists of the document's main text and additional pieces of text like text frames and headers and footers. To provide easy access to all of these text parts TX Text Control offers the new TextPartCollection class. An instance of the this class contains all text parts in a TX Text Control document. A text part can either be the document's main text, a text frame or a header or footer. A text frame is represented through a TextFrame object, a header or footer through a HeaderFooter object and the document's main text is represented through a MainText object. A TextPartCollection object contains all these objects in a geometric order. The first object in the collection is the main text, followed by all text frames in geometric order. At the end of the collection all headers and footers are contained also geometrically ordered. All objects in a text part collection implement the IFormattedText interface. The collection can be obtained with the TextControl.TextParts, WPF.TextControl.TextParts or ServerTextControl.TextParts property. The collection provides an Activate method to set the current input position to a certain text part and the GetItem method to get the currently activated part.

IFormattedText Interface

The IFormattedText interface contains properties and methods common to all text parts in a TX Text Control document. A TX Text Control document consists of the document's main text and additional pieces of text such as text frames and headers and footers. A single text part has lines, paragraphs, characters and a selection which can be used to assign character and paragraph formatting attributes to a piece of text. Additionally, a text part can contain tables, images, text fields, hypertext links and misspelled words. The following classes implement this interface: TextControl, ServerTextControl, WPF.TextControl, TextFrame, HeaderFooter and MainText.

The MainText Class

The new MainText class represents the main text of a TX Text Control document. Differently from the TextControl or WPF.TextControl classes, the MainText object's collections of the IFormattedText interface do not depend on the input focus. For example, the TextControl.Tables collection contains the tables of the main text, if the main text has the input focus, but it contains the tables of the text frame, if a text frame has the input focus. The MainText.Tables collection always contains the tables of the main text regardless of the input focus.

PageMargins Class

The property type of the PageMargins.Left, PageMargins.Top, PageMargins.Right and PageMargins.Bottom properties has been changed from int to double.

TextControl.PageSize Property

The property type has been changed from System.Drawing.Size to PageSize.

ServerTextControl.PageSize Property

The property type has been changed from System.Drawing.Size to PageSize.

Selection.Load Method

The return value of the methods, which open a dialog box has been changed from System.Windows.Forms.DialogResult to Selection.DialogResult.

BrowserTextControl Class

This class has been removed. Each occurence can be replaced with the TextControl class.

BrowserButtonBar Class

This class has been removed. Each occurence can be replaced with the ButtonBar class.

BrowserRulerBar Class

This class has been removed. Each occurence can be replaced with the RulerBar class.

BrowserStatusBar Class

This class has been removed. Each occurence can be replaced with the StatusBar class.

TX Text Control Assemblies

The TXTextControl.dll assembly has been divided into TXTextControl.dll and TXTextControl.Windows.Forms.dll.