Posted: Thu Sep 20, 2012 1:22 am
Sergey Tkachenko wrote:By default, all actions works with the focused editor. So all buttons and menus in inactive forms work with the editor on the active form.
I assume that you have TRVAControlPanel on the form, with DefaultControl property assigned. In the new version of RichViewActions, the first created RVAControlPanel becomes default, so in this case all actions will work with the first created editor.
I suggest making the following changes:
1) Create only one copy of srvActionsResource (in the code you send to me, you create a new copy TTest_OCX.ActiveFormCreate each time; change the code to create srvActionsResource only if it equals to nil)
2) Do not place TRVAControlPanel on TTest_OCX. Place it on this datamodule instead. Do not assign RVAControlPanel.DefaultControl.
3) Remove ActionList from the datamodule and insert it in TTest_OCX form instead (cut to the Clipboard and paste).
4) Change the code in TTest_OCX.ActiveFormCreate to:5) Change the timer code:Code: Select all
for i := 0 to ComponentCount-1 do begin if Components[i] is TsrvAction then TsrvAction(Components[i]).Control := srv else if Components[i] is TrvAction then TrvAction(Components[i]).Control := srv; if Components[i] is TAction then TAction(Components[i]).OnExecute := DoActionsExecute;
Code: Select all
for i := 0 to ComponentCount-1 do if Components[i] is TAction then TAction(Components[i]).UpdateTarget(GetRVAControlFor(TAction(Components[i])));
thanks i modif the code on
3) Remove ActionList from the datamodule and insert it in TTest_OCX form instead (cut to the Clipboard and paste).
if i cut ActionList to TTest_OCX it will show class TsrvActionExport not found
but i copy ActionList to TTest_OCX it'ok