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 » CExtControlBar locations Collapse All
Subject Author Date
Chris Fudge May 3, 2005 - 5:28 AM

Is there an easy way to retrieve the positions (relative to other control bars etc) of a given control bar.

I am intending to add storage of control bar positions at shutdown of my application.

Im hoping to be able to build up a hierarchy string describing the layout, which can be stored and retrieved on app startup.

To accomplish this i need to be able to retrieve the Control Bars parent control bar in the layout (if it is the main CView then this will be null). And the relative dock position to its parent e.g tabbed,docked left,docked top etc,

Thanks.

Technical Support May 4, 2005 - 2:28 AM

The internal structure of resizable bars is tree-based. Please try to carry out the following experiment.

  1. Uncomment these lines at the beginning of the ...\Src\ExtDockBar.h file:
    /// #define __DEBUG_PAINTING_AREAS_DOCKBAR__
    /// #define __DEBUG_PAINTING_AREAS_EXTRESIZABLEBAR__
  2. Rebuild Prof-UIS.
  3. Build and run any application with several resizable control bars.
You will see yellow and magenta margins near right/bottom sides of all control bars and their container windows (a.k.a. dock bars). The structure of these windows is always tree-like. This can be control bars’ containers at some nested level near any side of the main frame window. This can also be containers inside a compound floating mini-frame window. Due to this complexity, we decided not to provide a mechanism for saving bar states in form of named parameters into simple property bag like like INI/XML files. The resizable control bars’ state is serialized into MFC archives in binary form and it is assumed that the control bars are created using the data corresponding to the same control bars that were serialized before. We think that this design does not add any limitations to your application. If you need more complex bar mechanism for allocating control bars, then you can use new dynamic resizable bars introduced in the Prof-UIS 2.31 minor release. In any case, we can discuss your task in details and we will help you find the easiest solution.

Chris Fudge May 5, 2005 - 10:49 AM

Im not sure how that helps unfortunatley...

A bit of information about my application:

I am creating CExtControlBar derived "panels" dynamically at runtime, this is working fine.

Is there a way I can retrieve the posittions of these panels relative to the main View at shutdown?

Technical Support May 6, 2005 - 3:41 AM

You can get window rectangles of all the control bars but they cannot be used for restoring control bar positions because the API for docking resizable control bars with each other is not based on window rectangles. Why are you restricted to XML/text formats for saving/restoring control bar positions?

Chris Fudge May 6, 2005 - 3:48 AM

Im not necessarily restricted to xml/textual format storage - any format will probably be ok, just as long as Im able to match a control bar with a custom id that my app specifies at runtime which can then in trun be matched back again when the ap is reloaded.

How do you suggest retrieving the dock positions?

Technical Support May 7, 2005 - 10:40 AM

You can easily attach your custom data to the dynamic control bars if you implement your own CExtDynamicControlBar-derived class and override the OnSerializeDynamicProps() virtual method. Your method should call the parent method and serialize any kind of custom data that typically relate to the window inside the resizable control bar.

This can also be done for CExtControlBar windows but you would need to keep and manage the array of currently allocated control bars and their serializable data manually.