TCustomRichViewEdit.SetCurrentItemText, SetCurrentItemTextA, SetCurrentItemTextW

<< Click to display table of contents >>

TCustomRichViewEdit.SetCurrentItemText, SetCurrentItemTextA, SetCurrentItemTextW

Changes text of text item or a name of non-text item at the position of caret.

procedure SetCurrentItemText(const s: String);

procedure SetCurrentItemTextA(const s: TRVAnsiString);

procedure SetCurrentItemTextW(const s: TRVUnicodeString);

(Introduced in version 1.4, 1.7)

▪SetCurrentItemText(s) is equivalent to TopLevelEditor.SetItemTextEd(TopLevelEditor.CurItemNo, s).

▪SetCurrentItemTextA(s) is equivalent to TopLevelEditor.SetItemTextEdA(TopLevelEditor.CurItemNo, s).

▪SetCurrentItemTextW(s) is equivalent to TopLevelEditor.SetItemTextEdW(TopLevelEditor.CurItemNo, s).

 

Parameters:

s – text assigned to the item. For text items, this is a visible text. For non-text item, this is a string value associated with the item (not displayed). S must not contain line break (CR and LF) characters. For text items, it must not contain CR, LF, TAB, FF characters (#13, #10, #9, #12).

unicode Unicode notes:

Internally, text is stored as Unicode. SetCurrentItemTextA converts ANSI to Unicode. If the current item is a text item, a code page for conversion is calculated basing on the its Charset. If it is equal to DEFAULT_CHARSET, and for non-text items, Style.DefCodePage is used.

SetCurrentItemText works:

▪like SetCurrentItemTextA, in Delphi 2007 and older

▪like SetCurrentItemTextW, in Delphi 2009 and newer

▪with UTF-8 string, in Lazarus

 

Methods type: editstyle editing-style.

 

See also methods:

▪GetCurrentItemText -A -W;

▪SetItemTextEd -A -W.

See also methods of TCustomRichView:

▪SetItemText -A -W.

See also properties:

▪CurItemNo;

▪CurItemStyle.

See also:

▪Getting RichView items;

▪Item types;

▪"Tags";

▪Unicode in RichView.