Detecting selection deletion

General TRichView support forum. Please post your questions here
Post Reply
aoven
Posts: 45
Joined: Wed Nov 09, 2005 7:28 pm

Detecting selection deletion

Post by aoven »

Is there a clever way of detecting a selection deletion before it occurs?

Aleksander
aoven
Posts: 45
Joined: Wed Nov 09, 2005 7:28 pm

Post by aoven »

Actually, I just found out that OnItemAction event is close enough for my needs. It can catch every item before it gets deleted or cut.

Aleksander
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Just take into account:
1) Item may be deleted by Backspace or Delete key, even it it was not selected
2) If only part of item's text was selected, item is not deleted with the selection
aoven
Posts: 45
Joined: Wed Nov 09, 2005 7:28 pm

Post by aoven »

Hm, yes - those are both good points. But that can't happen with items that have style protection enabled, right? And it just so happens I only need to know when those items are being deleted. I don't care about the others. :)

Aleksander
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If item is deleted only as a whole, then yes, OnItemAction can be used to detect it.
Post Reply