rvico TRichView Reference | TRichViewEdit

TCustomRichViewEdit.GetCurrentItemText, GetCurrentItemTextA, GetCurrentItemTextW

Top  Previous  Next

Returns text for the item at the position of caret.

function GetCurrentItemText: String;

function GetCurrentItemTextA: String;

function GetCurrentItemTextW: WideString;

(Introduced in version 1.4, 1.7)

For text items, these methods return visible text. For non-text items, they return item name.

GetCurrentItemText is the same as TopLevelEditor.GetItemText(TopLevelEditor.CurItemNo).
GetCurrentItemTextA is the same as TopLevelEditor.GetItemTextA(TopLevelEditor.CurItemNo).
GetCurrentItemTextW is the same as TopLevelEditor.GetItemTextW(TopLevelEditor.CurItemNo).

 

unicode Unicode note: GetCurrentItemText is not recommended for Unicode applications. GetCurrentItemTextA and GetCurrentItemTextW are recommended for Unicode applications.

GetCurrentItemTextA always returns ANSI string:

If the item is a non-text item, or a text item of ANSI style, the text is returned as it is.
If the item is a Unicode text item, the function converts Unicode text to ANSI (Unicode text is converted basing on Charset of the item text style).

GetCurrentItemTextW always returns Unicode string:

If the item is a Unicode text item, the text is returned as it is.
If the item is a non-text item, or a text item of ANSI style, the function converts ANSI text to Unicode (ANSI text is converted basing on Charset of the item text style, or on RVStyle.DefCodePage for non-text items).

GetCurrentItemText: the item text is returned as it is (for Unicode text items, it returns "raw Unicode text"), without conversion, be careful.

 

These methods must be called only when the document is formatted.

 

See also methods:

SetCurrentItemText -A -W.

See also methods of TCustomRichView:

GetItemText -A -W.

See also properties:

CurItemNo;
CurItemStyle.

See also:

Obtaining RichView items;
Item types;
"Tags";
Unicode in RichView.


RichView © Sergey Tkachenko