Using rich text in an application

Rich text format (RTF) is a standard for specifying formatting instructions and document content in a single ASCII document. An editor that supports rich text format interprets the formatting instructions and displays the text with formatting.

In an application, you may want to:

  • Provide a window for preparing rich text documents

    Although not a full-fledged word processor, the RichTextEdit control allows the user to apply formatting to paragraphs, words, and characters.

  • Create a mail-merge application

    You or the user can set up boilerplate text with input fields associated with database data.

  • Display reports with formatted text

    A RichText DataWindow object is designed for viewing data, rather than entering data. It does not have the edit styles of other DataWindow presentation styles.

  • Store rich text as a string in a database and display it in a RichTextEdit control

Sources of rich text

Any word processor

You can prepare rich text in any word processor that can save or export rich text format.

Input fields in PowerBuilder only

Although many word processors support some kinds of fields, the fields are usually incompatible with other rich text interpreters. If you want to specify input fields for a PowerBuilder application, you will have to insert them using the PowerBuilder RichTextEdit control.

Rich text in the database

Since rich text is represented by ASCII characters, you can also store rich text in a string database column or string variable. You can retrieve rich text from a string database column and use the PasteRTF function to display the text with formatting in a RichTextEdit control.

Language of rich text

English is the currently recommended language for the rich text, as only English is fully tested in 2017 R2. The other languages will be listed here after they are fully tested in the future versions.

Selecting a rich text editor

Two rich text editors

You can select from the two rich text editors provided by Appeon PowerBuilder. The selected rich text editor will be applicable to the RichTextEdit control, the RichText DataWindow object, and the RichText edit style.

  • The built-in rich text editor (default editor)

    Starting from PowerBuilder 2017, a new built-in rich text editor is provided for free use by the PowerBuilder developer and the InfoMaker developer. This new editor provides the same functions/events/properties as the old one.

  • The old rich text editor (TX Text Control editor)

    This is the editor used in PowerBuilder 12.6 and earlier versions. If you want to continue using and distributing this editor in PowerBuilder 2017 and later, you will have to purchase it separately from the vendor (http://www.textcontrol.com) and follow the vendor's documentation to package and distribute it to your users.

    Only TX Text Control ActiveX X14 (Professional or Enterprise edition) is supported by PowerBuilder 2017 and later. Standard edition is not supported.

    The 2400 SP1, 2400 SP2, and 2400 SP3 of TX Text Control ActiveX X14 do not support the RichText edit style any more, although it supports the RichTextEdit control and the RichText DataWindow object. You should use TX Text Control ActiveX X14 2400 for supporting all these three features.

To select a rich text editor:

  1. In the Application painter, select the General tab page.

  2. On the General tab page, click the Additional Properties button to display the Application properties dialog box.

  3. In the Application properties dialog box, select the RichTextEdit Control tab, and then select a rich text editor.

    Built-in Control is selected by default.

  4. Input a valid serial number if you selected to use the TX Text Control ActiveX editor.

  5. Click OK.

Deploying a rich text application

To deploy a rich text application to a server or client machine:

  • If using the built-in text editor, you can use the PowerBuilder Runtime Packager to deploy the required rich text files with your application.

    For more information on the runtime packager, see PowerBuilder Runtime Packager.

  • If using the old editor (TX Text Control ActiveX), you must follow the vendor's documentation to deploy the required files with your application.