Page 1 of 1

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

Posted: Tue Jul 12, 2016 11:59 pm
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.

Posted: Wed Jul 13, 2016 8:29 am
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.

Posted: Wed Jul 13, 2016 11:43 am
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.

Posted: Fri Jul 15, 2016 4:33 pm
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.