User Tools

Site Tools


tplrtcontrol.htm
Navigation:  »No topics above this level«====== RTFControl control template ====== Return to chapter overview

The RTFControl control template adds a TEXT control to a window. The necessary code is generated and used to manipulate the text within the control as Rich Text.

NoteBox.jpg

This template (and its associated code templates) has been deprecated, and is now replaced by the RTF Text Control template.

Clarion's implementation of Rich Text allows the rich text field to be saved to a STRING, MEMO, or a separate text file. The minimum size of a STRING or MEMO field is 256 characters. This is needed in order to maintain the rich text header information. If the field contains a lot of formatting a larger field size will be needed.

The components of a rich text control include a Toolbar, Format Bar, and Ruler. These components of the rich text control are optional. They may be shown or hidden at runtime. They default to showing at runtime. The bars may not be modified at design time in the window formatter. When the control is placed on the window, it is a basic TEXT control.

Toolbar

The Toolbar provides basic file access, print, search, clipboard operations and save and redo functionality. Any of these operations may be duplicated with the provided code templates.

Format Bar

The Format Bar provides basic text formatting actions. This includes Font, Point Size, Bold, Italics, Underlining, Color, Paragraph justification and bulleting. Any of these operations may be duplicated with the provided code templates.

Ruler

The Ruler provides a way to measure the width of the text. Tab stops may be set on the ruler by clicking on the ruler. To remove a tabstop, click on an existing one.

Requirements

This control template requires the cwRTFGlobal global extension.

Populating the Template

Open the Window Designer for the procedure that will contain the RTF control

1. Open the Control Templates Pad.

2. Highlight RTFControl and drag the control to the window.

3. Click on the window at the position where you want the RTF text control to be placed.

4. Modify the size of the control as desired.

5. RIGHT-CLICK on the TEXT box, and select Actions to set the RTFControl options.

Template Prompts

The RTFControl template provides the following prompts:

Load From File

Specify the .RTF filename to use, or a variable that holds the filename. The .RTF file is used to store the rich text. The variable must be preceeded by an exclamation point (!).

Specify a numeric value to use to limit the amount of text that can be placed into the .RTF file.

Load From Field

Specifies a column in a table that is used to store the rich text data. Use the ellipsis (') to select the column from the table or type in a column name that already exists in the table. If this option is used, RTF text can only be stored using a STRING or MEMO data type.

Limit RTF Size to match field

Check this box to limit the amount of text that can be placed into the rich text control. The limit of the text will be equal to the size of the field. Clear this box in order to not validate the size of the field.

Check status on window close

Check this box to receive a warning if the text in the rich text control has been modified but not saved. Clear the box for no warning to appear.

Display Ruler Bar

Check this box to default the ruler bar on when the window opens. Clear the box to default it off when the window opens.

Display Tool Bar

Check this box to default the tool bar on when the window opens. Clear the box to default it off when the window opens.

Display Format Bar

Check this box to default the format bar on when the window opens. Clear the box to default it off when the window opens.

tplrtcontrol.htm.txt · Last modified: 2021/04/15 15:46 by 127.0.0.1