Event for deletion picture

General TRichView support forum. Please post your questions here
Post Reply
Tobias
Posts: 5
Joined: Sat Jan 30, 2010 5:55 pm

Event for deletion picture

Post by Tobias »

I need to store pictures in separate database table. When picture added to document I save it to database and put unique identifier to tag of that picture. And I use OnRVFPictureNeeded for retrieving picture from database. All works fine, but I have one problem. I need to delete picture from database when user delete it from document, without that database will be filled with lot of unused pictures. My problem that I can determine when picture deleted from document. I don't find any suitable events for that. Any ideas?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I think the simplest way is
- to create a list of pictures after the document is loaded,
- to create a list of pictures before the document is saved,
- compare them and determine new and deleted pictures.

As for deleting as an editing operation, you can use OnItemAction event, ItemAction=rviaMovingToUndoList (assuming that UndoLimit property <> 0).
Post Reply