rvico TRichView Reference | TRichView

TCustomRichView.AddTextNL, AddTextNLA, AddTextNLW

Top  Previous  Next

These methods add one or more text lines to the end of document.

procedure AddTextNL(s: String; StyleNo,

  FirstParaNo, OtherParaNo: Integer);

procedure AddTextNLA(const s: TRVAnsiString; StyleNo,

  FirstParaNo, OtherParaNo: Integer);

procedure AddTextNLW(const s: TRVUnicodeString;

  StyleNo, FirstParaNo, OtherParaNo: Integer;

  DefAsSingleParagraph: Boolean);

 

Parameters:

s is a text string to add. It may contain special characters:CR, LF, TAB, FF (#13, #10, #9, #12). #9 characters may be inserted as tabulators, depending on value of SpacesInTab property of the linked RVStyle component. #12 characters add page breaks. All possible line breaks modes (CR, LF, CR+LF, LF+CR) are supported.

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

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

OtherParaNo defines paragraph attributes for the subsequent lines of text. Must be >=0.

DefAsSingleParagraph: If False, AddTextNLW uses the current add-paragraph mode (see SetAddParagraphMode). If True, it treats #13 and #10 as line breaks, not paragraph breaks. WideChar($2029) ("paragraph separator") always initiates a new paragraph. WideChar($2028) ("line separator") always initiates a new line.

AddTextNLW supports the Unicode byte order marks characters (if it's present, it must be the first character in s).

Methods type: viewerstyle viewer-style.

unicode Unicode notes:

AddTextNLA:

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).

AddTextNLW:

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).

AddTextNL: works like AddTextNLW in Delphi/C++Builder 2009 or newer, and like AddTextNLA in the older versions of Delphi/C++Builder.

 

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:

AddNL and others;

AddTab;

LoadText, LoadTextW;

LoadTextFromStream, LoadTextFromStreamW;

Format;

FormatTail;

SetAddParagraphMode.

See also methods of TRichViewEdit:

InsertText, -A, -W.

See also properties of TRVStyle:

TextStyles;

SpacesInTab.

See also:

Other methods for appending items;

Unicode in RichView;

Example how to load UTF-8 files.


TRichView © trichview.com