Receiving the current editor from TAction.OnUpdate

General TRichView support forum. Please post your questions here
Post Reply
vit
Posts: 115
Joined: Tue Feb 03, 2009 3:11 pm

Receiving the current editor from TAction.OnUpdate

Post by vit »

I need to get current editor either TRichViewEdit or TSRichViewEdit from TrvAction.OnUpdate event handler. As I understood http://www.trichview.com/help-actions/t ... ontrol.htm I should check in the next sequence:

1. TRVAControlPanel.DefaultControl
2. TrvAction.Control
3. focused control
4. first found editor component

What does mean ‘first found editor component’? Is this the first controls either TRichViewEdit or TSRichViewEdit which found by recursive iteration of all control of the form?
Is this algorithm correct? Does the implementation of this algorithm already exist, which I could use instead of writing my own?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

TrvAction.Control has a higher priority than TRVAControlPanel.DefaultControl

A target for the action (if Control and DefaultControl are not assigned) is chosen by VCL itself; actually, I do not know myself which control will be chosen if an action does not support a focused control.
In a real application, this situation will confuse users, so I strongly recommend to avoid it either by assigning DefaultControl/Control, or by disabling actions in this case.
Post Reply