rvico TRichView Reference | Item Types

Text Items

Top  Previous  Next

Text Item

Text item displays text in traditional (ANSI) or Unicode encoding.

Style of this item type: >=0 (index in the TextStyles collection of the linked TRVStyle).

Item of this collection (TFontInfo object) completely defines all properties of this text.

Main properties of TFontInfo:

Unicode - determines if this text is Unicode or not;
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: AddNLTag (and shortcuts AddNL, AddTag, Add), AddFmt
single item, can be used in Unicode applications: AddNLATag, AddNLWTag
multiple items: AddTextNL, AddTextBlockNL;
multiple items, can be used in Unicode applications: AddTextNLA, AddTextNLW;

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

SetItemTextA, SetItemTextW

The following methods return text of the given item:

GetItemTextA, GetItemTextW

Appending text from file/stream:

LoadText, LoadTextW,
LoadTextFromStream, LoadTextFromStreamW

Methods of TCustomRichViewEdit

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

single item: InsertStringTag, InsertStringWTag;
multiple items: InsertText, InsertTextW.

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

SetItemTextEdA, SetItemTextEdW, SetCurrentItemTextA, SetCurrentItemTextW

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

GetCurrentItemTextA, GetCurrentItemTextW

The following editor-style methods insert text from files in 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.


RichView © Sergey Tkachenko