|
RichView Item Types |
Top Previous Next |
|
Items RichView documents consist of items. Items are indexed from 0 to ItemCount-1. Some items (tables) contain subdocuments (cells) which in their order contain items. Item Types Type ("style") of the given item is returned by the method GetItemStyle (in editor, a style of the item at the position of caret is returned by CurItemStyle). If the returned value is 0 or positive, this is a text item. In this case, the returned value defines a style of this text: it is an index in the TextStyles collection of the the linked TRVStyle component. If the returned value is negative, this is a constant identifying the item class. Standard RichView item types are:
Below is the overview of properties which are common for all item types. Text Each item has associated text. For text items, this text is displayed. For non-text items, this text is not used by the component itself; you can store any information in it. Text must not contain characters: CR (#13), LF (#10), #0. For text-items, text can be in traditional (ANSI) or in Unicode encoding. ANSI text must not contain characters (CR (#13), LF (#10), #0, TAB (#9), FF (12). See GetItemText, SetItemText methods of TRichView and related methods of TRichViewEdit. Tag Tag is an additional value associated with each item. Tag is not displayed and not used by the component itself. Depending on Options, tags can store integers or strings. Default value of tags - 0/nil. For example, you can use tags to store targets of hyperlinks. See also: Tags in RichView Checkpoint Checkpoint marks the item and can be used to find this item quickly. Checkpoints are exported in RTF as bookmarks, in HTML as anchors. See also: Checkpoints in RichView Pagebreak-before Flag If this flag is set, this item starts a new page when printing. Paragraph Attributes Items are organized in paragraphs. Paragraph attributes are defined in the ParaStyles collection of the linked TRVStyle component. GetItemPara returns an index of paragraph style for the given item. This method returns the same value for all items in the same paragraph. IsParaStart returns True, if the given item starts a new paragraph. IsFromNewLine returns True, if this item starts a new paragraph or a new line in this paragraph. Vertical Alignment These properties can be applied only to non-text item types which are positioned as a character of text. They cannot be applied to items occupying a full line (such as tables and breaks). By default, bottom of item is aligned to the base line of text (items of some types can be aligned differently, see TRVVAlign). You can move item up or down by the specified number of pixels or percents. See the following extra item properties: rvepVShift, rvepVShiftAbs. For text items, see VShift property of text style. Spacing You can define spacing around the item. See the following extra item properties: rvepSpacing Coordinates GetItemCoords returns coordinates of the top left corner of the given item relative to the beginning of the document. GetItemClientCoords returns coordinates of the left top corner of the given item relative to the top left corner of RichView window. Protection Text have several option of protection, see Protection properties of text style. You can protect non-text items from deletion. See the following extra item integer properties: rvepDeleteProtect. Popup Hints The component can show a hint message when the mouse pointer is above the item. See the following extra item string properties: rvespHint. Hint message can be dynamically customized in OnItemHint event. Events OnItemAction occurs when item is inserted, deleted, moved to undo list, or when item text is modified. OnSaveItemToFile occurs when saving item in HTML, RTF or text file or stream. This is a "low level" event. It allows you to change how the item is saved. |