Page 2 of 2

Posted: Thu Sep 20, 2012 1:22 am
by kisshexuxia
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:

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;
5) Change the timer code:

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

Posted: Thu Sep 20, 2012 7:20 am
by Sergey Tkachenko
Did you solve the problems?

Posted: Thu Sep 20, 2012 1:34 pm
by kisshexuxia
Sergey Tkachenko wrote:Did you solve the problems?
it still error
i copy ActionList 1 to TTest_OCX don't cut it,it's ok
cut it will be show class TsrvActionExport not found

Posted: Sat Sep 22, 2012 9:14 am
by Sergey Tkachenko
Please send me your application, I'll fix it.

Posted: Sun Sep 23, 2012 1:07 pm
by Sergey Tkachenko
It looks like some bug happened when you deleted actions from the datamodule: a reference to rvActionExport1 was not deleted from dfm file.
I called "View as text" in the context menu for this datamodule, and removed this reference manually.

Changed files were sent to you.

Posted: Mon Sep 24, 2012 3:59 am
by kisshexuxia
Sergey Tkachenko wrote:It looks like some bug happened when you deleted actions from the datamodule: a reference to rvActionExport1 was not deleted from dfm file.
I called "View as text" in the context menu for this datamodule, and removed this reference manually.

Changed files were sent to you.
Thanks,it's OK
I remove code rvActionExport1 where in datamodule