Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

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);
  ASave := not ASite.RootZone.TabbedDocsHost;

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.


  • 2 Comments sorted by Votes Date Added
  • edited November 2022 Posts: 0 Accepted Answer Vote Up0Vote Down
    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);
      if AComponent is TLMDDockPanel then
        if TLMDDockPanel(AComponent).ClientKind = dkDocument then
          AId := '';

    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.