Page 1 of 1

TRichViewEdit - Bookmarks

Posted: Mon Feb 18, 2013 3:35 pm
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?

Posted: Wed Feb 20, 2013 10:05 am
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

Posted: Wed Feb 20, 2013 3:39 pm
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.