Page 1 of 1

TRichViewEdit - Checkpoints

Posted: Mon Feb 25, 2013 4:34 pm
by Graham
Two questions

Question 1:

So I can do this to add a checkpoint at the bottom of the current text:

s := InputDialog.Value;
rve.AddNamedCheckpointEx('C' + s, true);
rve.AddFmt('[' + s + '] ', [0], TEXT_STYLE, ARA_STYLE);
rve.Format;


But how do I "Insert" the checkpoint into some existing text e.g.

Before:

This is some text
More text

After:

This is some text
[1]
More text


Question 2:

After Inserting or adding the checkpoint how do I position the caret to the end of my newly added line? I want the caret after the ]. Is this possible?

Posted: Tue Feb 26, 2013 5:50 pm
by Sergey Tkachenko
Functions for checkpoints are listed here:
http://www.trichview.com/help/checkpoints_overview.html

If you want to assign a checkpoints when generating document, you can use SetCheckpointInfo method.

Note that checkpoints are not document items, so they do not occupy any screen space, they do not affect caret positions. They are properties of items (with the only exception - a checkpoint at the bottom of the document, not belonging to any item).
So, when you add/set a checkpoint, you simply assign it to some item, and it is assumed that this checkpoint is located at the top left corner of this item.

If you want to "insert" a checkpoint as an editing (undoable) operation, use either SetCheckpointInfoEd or InsertCheckpoint. Details can be found in the help file.