What's New in TX Text Control .NET for Windows Forms 20.0
Right-to-left languages such as Arabic and Hebrew arrived in TX Text Control .NET for Windows Forms with version 20.0, both in the text and in the design of the controls. The version also formats text for a language, hyphenates it with TX Spell .NET and merges business objects and data relations in MailMerge.
Version 20.0 was released in November 2013 as TX Text Control X10, together with TX Spell .NET 4.0 and TX Barcode .NET 3.0. The press release Press Release: TX Text Control X10 Released - Reporting and Right-to-Left Support also says that all components became fully compatible with multi-threading, which speeds up the creation of documents in batches. The WPF controls received the same right-to-left design, language support and buttons; they are part of TX Text Control .NET for WPF.
Version 20.0 at a Glance
| Area | What is new |
|---|---|
| Right-to-left text | Bidirectional lines, right-to-left paragraphs, Arabic Kashida justification |
| Right-to-left design | Mirrored text control, ruler bar, button bar, status bar, dialog boxes and context menus |
| Languages | A language for each piece of text, a language dialog box, the language in the status bar |
| Hyphenation | Automatic hyphenation with TX Spell .NET 4.0 |
| Button bar | Buttons for more font attributes, font sizes, indents and the writing direction |
| Mail merge | Data relations in every Merge overload, MergeObjects, image merging by name, NEXT and NEXTIF fields, report data source configurations |
| Page images | Images of pages with the elements shown on screen |
Right-to-Left Text
- Bidirectional lines. A line can contain text written from left to right and text written from right to left. Behind a left-to-right character, the input position is on its right side; behind a right-to-left character, it is on its left side.
- Paragraph direction. ParagraphFormat.Direction formats a paragraph from right to left with the Direction value
RightToLeft, so that its blocks of bidirectional text are ordered from right to left. The paragraph formatting dialog box offers the same setting to users. In such a paragraph, a tab position is measured from the right page margin, and the natural alignment and the natural tab kind are right-aligned. The horizontal ruler bar shows the origin at the right page margin. - Change the direction. Selection.ChangeDirection changes the writing direction of the selected paragraphs. It swaps left and right alignment and left and right tabs; centered and justified paragraphs keep their alignment.
- Kashida justification. Justified Arabic text can be stretched with Kashida lines instead of, or in addition to, wider spaces. ParagraphFormat.Justification takes a Justification value:
Spaces,KashidaorSpacesAndKashida. - Input format. InputFormat.LeftToRight and InputFormat.RightToLeft tell the direction at the input position.
Text and Paragraph Formatting shows how to format paragraphs in the current version.
Right-to-Left Application Design
Every control of TX Text Control .NET for Windows Forms supports the RightToLeft property for applications with a right-to-left design:
- Text control. A TextControl shows its vertical scroll bar at the left border and zooms from the top right corner.
- Bars. The RulerBar shows a right-to-left ruler, and the ButtonBar and the StatusBar arrange their buttons and text parts from right to left.
- Dialog boxes and context menus. All built-in dialog boxes and context menus are shown with a right-to-left design.
Right-to-Left UI describes the right-to-left design of the current version.
Languages and Hyphenation
- Languages. Any piece of text can be formatted for a language with Selection.Culture, so that one document can contain several languages. The language is used for spell checking and hyphenation, and all text filters keep it when they load and save documents in other formats. MisspelledWord.Culture and SpellCheckTextEventArgs.Culture give the language of a misspelled word and of the text to check.
- Language dialog box. TextControl.LanguageDialog opens a built-in dialog box in which users get or set the language of the selected text or of the input position. StatusBar.ShowLanguage shows the language at the input position in the status bar.
- Hyphenation. With TX Spell .NET 4.0 connected through TextControl.SpellChecker and TextControl.IsHyphenationEnabled set to
true, words that don't fit on a line are hyphenated. For each word, the spell checker calculates where to divide it, and the HyphenateWord event passes that position in its HyphenateWordEventArgs. A handler can change DividePos, up to MaxDividePos, for the Word in its Culture.ServerTextControlhas the same property and event.
Spell Checking and Hyphenation covers spell checking and hyphenation in the current version.
Button Bar
The ButtonBar received predefined buttons for strikeout, subscript and superscript text, for growing and shrinking all font sizes of a selection, for increasing and decreasing the paragraph indents and for switching the writing direction between left-to-right and right-to-left. See Toolbars and Mini Toolbars.
Mail Merge
MailMerge creates documents from a template and data. Version 20.0 extended it considerably:
- Data relations in every overload. All overloads of Merge process the relations between the tables of the data, which makes master-detail templates such as invoices with line items easier to merge. MergeBlocks is obsolete: it needed an extra merge block around the whole document for the same result.
- Business objects. MergeObjects takes any collection of objects as the data source. See Objects and Collections.
- Images. Images in the template are replaced by name with the image data of the column of the same name and scaled to the width of the placeholder image. The column holds a byte array,
System.Drawing.Imageobjects, file names or hexadecimal strings that start withX'. The ImageMerged event passes an ImageMergedEventArgs object. Column names of image merge fields no longer need the prefiximage:, which still works. See Images and Barcodes. - Formats of merge fields. MergeField.DateTimeFormat and MergeField.NumericFormat hold the date and time format and the numeric format of a MERGEFIELD, which its field dialog box can now set.
- NEXT and NEXTIF fields. The adapters NextField and NextIfField implement the MS Word fields NEXT and NEXTIF. See Conditional Content.
- Report data source configurations. ReportDataSourceConfigFile takes the path of a report data source configuration file (.rdsc) created with TX Text Control Words, and ReportDataSourceConfig takes the same content as an XML string. See Data Source Configuration Files.
- Template file. TemplateFile sets the path of the template, instead of calling
LoadTemplate. The format is taken from the file extension.
Pages and Input Position
- Screen elements in page images. The PageContent value
ScreenElementsmakes Page.GetImage include what a screen shows in addition to the text, such as the selection, control characters and helper lines. - Caret size. InputPosition.CaretSize gets the size of the caret at the input position, in pixels.
Upgrade to Version 20.0
- MergeBlocks.
MailMerge.MergeBlocksis obsolete. Merge templates withMergeand pass the data with its relations. Deprecated APIs describes the replacement. - PageContent. The PageContent enumeration has the new value
ScreenElements.
New Classes, Properties, Methods and Events
The classes and members below are the ones that the What's New documentation of version 20.0 lists for TX Text Control .NET for Windows Forms. Names are relative to the TXTextControl namespace, each name links to its current reference page, and "(obsolete)" marks a member that is obsolete today.
New Classes
- DocumentServer.Fields.NextField
- DocumentServer.Fields.NextIfField
- DocumentServer.MailMerge.ImageMergedEventArgs
- HyphenateWordEventArgs
Members by Class
Next Steps
- Version 21.0: the features of the next version.
- Version 19.0: barcodes, even and odd headers and footers, context menus and page numbering.
- Right-to-Left UI: right-to-left applications in the current version.