Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Automatically open documents on startup Collapse All
Subject Author Date
Timothy Anderson Jan 9, 2006 - 4:49 PM

I have the control bar stuff saving and restoring OK but I’d also like to be able to have it automaticallly re-open all documents that were open (to make this easy) when the app is shut down. So I need to save the filename, and the windowplacement stuff for all currently open docs. When the app next starts up I want to restore the main frame and control bars, along with re-opening all of the documents including internal window placements that were open at the time of the save. Is there an example flying around or a search on the KB here that I buggered up? I wasn’t able to find anything obvious while trying searches.


If there isn’t an app, where would be the best place to add this in?

Technical Support Jan 10, 2006 - 11:22 AM

The dynamic resizable control bars is a ready-to-use solution in your case. These bars are instances of the CExtDynamicControlBar class or derived from it. All the dynamic bars in the main frame window are managed by the instance of the CExtDynamicBarSite class. Typically CMainFrame is derived from the CExtDynamicBarSite class. The CExtDynamicControlBar bar windows has acts like older CExtControlBar bar windows. But dynamic bars have one additional "Options" button which looks like a drop-down arrow and displays a menu for switching bar’s state. The dynamic resizable control bars are able to switch into the constantly floating state, float inside MDI client area in MDI applications and switch into the tab page mode in SDI applications which use the Prof-UIS tab page container window as the main view window.

You can change the design of your application and use dynamic resizable control bars both instead simple resizable control bars and classic view windows. All the windows in your application will be created as children of dynamic resizable control bars. Some of them can initially appear in the dockable mode and look like resizable control bars. Some other can appear inside the MDI client area and look like MDI child frames. The state of all the dynamic resizable bars will be saved/restored by the dynamic bar site. All the bars inside the MDI client area can also become restored.

There are several sample applications dedicated to the dynamic resizable control bars. Please take a look at MDI_DynamicBars. It creates 40 dynamic resizable bars with the colored edit control inside each of them. You can see both dockable bars and bars inside the MDI client area. The state of all bars is restored and the background color of the edit windows inside each bar is also restored. The edit control’s background color is saved/restored as the part of its dynamic resizable bar’s state. You can also save restore any your specific data for each of your windows inside dynamic resizable control bars. This requires you to code your own CExtDynamicControlBar-derived class responsible for saving/restoring any custom data related to the window inside the bar. In case of colored editor container bars in the MDI_DynamicBars sample the CSimpleControlBar class performs background color serialization in the OnSerializeDynamicProps() overridden virtual method. Your dynamic resizable control bar should save/load the file name and other document properties.

Timothy Anderson Jan 9, 2006 - 4:53 PM

It would be nice to store this in some XML style format instead of the mystery goo that gets stored in the registry somewhere - along with being able to switch between HKLM and HKCU.

Technical Support Jan 10, 2006 - 11:23 AM

This is already in our TO-DO list. We have started to support XML version of state in the new ProfSkin subsystem. We will add XML support for other controls step by step.