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 note: For Delphi/C++Builder 2009 or newer, tags are Unicode strings. For older versions of Delphi, tags are ANSI strings.
var Tag: TRVTag;
// Converting the first text item and its tag string to upper case
MyRichView.GetTextInfo(0, S, 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.
RichView methods for adding items with tags to the end of document:
RichView methods for adding "checkpoints" with tags to the end of document:
RichView methods for obtaining information about items (including tags):
RichView methods for modifying items (including tags):
RichView methods allowing work with checkpoints tags:
RichViewEdit methods for obtaining information about item in caret position:
RichViewEdit methods for inserting:
RichViewEdit methods for modifying items (including tags):
RichViewEdit methods for modifying information about item in caret position:
RichViewEdit methods for working with checkpoints tags:
RichViewEdit options affecting tags:
TRichView © trichview.com