I have a MDI application and I'm using TActionManager to manage actions within my application which also means that it contains the actions for my MDIChild forms.
Here's an simple exemple to recreate my problem:
Create a new VCL Forms applications with 2 forms. Form1 & Form2 Drop a TButton and a TActionManager over Form1. Create 2 TActions using TActionManager's PopUp Editor. Set FormStyle := fsMDIForm for Form1. Set FormStyle := fsMDIChild for Form2.
Add this code to correspondant events:
// Form1
procedure TForm1.Action1Execute(Sender: TObject);
begin
ShowMessage('Action1');
end;
procedure TForm1.Action2Execute(Sender: TObject);
begin
ShowMessage('Action2');
end;
procedure TForm1.Button1Click(Sender: TObject);
var
oForm2: TForm2;
begin
oForm2 := TForm2.Create(Application);
end;
// Form 2
procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;
Drop a TActionToolBar over Form2. Drop Action1 and Action2 over this TActionToolBar using TActionManager PopUp Editor. Save & Run. Click on the button on Form1 to show Form2. Everything works as expected. Now close Form2 and open it back. Actions are missing...
Is there a way to avoid losing my actions knowing that I really need to use TActionManager?