TAdvMenu & INI Files

Hi


I am trying to use persistence to save the state of my menus to an INI file when my application closes, but when the app does close it throws an error as it tries to write the file. Do the Key & Section properties need full paths to the place where the INI file are to be saved?

Bruce.

Hi


I thought it was a simple question but obviously it doesn't seem to merit a reply! 

I want to use an INI file to save the state of the menus I have setup my question is what location is the INI file that has that information and do I need to add a path?

When I have persistence enabled and locatio set to plniFile I get an exception when my application closes and the INI file is being written.

I would really appreciate some guidance as there is no help in your documentation on this. 

Bruce.

Hi


Still hoping someone will answer this.

Bruce.

Hi


I've obviously upset the TMS support team as another couple of weeks have gone by, but hopefully I'll get an answer before Christmas.

Bruce.


First of all, it is not clear what you mean with persisting menu item states and on TAdvMainMenu there is no persistence. The closest persistence capability I know of is persistence of TAdvDockPanel. This persists position of toolbars on dockpanels. With this persistence, we could not reproduce a problem. Test app can be downloaded here:

http://www.tmssoftware.net/public/AdvDockPanelPersistence.zip

Bruno


All I mean by "persistence" is that the menu I presume, saves how it's been configured, and when you close your application it saves this information to either the registry or an .ini file. 

When you restart your application (presumably) the component looks in the registry or reads an .ini file and restores how the menu was configured when it was last used.

All I want to know is how do I use this feature of saving menu settings to an .ini file? 

I tried and couldn't save anything - what should the path be? 

Bruce.


You can choose the path you want. If you want to use an INI file, the full filename (incl. path) can be set via the .Key property.
Did you check the sample download?

Hi Bruno


Yes I have downloaded the simple demo you kindly put together. 

When I was adding a key value I didn't prefix it with a ".\", neither did I give it a ".ini" extension which was obviously the problem. 

Thank you once again

Bruce.

Hi


One last thing...

As far as I can see you need to set AllowFloating to true to allow a toolbar to be dragged from one DockPanel to another. 

But what if I don't what the toolbar to be allowed to float outside a DockPanel, but still require it to float to be able to drag it to another DockPanel?

If I turn of AllowFloating I can't swap DockPanels, is there a way round this, or is this how its designed?

Bruce.