rvico TRichView Reference | Overview

RichView Items' "Tags" Overview

Top  Previous  Next

Each item of RichView has an associated string value – tag. Tags are provided for the convenience of storing additional string value for special needs in your application. The main purpose of tags is organizing a work with a hypertext.

Do not confuse RichView items tags with "Tag" properties of TComponent descendants! (RichView uses "Tag" properties of inserted controls for its own needs; you can set "Tag" properties of ImageList for organizing saving/loading "bullets" and "hotspots" from RVF; but this topic is about completely different tags!)

What you need to know about items tags:

if you do not want to use them – just forget about them; they always will be equal to '';

"checkpoints" also have tags; all rules for items tags work for checkpoints tags;

table cells also have tags; all rules for items tags work for checkpoints tags;

editor can clear (set to '') tags when applying different style to text according to RichViewEdit.EditorOptions;

If you want to save and load document in RVF you must provide that tag strings do not contain #1 and #2 characters;

You can use AddXXX methods which do not have Tag parameter. These functions create new items with Tag=''.

unicode Unicode note: For Delphi/C++Builder 2009 or newer, tags are Unicode strings. For older versions of Delphi, tags are ANSI strings.


var Tag: TRVTag;

    S: String;

// Converting the first text item and its tag string to upper case

  MyRichView.GetTextInfo(0, S, Tag);

  MyRichView.SetItemText(0, UpperCase(S));

  MyRichView.SetItemTag(0, UpperCase(Tag));

Tags in older version of TRichView

In TRichView versions prior to v13.2, tags were Integers. Depending on rvoTagsArePChars Option, they can be either plain integer values or pointers to strings.

This mode can be returned by defining RVOLDTAGS in RV_Defs.inc.

See also...

RichView methods for adding items with tags to the end of document:

AddNLTag, AddTag, AddBreakTag, AddPictureExTag, AddHotspotExTag, AddBulletExTag, AddControlExTag, AddBreakExTag.

RichView methods for adding "checkpoints" with tags to the end of document:

AddCheckpointTag, AddNamedCheckpointExTag.

RichView methods for obtaining information about items (including tags):

GetItemTag, GetBreakInfo, GetBulletInfo, GetHotspotInfo, GetPictureInfo, GetControlInfo, GetTextInfo.

RichView methods for modifying items (including tags):

SetItemTag, SetBreakInfo, SetBulletInfo, SetHotspotInfo, SetPictureInfo, SetControlInfo.

RichView methods allowing work with checkpoints tags:

FindCheckpointByTag, GetCheckpointInfo, SetCheckpointInfo.

RichViewEdit methods for obtaining information about item in caret position:

GetCurrentTag, GetCurrentBreakInfo, GetCurrentBulletInfo, GetCurrentHotspotInfo, GetCurrentPictureInfo, GetCurrentControlInfo, GetCurrentTextInfo.

RichViewEdit methods for inserting:

InsertStringTag, InsertStringATag, InsertStringWTag

RichViewEdit methods for modifying items (including tags):

SetItemTagEd, SetBreakInfoEd, SetBulletInfoEd, SetHotspotInfoEd, SetPictureInfoEd, SetControlInfoEd.

RichViewEdit methods for modifying information about item in caret position:

SetCurrentTag, SetCurrentBreakInfo, SetCurrentBulletInfo, SetCurrentHotspotInfo, SetCurrentPictureInfo, SetCurrentControlInfo

RichViewEdit methods for working with checkpoints tags:

SetCheckpointInfoEd, SetCurrentCheckpointInfo.

RichViewEdit options affecting tags:


TRichView © trichview.com