OnCheckpointVisible in TRichViewEdit?

General TRichView support forum. Please post your questions here
Post Reply
ianh
Posts: 4
Joined: Wed Apr 16, 2008 10:01 pm

OnCheckpointVisible in TRichViewEdit?

Post by ianh »

Hello

Are there any plans to include the event OnCheckpointVisible within the TRichViewEdit component?

Thanks
Ian
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

No, not in near future.
You can try to implement it yourself - in OnVScrolled and OnChange events, check items starting from FirstItemVisible, using GetItemCheckpoint.
ianh
Posts: 4
Joined: Wed Apr 16, 2008 10:01 pm

Post by ianh »

> You can try to implement it yourself .....

OK cool. I didn't want to start doing it if there was a fundamental problem that I hadn't spotted, or if it was going to be included in the near future anyway.

Thanks.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Actually, it's not very difficult. It was not implemented only because in TRichView checkpoint may appear only as a result of scrolling or resizing (and resizing usually causes scrolling), but in TRichViewEdit it may also appear as a result of editing. So the code used in TRichView will not always work in editor. This TRichView code is more optimal than I suggested in my reply (cycle from FirstItemVisible with GetItemCheckpoint), but more complicated.
Adding this single cycle in event is very simple, but it may slow down editing, especially if you want to implement CPEventKind=cpeAsSectionStart, and document is large and have a small count of checkpoints.
Post Reply