How to prevent 2-nd RVE from changes by builtin actions?

General TRichView support forum. Please post your questions here
Post Reply
max.beliy
Posts: 26
Joined: Tue Jul 12, 2016 11:35 pm

How to prevent 2-nd RVE from changes by builtin actions?

Post by max.beliy »

Hello,

If two RVE Editors placed in one form, with toolbar controls that uses standard rvActions, how I can prevent changes in second RVE by rvActions if second RVE is focused?

I don't want disable controls and I don't want loose some of RVE hot-keys actions for second RVE.

For example if make this RVAControlPanel1.DefaultControl := RichViewEdit1
then hotkeys Ctrl+C or Ctrl+V, Ctrl-A ... are processed in first RVE even if
second RVE has focus.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If you assign RVAControlPanel.DefaultControl, actions will work with the specified editor.
However, as you noticed, some "edit" actions are exception: they work with the focused editor (not only with TRichViewEdit, but also with TEdit, TMemo, TComboBox).
If you do not like this behavior, assign the global variable
RVA_EditForceDefControl := True.
max.beliy
Posts: 26
Joined: Tue Jul 12, 2016 11:35 pm

Post by max.beliy »

Ok, but hotkey processing for second RVE doesn't work in this case.

If second RVE has focus and RVAControlPanel.DefaultControl assigned with first RVE, inc RVA_EditForceDefControl:= True, then all hotkeys are still processed in First RVE.

I will try to explain in russian, may be my english is not enough.
Если два RVE на одной форме, то при всех указанных выше действиях, горячие клавиши отрабатывают свои действия в первом RVE даже несмотря на то что в фокусе RVE номер 2.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Of course, if you assign RVAControlPanel.DefaultControl = RVE1, all actions will work with RVE1, even if RVE2 is focused. It does not matter how the actions are activated, by hotkeys, or from menu/toolbar.

If you want some actions to work with RVE1, and some actions to work with the focused editor, instead of assigning RVAControlPanel.DefaultControl, assign the proper editor to the actions' Control property.
Post Reply