| TWPCustomRtfEdit Object Properties Methods Events |
Unit
WPCTRMemo
Declaration
TWPCustomRtfEdit = class(TWPCustomRTFControl)
Hierarchy
TCustomControl <--TWPCustomRTFControl <--TWPCustomRtfEdit
Direct subclasses
TWPCustomRichText TWPPreview
Description
This is the central component in WPTools, the editor. It hosts the 'RTF-Engine' which is defined in class TWPRTFEnginePaint and available through the property Memo.
The property RTFText is used to store text in any supported format. It is not a reference to the engine, just more or less a container.
Most functionality of the RTFEngine is published by the editor through properties and methods, but especially for the dynamic creation of text it might be useful to use the reference to the active text or the cursor class TextCursor.
The TWPRTFDataCollection which is used by the editor can be referenced by Memo.RTFData. The page size is stored in Header. Different layout modes can be selected in property LayoutMode.
This is a screen shot of a TWPRichText component using the layout mode 'thumbnails' with additional display of page numbers in the 'page gap'. (ViewOptions)![]()
To change the load and save format the properties TextSaveFormat and TextLoadFormat can be modified. But the methods to load and save also can receive an optional parameter specifying the format. Possible format strings are 'RTF', 'ANSI', 'HTML' and 'WPTOOLS'.
The class TWPRichText also has the property CurrAttr to modify the current text attributes. Automatically the current writing attributes or the attributes of the selected text are change. This is useful if you do not want to use the provided GUI controls (TWPToolBar or the standard actions) and want to synchronize your tool buttons. At a lower level, also in TWPCustomRTFedit, the interfaces WritingAttr and SelectedTextAttr are provided. In contrast to CurrAttr this interfaces use Set and Get methods to work with attributes to make it possible to check weather a property is defined. CurrAttr uses standard properties, they are easier to use but less powerful.
| Note |
| A) The editor will always creates line breaks to fit the lines on the current page width (Header). The property WordWrap is only used to force using the editor width instead of the page width. B) Text can be protected. Which kind of text is protected is selected by property ProtectedProp. C) To attach the editor to a database field we recommend to use the property AsString. D) The component TWPRTFStorage is used to create linked ediotors which are working with the same text (multi view or text path editing) |
| Introduced Properties |
| Introduced Methods |
| Introduced Events |
|
Copyright (C) by WP |