Page 1 of 1

How to override default method for OnItemAction?

Posted: Mon Mar 26, 2012 12:27 pm
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!

Posted: Tue Mar 27, 2012 4:18 pm
by Sergey Tkachenko
Which exactly actions do you need to override?

Posted: Fri Mar 30, 2012 7:24 am
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?

Posted: Fri Mar 30, 2012 10:58 am
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. :)

Posted: Fri Mar 30, 2012 3:06 pm
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.

Posted: Tue Jul 17, 2012 7:00 am
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.