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: TRVAnsiString;

function GetCurrentItemTextW: TRVUnicodeString;

(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 notes:

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 works like GetCurrentItemTextW in Delphi/C++Builder 2009 or newer, and like GetCurrentItemTextA in the older versions of Delphi/C++Builder.

 

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.


TRichView © trichview.com