TCustomRichViewEdit.InsertCheckpoint

<< Click to display table of contents >>

TCustomRichViewEdit.InsertCheckpoint

Inserts checkpoint at the position of caret.

function InsertCheckpoint(const ATag: TRVTag;

  const AName: TRVUnicodeString;

  ARaiseEvent: Boolean): Boolean;

(introduced in version 10; changed in versions 18 and 19)

This method is similar to SetCurrentCheckpointInfo, but inserts checkpoint exactly at the position of caret.

If the caret is at the beginning of item, this methods calls SetCheckpointInfoEd to add checkpoint for this item.

If the caret is at the middle of text item, this method splits this item at the position of caret, and calls SetCheckpointInfoEd to add checkpoint for the item to the right.

If the caret is at the end of paragraph, the method moves it to the beginning of the next paragraph, and calls SetCheckpointInfoEd to add checkpoint for the first paragraph item (or the second item, if the first one is list marker).

If the caret is at the end of document, this methods does nothing.

This method is used in conjunction with GetCheckpointAtCaret and RemoveCheckpointAtCaret (GetCurrentCheckpoint and RemoveCurrentCheckpoint cannot be used, because checkpoint added by this method is not necessary belongs to the current item (that is usually the item to the left of the caret).

Parameters.

ATag tag of checkpoint;

AName name of the checkpoint, any string without line break (CR, LF) characters.

ARaiseEvent "raise event" flag; if set, RichView can generate OnCheckpointVisible event for this checkpoint.

 

Return value:

True if the checkpoint was inserted. False otherwise (the function may fail because of a protection, a read-only mode, or when the caret is at the end of the document).

 

Method type: editstyle editing-style.

 

See also:

Modifying RichView items;

"Checkpoints";

"Tags".