TRichViewEdit - Bookmarks

General TRichView support forum. Please post your questions here
Post Reply
Graham
Posts: 64
Joined: Sun Jan 27, 2013 7:51 pm
Location: Berkshire U.K.

TRichViewEdit - Bookmarks

Post by Graham »

I am trying to work out the best way of implementing "Bookmarks" in RichViewEdit. This seems to be a good starting point:

rve.InsertBullet(45, ButtonImageListEnabled);
rve.SetCurrentTag(IntToStr($1000));

I am creating an image in the text from my image list and assigning a tag value to this item. In theory, I can then use the tag value at a later time to determine if this item is a bookmark. So far so good.

Now whatever I create in RichViewEdit, I need to be able to save and load back from some file format. I am not too fussy about which format that is.

Saving as RTF seems to save the file and reload it. however it does not save the Tag value. Also after reloading it, when I click on my Bookmark icon, I get some strange little squares appearing around the icon.

Saving as RVF creates a file with a load of extra stuff in it, but when you load it back the Bookmark icons are missing as are any carriage returns.


Any clues as to how I can add Bookmarks? Maybe there is a completely different way as to how this should be done?
Sergey Tkachenko
Site Admin
Posts: 17571
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Use "checkpoints". They are automatically saved as anchors to HTML and as bookmarks in RTF. The only limitation: unlike RTF bookmarks, checkpoints do not have a length, they mark a position in the document.

See http://www.trichview.com/help/checkpoints_overview.html
Graham
Posts: 64
Joined: Sun Jan 27, 2013 7:51 pm
Location: Berkshire U.K.

Post by Graham »

I probably want to use Checkpoints for something else. I am now using InsertPicture. This does what I want. And as long as I don't use pictures for anything else, I can use the style number of rvsPicture (-3) to identify it if I use RTF to save the file.
Post Reply