How to override default method for OnItemAction?

General TRichView support forum. Please post your questions here
Post Reply
conciliator
Posts: 25
Joined: Thu Sep 17, 2009 7:50 am

How to override default method for OnItemAction?

Post by conciliator »

I'd like to override the default event handler for item actions in a TRichViewEdit. Although my company has purchased a license, I can't access the source at the moment, so I can't figure out what method to override.

What method (if any) can I override to hook onto the default item action event handler for a TRichViewEdit? Thanks!
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Which exactly actions do you need to override?
conciliator
Posts: 25
Joined: Thu Sep 17, 2009 7:50 am

Post by conciliator »

I need to take special action in case of some rviaDestroying-actions. I've come 95% of the way using styles (TRVProtectOption etc.), but can't see how to get all the way without some

Case:
I have two the following document:

[protected paragraph A]
[non-protected paragraph B]
[protected paragraph C]

Now, if the user deletes B, she won't be able to insert text between A and C. I'd like to let her delete all the text in B, but keep an empty line between A and C if she does. Problem is, if I assign rvprDeleteProtect to the text in B, the text in B wont' be deleted.

Is it possible to achieve this using styles?
conciliator
Posts: 25
Joined: Thu Sep 17, 2009 7:50 am

Post by conciliator »

On a side-note, I'd like to mention to you that when you do have rvprDeleteProtect enabled, rvuDelete will show up in as the next undo-action even though nothing has actually been deleted. Maybe that's intended, maybe not - but now you know. :)
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

How do you protect the paragraphs A and C?
If they are protected by including rvpaoReadOnly in the paragraph Options, it is still possible to insert a line between them, if rvpaoDoNotWantReturns is not included in the paragraph Options, and sticking options are not included in the text Protection.
conciliator
Posts: 25
Joined: Thu Sep 17, 2009 7:50 am

Post by conciliator »

Hi Sergey!

Sorry for the delay - been working hard on other stuff. Did what you suggested yesterday, and I'm happy to report that it worked out fine.
Post Reply