rvico TRichView Reference | TRichView

TCustomRichView.AddNL, AddNLTag, Add, AddTag

TCustomRichView.AddCenterLine, AddFromNewLine (deprecated)

Top  Previous  Next

These methods add one text item using the StyleNo-th text style and the ParaNo-th paragraph style to the end of document.

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

 

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

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

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

procedure AddCenterLine(const s: String; StyleNo:Integer); deprecated;

procedure AddFromNewLine(const s: String; StyleNo:Integer); deprecated;

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

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

AddFromNewLine and AddCenterLine are deprecated and maintained for backward compatibility (with TRichView versions prior to 1.0):

AddCenterLine(s, StyleNo) is equivalent to AddNL(s, StyleNo, 1).
AddFromNewLine(s, StyleNo) is equivalent to AddNL(s, StyleNo, 0).

 

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.

 

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.

 

Methods type: viewerstyle viewer-style

unicode Unicode note: Not recommended for Unicode applications. Use AddNLATag or AddNLWTag instead.

See also methods:

AddFmt;
AddTab;
Format;
FormatTail;
SetAddParagraphMode.

See also methods of TRichViewEdit:

InsertStringTag, InsertStringWTag.

See also properties of TRVStyle:

TextStyles;
SpacesInTab.

See also:

Other methods for appending items.


RichView © Sergey Tkachenko