Text Items in TRichView Documents

<< Click to display table of contents >>

Text Items in TRichView Documents

Text Item

Text item displays text in Unicode encoding.

Style of this item type: >=0 (index in the TextStyles collection of the linked TRVStyle); item of this collection (TFontInfo object) defines almost all properties of this text).

Main properties of TFontInfo:

▪Jump - determines if this text is hypertext or not;

▪properties defining font, colors, background, hypertext cursors, protection, bi-di mode, and others.

Text item cannot contain:

▪CR and LF (#13 and #10) characters;

▪TAB (#09) characters (they are inserted as tabulators or replaced with several space characters, depending on SpacesInTab);

▪#0 characters;

▪FF (#12) characters (see PageBreaksBeforeItems property of TCustomRichView).

Methods of TCustomRichView

The following viewer-style methods add item of this type to the end of the document:

▪single item: AddNL (and shortcut Add), AddFmt

▪multiple items: AddTextNL.

The following viewer-style methods change text of the given item

▪SetItemText -A -W

The following methods return text of the given item:

▪GetItemText -A -W

Appending text from file/stream:

▪LoadText, LoadTextW,

▪LoadTextFromStream, LoadTextFromStreamW

Methods of TCustomRichViewEdit

The following editor-style methods insert item of this type at the position of caret:

▪single item: InsertStringTag, InsertStringATag, InsertStringWTag;

▪multiple items: InsertText, -A, -W.

The following editor-style methods change text of the given item:

▪SetItemTextEd -A -W, SetCurrentItemText -A -W

The following methods return text of item at the position of caret:

▪GetCurrentItemText -A -W

The following editor-style methods insert text from files at the position of caret:

▪InsertTextFromFile, InsertTextFromFileW

See Also...

See also methods for copying and pasting, selecting text.

Some of the methods above can insert tabulators as well.

See also: classes for item types.