rvico TRichView Reference | TRichView

TCustomRichView.AddNLTag, AddNLATag, AddNLWTag, AddNL, Add, AddTag

Top  Previous  Next

These methods add one text item with the StyleNo-th text style and the ParaNo-th paragraph style, with the specified Tag to the end of document.

Methods with the full set of parameters:

procedure AddNLTag(s: String; StyleNo, ParaNo: Integer; const Tag: TRVTag);

procedure AddNLATag(const s: TRVAnsiString; StyleNo, ParaNo: Integer; const Tag: TRVTag);

procedure AddNLWTag(const s: TRVUnicodeString; StyleNo, ParaNo: Integer; const Tag: TRVTag);

Methods with a shortened set of parameters:

procedure AddNL(const s: String; StyleNo, ParaNo: Integer);

procedure Add(const s: String; StyleNo:Integer);

procedure AddTag(const s: String; StyleNo:Integer; const Tag: TRVTag);

(introduced in version 1.3 and 1.4)

Parameters:

s is a text string to add.  It must not contain CR, LF, TAB, FF characters (#13, #10, #9, #12). To add several lines of text use AddTextNL.

StyleNo is an index in the TextStyles collection of the linked RVStyle component, or rvsDefStyle constant. It defines font attributes for the text.

If ParaNo=-1, the methods add the item to the end of the last paragraph. If ParaNo>=0, this item starts a new paragraph with the ParaNo-th style. (ParaNo is an index in the ParaStyles collection of the linked RVStyle component). It defines attributes for the new paragraph.

Tagtag of this text item.

 

AddNL, Add, AddTag provide subsets of functionality of AddNLTag:

AddNL(...) is equivalent to AddNLTag(..., '').

Add(...) is equivalent to AddNLTag(..., -1, '').

AddTag(s, StyleNo, Tag) is equivalent to AddNLTag(s, StyleNo, -1, Tag).

 

In other words:

AddNL adds text string as a beginning of new paragraph or to the end of the last paragraph.

AddNLTag adds text string with tag as a beginning of new paragraph or to the end of the last paragraph.

Add adds text string to the end of the last paragraph.

AddTag adds text string with tag to the end of the last paragraph.

 

Note: TRichView allows empty text strings only in empty paragraphs (may be with list makers). See Valid documents.

 

unicode Unicode notes:

AddNLATag:

If the StyleNo-th style is ANSI style, s is added as it is.

If the StyleNo-th style is Unicode style, s is converted to Unicode (conversion is performed basing on the Charset of this style).

AddNLWTag:

If the StyleNo-th style is Unicode style, s is added as it is.

If the StyleNo-th style is ANSI style, s is converted to ANSI (conversion is performed basing on the Charset of this style).

AddNLTag works like AddNLWTag in Delphi/C++Builder 2009, and like AddNLATag in the older versions of Delphi/C++Builder.

 

Methods type: viewerstyle viewer-style

If style templates are used, the component may automatically change text style indices of text items, to provide a consistency of text and paragraph style templates.

See also methods:

AddTab;

Format;

FormatTail;

SetAddParagraphMode.

See also methods of TRichViewEdit:

InsertStringTag, InsertStringATag, InsertStringWTag.

See also properties of TRVStyle:

TextStyles;

SpacesInTab.

See also:

Other methods for appending items;

Unicode in RichView.


TRichView © trichview.com