TAdvToolBar Saving the positions

Hi  Has anyone found a way of restoring the positions of the TAdvToolBar from a configuration file.

All help appreciated

When you use toolbars on dockpanels (TAdvDockPanel) , see the AdvDockPanel.Persistence property and the methods LoadToolBarsPosition and SaveToolBarsPosition 

I am finding the the toolbar positions in a AdvDockPanel do not save/restore properly or some setting I have is messing it up. I save my settings using the Persistence property and have also tried explicitly calling LoadToolBarsPosition.SaveToolBarsPosition without any change.

If I have multiple rows of toolbars, row one never seems to remember its spacing position and all are left justified and push together with no spacing. Row two, the spacing is not restored exactly as it was and only the 2nd toolbar is spaced away from the first toolbar. The third is pushed up next to the 2nd one.

I also have a 2nd dockpanel, with a different persistence location in the registry, that never restores the position other than what row it is on. All toolbars are left justified.

Any suggestions?

TAdvDockPanel and TAdvToolBar, both at
Delphi 10.4.1

This is the registry at app start:
Registry at app start

This is the registry after adjusting the spacing and closing the app:
Registry showing spacing was saved

This is the registry after restarting the app and which the toolbars did not restore the spacing:
Registry after app restart/close

After writing the post, I had a thought. The default width of the app is probably too narrow and your loading of the position was occurring before I re-sized the app to the saved dimensions. Adding the LoadToolBarsPosition after that was fine for one toolbar but not the other. Since I am also using this inside a LMDDockPanel and perhaps it was affecting the dimensions of the AdvDockPanel causing the toolbars to push together. So I added a LoadToolBarsPosition on the LMDDockPanel's OnShow event which solves the issue. :slight_smile: