|
<< Click to display table of contents >> Items' "Tags" in TRichView |
Each item of TRichView 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! (TRichView 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!)
▪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 cells 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.
Unicode note: tags are Unicode strings.
var
Tag: TRVTag;
S: TRVUnicodeString;
// 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));
In TRichView versions prior to v13.2, tags were Integers. Depending on rvoTagsArePChars Option, they could be either plain integer values or pointers to strings.
This mode can be returned by defining RVOLDTAGS in RV_Defs.inc.
TRichView methods for adding items with tags to the end of document (a tag is an optional parameter):
AddNL, AddBreak, AddPicture, AddHotspot, AddBullet, AddControl, AddBreak
TRichView methods for adding "checkpoints" with tags to the end of document (a tag is an optional parameter):
TRichView methods for receiving information about items (including tags):
GetItemTag, GetBreakInfo, GetBulletInfo, GetHotspotInfo, GetPictureInfo, GetControlInfo, GetTextInfo.
TRichView methods for modifying items (including tags):
SetItemTag, SetBreakInfo, SetBulletInfo, SetHotspotInfo, SetPictureInfo, SetControlInfo.
TRichView methods allowing working with checkpoints tags:
FindCheckpointByTag, GetCheckpointInfo, SetCheckpointInfo.
TRichViewEdit methods for receiving information about an item at the caret position:
GetCurrentTag, GetCurrentBreakInfo, GetCurrentBulletInfo, GetCurrentHotspotInfo, GetCurrentPictureInfo, GetCurrentControlInfo, GetCurrentTextInfo.
TRichViewEdit methods for inserting:
InsertStringTag, InsertStringATag, InsertStringWTag
TRichViewEdit methods for modifying items (including tags):
SetItemTagEd, SetBreakInfoEd, SetBulletInfoEd, SetHotspotInfoEd, SetPictureInfoEd, SetControlInfoEd.
TRichViewEdit methods for modifying information about an item at the caret position:
SetCurrentTag, SetCurrentBreakInfo, SetCurrentBulletInfo, SetCurrentHotspotInfo, SetCurrentPictureInfo, SetCurrentControlInfo
TRichViewEdit methods for working with checkpoints tags:
SetCheckpointInfoEd, SetCurrentCheckpointInfo.
TRichViewEdit options affecting tags: