BarManager SaveLayoutToFile with isComplete == false

Bars for Windows Forms Forum

Posted 13 years ago by Keith Hill
Avatar
We don't use the designer to add our menu entries. We do this in code because we have an established menu description file that we parse and generate menu entries from. The problem is that when I save the command bar layout with isComplete set to false, I'm getting every menu entry saved to file and that is making the file large. All I really wanted was the position/state of my toolbars. Anyway, is there a method to tell the BarManager that the current state is not "dirty" so it won't save out changes made before that point?

Comments (5)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We've added a BarManager.SetAsBaselineLayout method for you that will mark the baseline layout for this scenario. If you'd like to test it, send over an email.


Actipro Software Support

Posted 13 years ago by Keith Hill
Avatar
Seems to work except that I have some dynamic menu items (MRU File list) and I configure those from saved setttings before I call SetAsBaselineLayout. Now the list updates as I open files but the size of the list doesn't change from the original number as pulled from the user settings. If if there were 3 entries that's all I get in my MRU file list until I exit and restart the app and then it jumps to the correct number of entries. Am I doing something wrong? It's like the SetAsBaselineLayout call is preventing me from adding new BarButtonCommandLinks to the menu.
Posted 13 years ago by Keith Hill
Avatar
However I can add BarButtonCommandLinks via the Customize dialog and those save/restore from the layout file just fine. It is just the programmatic adds/inserts that don't work.
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Keith,

For items like MRUs you should always be using expander button commands instead of regular button commands. Expanders are built especially for dynamic items. Search for Window.WindowList in BarForm to see how we populate an opened window list in the Window menu. Same concept applies for MRU.


Actipro Software Support

Posted 13 years ago by Keith Hill
Avatar
Thanks. That works good.
The latest build of this product (v2020.1 build 0400) was released 7 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.