rvico TRichView Reference | TRichViewEdit

TCustomRichViewEdit.InsertStringTag, InsertStringATag, InsertStringWTag

Top  Previous  Next

The methods Insert text string s with associated Tag in the position of caret.

function InsertStringTag(const s: String; const Tag: TRVTag): Boolean;

function InsertStringATag(const s: TRVAnsiStringconst Tag: TRVTag): Boolean;

function InsertStringWTag(const s: TRVUnicodeStringconst Tag: TRVTag): Boolean;

(introduced in version 1.6)

Inserted text (one text item) has the current text and current paragraph style.

Methods type: editstyle editing-style method for insertion.

Unlike InsertText:

s parameter must not contain CR, LF characters (#13 and #10) and page break character (#12);

TAB characters are always replaced with spaces, even if SpacesInTab=0.

the inserted string is not merged with surrounding text items, even if it has the same text style and tag.

Do not overuse these methods. Use InsertText when possible.

unicode Unicode note:

Internally, text is stored as Unicode. InsertStringATag converts ANSI to Unicode using Style.DefCodePage.

InsertStringTag works:

like InsertStringATag, in Delphi 2007 and older

like InsertStringWTag, in Delphi 2009 and newer

with UTF-8 string, in Lazarus

 

Return value:

True if the insertion was successful (it can fail due to protection, or when inserting in table having multicell selection)

See also methods:

InsertText, -A, -W.

See also properties:

CurParaStyleNo;

CurTextStyleNo.

See also properties of TRVStyle:

TextStyles;

ParaStyles;

SpacesInTab.

See also:

Inserting items in position of caret;

Tags.


TRichView © trichview.com