RichTextEdit control
A RichTextEdit control contains a document that it displays as
formatted text. It can include input fields that are linked to a
DataWindow control. When a DataWindow’s data is shared with the
RichTextEdit control, there is one instance of the document in the control
that can be displayed multiple times with different occurrences of row
data. Input fields whose names match columns in the DataWindow are filled
with data from the current row.
RichText editors
You can select from the rich text editors supported by Appeon
PowerBuilder. The selected rich text editor will be applicable to the
RichTextEdit control, the RichText DataWindow object, and the RichText
edit style. For more information about the rich text editors, see the section called “Rich text editors” in Application Techniques; and
for feature difference of the rich text editor, see the section called “Feature difference between TX Text Control (64-bit) and
Microsoft RichEdit Control (64-bit)” in Application Techniques.
Using with animation features
RichTextEdit controls may not paint correctly when you use
animation features.
Properties
|
RichTextEdit property |
Datatype |
Description |
|---|---|---|
|
Integer |
Specifies the ASCII value of the accelerator key |
|
|
String |
A description of the control and/or its purpose for |
|
|
String |
A label that briefly describes the control, such as |
|
|
AccessibleRole (enumerated) |
Describes what kind of user interface element the |
|
|
Long |
Specifies the numeric value of the background color |
|
|
Boolean |
Specifies whether the control has a border. Values TRUE — Has a border. FALSE — Does |
|
|
BorderStyle (enumerated) |
Specifies the style of the border of the control. StyleBox! StyleLowered! StyleRaised! StyleShadowBox! |
|
|
Long |
Specifies the width of the bottom margin on the |
|
|
Boolean |
Specifies whether PowerBuilder moves the control to TRUE — Moves it to the top. FALSE |
|
|
ClassDefinition |
PowerObject |
An object of type PowerObject containing |
|
Boolean |
Specifies whether control characters (carriage TRUE — Control characters are FALSE — Control characters are |
|
|
Boolean |
Specifies whether users can make changes to the TRUE — The content, including FALSE — The user can edit the |
|
|
String |
Specifies the name that displays in the print queue |
|
|
Boolean |
(Obsolete) This property is no longer supported by Specifies whether PowerBuilder puts the TRUE — When the control is clicked, the FALSE — When |
|
|
String |
Specifies the name of the stock icon or the file When the user drags the control, the |
|
|
Boolean |
Specifies whether the control is enabled (can be TRUE — Can be FALSE — Cannot be |
|
|
String |
Specifies the typeface used for text in the |
|
|
FontCharSet (enumerated) |
Specifies the character set for text in the |
|
|
FontFamily (enumerated) |
Specifies the font family for text in the |
|
|
FontPitch (enumerated) |
Specifies the spacing of the font used for text in |
|
|
Boolean |
Specifies whether the RichTextEdit control has a TRUE — The control has a header/footer FALSE — The control does not have a If a document has a header or |
|
|
Integer |
Specifies the height of the control, in |
|
|
Boolean |
Specifies whether the RichTextEdit control has a TRUE — A scroll FALSE — A scroll bar does not |
|
|
ImeMode |
Integer |
Specifies the input method editor mode. This |
|
Long |
Specifies default background color for all input Limitation with the new |
|
|
Boolean |
Specifies whether input field names are displayed TRUE — Input fields display their FALSE — Input fields display their |
|
|
Boolean |
Specifies whether input fields are visible. Values TRUE — Input fields are FALSE — Input fields are |
|
|
Boolean |
Specifies default text formatting. Values TRUE — Text displays in italic FALSE — Text displays in standard Maintained for forward compatibility with |
|
|
Long |
Specifies the width of the left margin on the |
|
|
Modified |
Boolean |
Specifies whether the document has been modified TRUE — The document has been FALSE — The document has not been When the first change is made to a newly |
|
Long |
Specifies the value for the display height of pages |
|
|
PaperOrientation(enumerated) |
Specifies the page orientation in the |
|
|
Long |
Specifies the value for the display width of pages |
|
|
Boolean |
(Obsolete) This property is no longer supported by When the value is true, graphics (bitmaps) are |
|
|
String |
Specifies the name of the stock pointer of the file |
|
|
Boolean |
Specifies whether the user has access to a pop-up TRUE — Pop-up menu FALSE — Pop-up menu is |
|
|
Boolean |
Specifies whether the user can resize the control. TRUE — Control is FALSE — Control is not |
|
|
Long |
Specifies the width of the right margin on the |
|
|
Boolean |
Specifies whether a ruler bar is visible above the TRUE — FALSE — Ruler bar is If the RichTextEdit pop-up menu is enabled, |
|
|
Long |
Specifies the starting position in a selected text |
|
|
Long |
Specifies the length of text you want to highlight |
|
|
StatusBar |
Boolean |
Specifies whether a status bar is visible below the TRUE — Status bar is FALSE — Status bar is If the pop-up menu is enabled, the user can |
|
Integer |
Specifies the tab value of the control within the Note that because a RichTextEdit allows |
|
|
String |
Specifies the tag value assigned to the |
|
|
Integer |
Specifies the point size of text in the |
|
|
Boolean |
Specifies whether a tool bar for formatting text is TRUE — FALSE — Tool bar is not If the pop-up menu is enabled, the user can |
|
|
Long |
Specifies the width of the top margin on the |
|
|
Boolean |
Specifies default text formatting. Values TRUE — Text displays with FALSE — Text displays without Maintained for forward compatibility |
|
|
Boolean |
Specifies whether the control is TRUE — Control is FALSE — Control is not |
|
|
Boolean |
Specifies whether the RichTextEdit control has a TRUE — A scroll FALSE — A scroll bar does not |
|
|
Integer |
Specifies default text weight formatting for the |
|
|
Integer |
Specifies the width of the control, in PowerBuilder |
|
|
Boolean |
Determines whether large blocks of text that do not TRUE — Automatic FALSE — Automatic word wrap Limitation with the new control: For the new |
|
|
Integer |
Specifies the X position (the distance from the |
|
|
Integer |
Specifies the Y position (the distance from the top |
Events
|
RichTextEdit event |
Occurs |
|---|---|
|
Immediately before the Open event occurs in the |
|
|
Immediately after the Close event occurs in the |
|
|
When the user double-clicks anywhere in the |
|
|
When a dragged control is dropped on the |
|
|
When a dragged control enters the |
|
|
When a dragged control leaves the |
|
|
When a dragged control is within the |
|
|
When the document in the RichTextEdit is saved to a |
|
|
Just before the control receives focus (before it |
|
|
When the user presses the F1 key or drags the |
|
|
When the user selects an input field by |
|
|
When the user presses a key. |
|
|
When the control loses focus (becomes |
|
|
When the first change is made to the contents of In the Modified event script, you can set a |
|
|
When the left or middle mouse button is pressed on |
|
|
When the mouse has moved within the |
|
|
When the left or middle mouse button is released on |
|
|
When a Windows message occurs that is not a |
|
|
When the user selects a picture by clicking |
|
|
When the right mouse button is pressed on the |
|
|
When the right mouse button is released on the |
Functions
|
RichTextEdit function |
Datatype returned |
Description |
|---|---|---|
|
Boolean |
Returns true if the edit that was previously undone |
|
|
Boolean |
Returns true if there is an editing function that |
|
|
String |
Returns the name assigned to the |
|
|
Long |
Clears selected text (if any) from the control, but |
|
|
Long |
Clears all content from the specified control, but |
|
|
Long |
Copies (but does not delete) the selected contents |
|
|
String |
Copies the selected contents of the RichTextEdit |
|
|
Long |
Cuts (deletes) the selected contents from the |
|
|
Integer |
Associates a DataWindow with the RichTextEdit |
|
|
Integer |
Starts or ends dragging of the |
|
|
Integer |
Finds text in the control. Enhancement |
|
|
Integer |
Finds the next occurrence of text specified with |
|
| FormCheckBoxGetChecked | Boolean | Gets the checked status of the checkbox form field at the given field ID. |
| FormCheckBoxInsert | Integer | Inserts a checkbox type form field at the current text input position in a RichTextEdit control. Users can click the checkbox form field to change the field value if necessary. |
| FormCheckBoxSetChecked | Integer | Sets the checked status of the checkbox form field at the given field ID. |
| FormComboBoxGetItems | Integer | Gets the list of items from the dropdown of a combobox field. |
| FormComboBoxInsert | Integer | Inserts a combobox type form field at the current text input position in a RichTextEdit control. A combobox has a list of items in its dropdown and text in its edit field. After a combobox is inserted, the edit field shows the text. If a user clicks at the text, the combobox will display with the list of items. |
| FormComboBoxSetItems | Integer | Sets the list of items to display for the dropdown of a combobox field. |
| FormDateFieldGetDate | Date | Gets the date value displayed in the date form field. |
| FormDateFieldGetFormat | String | Gets the date format used for displaying the date in the date form field. |
| FormDateFieldInsert | Integer | Inserts a date type form field at the current text input position in a RichTextEdit control. A date field shows a date in its edit field. After a date field is inserted, if a user clicks at the date, a date-picking control will display for selecting a different date. |
| FormDateFieldSetDate | Integer | Sets the date value to display in the date form field. |
| FormDateFieldSetFormat | Integer | Sets the date format for displaying the date in the date form field. |
| FormFieldDelete | Integer | Deletes the specified form field. |
| FormFieldGetCurrent | Integer | Gets the ID of the current form field. |
| FormFieldGetDeletable | Integer | Gets the deletable setting of the specified form field. |
| FormFieldGetEmptyWidth; | Integer | Gets the empty width (that is, the width of the field when there is no text displayed) set for a form field. |
| FormFieldGetEnd | Integer | Gets the end position of the specified form field. |
| FormFieldGetStart | Integer | Gets the starting position of the specified form field. |
| FormFieldGetText | Integer | Gets the text being displayed for a form field. |
| FormFieldNext | Integer | Finds the next form field after the specified form field. |
| FormFieldSetCurrent | Integer | Sets a form field as current. |
| FormFieldSetDeletable | Integer | Sets whether a form field is deletable by pressing the keyboard key. |
| FormFieldSetEmptyWidth | Integer | Sets the empty width (that is, the width of the field when there is no text displayed) for a form field. |
| FormFieldSetText | Integer | Sets the display text for a form field. |
| FormTextFieldInsert | Integer | Inserts a text type form field at the current text input position in a RichTextEdit control. |
|
Alignment |
Obtains the alignment of the selected |
|
|
Integer |
Creates a reference to a context-specific instance |
|
|
Long |
Gets the size of the indentation, left margin, or |
|
|
PowerObject |
Returns a reference to the name of the parent |
|
|
Spacing |
Obtains the line spacing of the selected |
|
|
Long |
Returns the color of the selected |
|
|
Boolean |
Obtains font settings for the selected |
|
|
Integer |
Makes the control invisible. |
|
|
Integer |
Modifies the data value for all input fields of the |
|
|
String |
Gets the name of the selected input |
|
|
Integer |
Deletes the current occurrence of the selected |
|
|
String |
Obtains the data in the specified input |
|
|
Integer |
Inserts the named input field at the insertion |
|
|
String |
Locates an input field. You can find any occurrence |
|
|
Integer |
Inserts the named file in the RichTextEdit control. |
|
|
Integer |
Inserts the specified bitmap or picture file at the The inserted WMF image file will |
|
|
Boolean |
Checks whether the RichTextEdit control is in |
|
|
Integer |
Returns the total number of lines in the |
|
|
Integer |
Returns the length of the current |
|
|
Integer |
Moves the control to a specified |
|
|
Integer |
Returns the number of pages in the |
|
|
Integer |
Inserts the contents of the clipboard (if any) at |
|
|
Long |
Inserts a string at the insertion point when the |
|
|
Integer |
Pastes the content of the clipboard in a specified |
|
|
Integer |
Returns the distance of the pointer from the left |
|
|
Integer |
Returns the distance of the pointer from the top of |
|
|
Integer |
Returns the position of the insertion point or |
|
|
Boolean |
Adds the specified event to the end of the event |
|
|
Integer |
Flips between Preview of the document (where |
|
|
Integer |
Prints the contents of the control. You can specify |
|
|
Integer |
Prints the contents of the control. You can specify |
|
|
Integer |
Restores the edit that was previously undone in a |
|
|
Integer |
Replaces selected text with given string. If no Limitation with the new control: In the |
|
|
Integer |
Changes the size of the control. |
|
|
Integer |
Saves the current document in a file in either rich When saving multi-byte characters to a TXT Limitation with the new control: In the |
|
|
Integer |
Saves the contents in a RichTextEdit control as a |
|
|
Integer |
Scrolls the RichTextEdit the specified direction |
|
|
Integer |
Scrolls forward to the next page in the |
|
|
Long |
Scrolls the RichTextEdit to the next row and |
|
|
Long |
Scrolls back to the prior page in the RichTextEdit |
|
|
Long |
Scrolls the RichTextEdit to the prior row and |
|
|
Long |
Causes the control to scroll to the specified row |
|
|
Integer |
Returns the number of the character column just |
|
|
Long |
Returns the length of the selected |
|
|
Long |
Returns the number of the line in which the |
|
|
Long |
Returns the number of the page in which the Limitation with the new control: For the |
|
|
Integer |
Returns the starting position of the selected text |
|
|
String |
Returns a string containing the selected text from |
|
|
Long |
Selects text in the RichTextEdit |
|
|
Integer |
Selects all text in the control. |
|
|
Integer |
Selects all text in the line in which the insertion |
|
|
Integer |
Selects the word in which the insertion point is |
|
|
Integer |
Sets the alignment for the selected |
|
|
Integer |
Sets focus to the RichTextEdit |
|
|
Integer |
Specifies the size of the paragraph’s indentation, |
|
|
Integer |
Specifies the control’s position in the |
|
|
Integer |
Controls automatic redrawing of the |
|
|
Integer |
Sets the line spacing for the selected |
|
|
Integer |
Sets the color of the selected text. |
|
|
Integer |
Sets the font properties of the selected |
|
|
Integer |
Makes the RichTextEdit control |
|
|
Integer |
Allows editing of the header and footer in the |
|
| TableAtInputPos | Long | Gets the ID of the table in the RichTextEdit control where the cursor locates. |
| TableCanChangeAttr | Boolean | Provides information about whether the attributes of all the selected table cells can be altered. |
| TableCellSelect | Boolean | Selects a table cell, a range of table cells, or a complete table in the RichTextEdit control. |
| TableCellStart | Long | Returns the starting position of a table cell in the RichTextEdit control. |
| TableColumnAtInputPos | Long | Gets the ID of the table column where the cursor locates. The column IDs start at 1 in every table in a RichTextEdit control and auto increments. |
| TableDelete | Boolean | Deletes the specified table. |
| TableDeleteColumn | Boolean | Deletes the specified column in the table. |
| TableDeleteColumns | Boolean | Deletes the column that the cursor is currently located in, or the columns that are currently selected, in the table. |
| TableDeleteRow | Boolean | Deletes the specified row in the table. |
| TableDeleteRows | Boolean | Deletes the row that the cursor is currently located in, or the rows that are currently selected, in the table. |
| TableFromSelection | Long | Gets the ID of the currently selected table. |
| TableGetCellBackColor | Long | Gets the back color of a table cell in the RichTextEdit control. |
| TableGetCellBorderColor | Long | Gets the border color of a table cell in the RichTextEdit control. |
| TableGetCellBorderWidth | Integer | Gets the border width (in twips) of a table cell in the RichTextEdit control. |
| TableGetCellHeader | Boolean | Checks whether a table cell is set as the table header in a RichTextEdit control. |
| TableGetCellHeight | Integer | Gets the minimum height (width in twips) of a table cell in the RichTextEdit control. |
| TableGetCellHorizontalExt | Integer | Gets the horizontal extension for a table cell in the RichTextEdit control. |
| TableGetCellHorizontalPos | Integer | Gets the horizontal position for a table cell in the RichTextEdit control. |
| TableGetCellLength | String | Gets the number of characters in a table cell in the RichTextEdit control. |
| TableGetCellNumberFormat | String | Gets the number format used for a table cell in the RichTextEdit control. |
| TableGetCellText | String | Gets the text content in a table cell in the RichTextEdit control. |
| TableGetCellTextGap | Integer | Gets the gap (in twips) between the cell border and cell content in a table cell in the RichTextEdit control. |
| TableGetCellTextType | Integer | Gets the type of content in a table cell in the RichTextEdit control. |
| TableGetCellVertAlign | Integer | Gets the vertical align mode of the content in a table cell in the RichTextEdit control. |
| TableGetColumnCount | Long | Gets the number of columns in a table in the RichTextEdit control. |
| TableGetRowCount | Long | Gets the number of columns in a table in the RichTextEdit control. |
| TableInsert | Long | Inserts a table in the RichTextEdit control. |
| TableInsertColumn | Boolean | Inserts a column to the right or left of the current text input position in the table. |
| TableInsertDialog | Long | Displays a built-in Insert Table dialog for users to insert a table by themselves. |
| TableInsertRow | Boolean | Inserts one row above or below the current text input position in the table. |
| TableInsertRows | Boolean | Inserts one or more rows above or below the current text input position in the table. |
| TableMergeCells | Boolean | Merges all the selected cells in the table. |
| TableNext | Integer | Use this function to enumerate all tables in the RichTextEdit control. Enumeration numbers are used instead of table IDs for the enumeration, because it is possible that the table IDs in the current RichTextEdit control do not reflect the sequence of tables in it. |
| TablePropertiesDialog | Boolean | Displays the Properties dialog for the table in the RichTextEdit control. |
| TableRowAtInputPos | Long | Gets the ID of the table row where the cursor locates. The row IDs start at 1 in every table in a RichTextEdit control and auto increments. |
| TableSetCellBackColor | Boolean | Sets the back color (in twips) for a table cell in the RichTextEdit control. |
| TableSetCellBorderColor | Boolean | Sets the back color (in twips) for a table cell in the RichTextEdit control. |
| TableSetCellBorderWidth | Boolean | Sets the border width (in twips) for a table cell in the RichTextEdit control. |
| TableSetCellHeader | Boolean | Sets the a table cell as the table header in a RichTextEdit control. |
| TableSetCellHeight | Boolean | Sets the minimum height (width in twips) for a table cell in the RichTextEdit control. |
| TableSetCellHorizontalExt | Boolean | Sets the horizontal extension (width in twips) for a table cell in the RichTextEdit control. |
| TableSetCellHorizontalPos | Boolean | Sets the horizontal position (in twips) for a table cell in the RichTextEdit control. |
| TableSetCellNumberFormat | Boolean | Sets the number format for a table cell in the RichTextEdit control. |
| TableSetCellText | Boolean | Sets the text content in a table cell in the RichTextEdit control. |
| TableSetCellTextGap | Boolean | Sets the gap (in twips) between the cell border and cell content in a table cell in the RichTextEdit control. |
| TableSetCellTextType | Boolean | Sets the type of content in a table cell in the RichTextEdit control. |
| TableSetCellVertAlign | Boolean | Sets the vertical align mode for the content in a table cell in the RichTextEdit control. |
| TableSplitCells | Boolean | Splits all the selected cells in the table. However, only previously merged cells can be split. |
|
Long |
Inserts a target into the current position in a |
|
|
Integer |
Deletes the target according to the specified ID in |
|
|
String |
Gets the name of the specified target in a |
|
|
Integer |
Moves the cursor to a specified target in a |
|
|
Long |
Gets the next target ID of the specified target. |
|
|
Integer |
Sets the name of the specified target in a |
|
|
String |
Returns the entire text of the line in which the |
|
|
Integer |
Inserts a text field into the current position in a |
|
|
String |
Gets the text of the specified text field in a |
|
|
String |
Gets the type of the specified text field in a |
|
|
Integer |
Gets the type data of the specified text field in a |
|
|
Integer |
Sets the text of the text field in a RichTextEdit |
|
|
Integer |
Sets the type and type data of the text field in a |
|
| TextFrameGetBackColor | Long | Returns the background color of a text frame in the RichTextEdit control. The RichTextEdit control uses the Microsoft Windows operating environment red-green-blue (RGB) color scheme. |
| TextFrameGetBorderWidth | Integer | Returns the width of a text frame’s border line in the RichTextEdit control. |
| TextFrameGetInternalMargin | Integer | Gets the distance (in twips) between a text frame’s border line and the text. Twip is a fabricated word meaning twentieth of a point (pt). |
| TextFrameGetMarkerLines | Boolean | Gets whether or not marker lines are visible for the text frame. Marker lines show a text frame’s border if the text frame has no border line. |
| TextFrameGetText | String | Returns the text of a text frame in the RichTextEdit control. |
| TextFrameInsert | Integer | Inserts a new text frame anchored to a paragraph. The text flows around the text frame. |
| TextFrameInsertAsChar | Integer | Inserts a new text frame, which is then handled as a single character in the text. |
| TextFrameInsertFixed | Integer | Inserts a new text frame at a fixed geometrical position. The text flows around the text frame. |
| TextFrameSelect | Boolean | Selects a text frame for further programming. Note that this function does not set the input focus to a text frame and does not show the selection frame with the resize handles. |
| TextFrameSetBackColor | Boolean | Sets the background color of a text frame in the RichTextEdit control. The RichTextEdit control uses the Microsoft Windows operating environment red-green-blue (RGB) color scheme. The valid range for a RGB color is 0 to &HFFFFFF. The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively. The red, green, and blue components are each represented by a number between 0 and 255 (&HFF). |
| TextFrameSetBorderWidth | Boolean | Sets the width of a text frame’s border line in the RichTextEdit control. |
| TextFrameSetInternalMargin | Boolean | Sets the distance (in twips) between a text frame’s border line and the text. Twip is a fabricated word meaning twentieth of a point (pt). |
| TextFrameSetMarkerLines | Boolean | Sets whether or not marker lines are visible for the text frame. Marker lines show a text frame’s border if the text frame has no border line. |
| TextFrameSetText | Boolean | Sets the text for a text frame. |
|
Integer |
Triggers a specified event in the control and |
|
|
Object |
Returns the type of the control. |
|
|
Integer |
Cancels the previous editing function performed in |