This forum is temporaily read-only. All existing discussions remain available for reference. For new questions, bug reports or support requests, please contact us at mail@lmdsupport.com.

Saving and restoring Docking Layout

I want to save the docking layout tool windows but leave tabbed panels untouched.
I have added this code to the OnSave event:

procedure TfmIDEMain.LMDDockManager1SaveSite(Sender: TObject;
  ASite: TLMDDockSite; AFloat: Boolean; var ASave: Boolean);
begin
  ASave := not ASite.RootZone.TabbedDocsHost;
end;

however, on re-loading file layout file any Tabbed doc open gets hidden.  I want to be able to change the layout of my tool windows by loading an alternative layout without affecting any of the tabbed working documents.  I hope that makes sense.

Comments

  • edited November 2022
    Unfortunately, there no built-in way.

    To prevent tabbed docs to be saved you can use TLMDDockManager.OnGetCompId event handler, in which you can set AId parameter to empty string, if AComponent is equal of one of your tabbed dock panels, for example:

    procedure TfrmMain.DockManagerGetCompId(Sender: TObject; AComponent: TComponent;
      var AId: string);
    begin
      if AComponent is TLMDDockPanel then
      begin
        if TLMDDockPanel(AComponent).ClientKind = dkDocument then
          AId := '';
      end;
    end;

    However, you still should re-dock all tabbed documents manually using Site.DockControl method after layout loading, since the loading prcess will clear current layout.
  • I understand.  I am developing an IDE and I wanted to be able to have different default layouts according to the current activity much like Rad Studio does when switching between Design and Debug.
Sign In or Register to comment.