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 General Discussion » Minimum Docking Window Size? Collapse All
Subject Author Date
Andrew Harding Jun 5, 2006 - 5:50 PM

I have a couple questions about CExtDynamicControlBars:

1. Is there a way to set the minimum window size for CExtDynamicControlBars? The problem I have is that if a user saves a docking layout on a large screen with high resolution and then copies the registry settings to another computer with a smaller screen / lower resolution the docking windows shrink so much that in many cases they completely overlap and hide some of the other docking windows.

2. Is there a way to make it so that calling CExtDynamicBarSite::StateLoad() is not resolution dependant?

Technical Support Jun 6, 2006 - 10:50 AM

The CExtControlBar::ProfileBarStateLoad() method has the WINDOWPLACEMENT* parameter. Just specify NULL in this parameter if you do not want to load the frame location.

Andrew Harding Jun 6, 2006 - 11:03 AM

Ok that seems to resolve the resolution difference issues, thanks.

Is there a way to set the minimum size of a CExtDynamicControlBar though? The problem of docking windows squishing other windows out of visible existance is still a problem when the user is manually resizing the CFrameWnd.

Technical Support Jun 6, 2006 - 11:58 AM

You can use a control bar class which implements the following virtual methods:

       virtual INT _CalcDesiredMinHW() const;

       virtual INT _CalcDesiredMinVH() const
The _CalcDesiredMinHW() and _CalcDesiredMinVH() methods return the minimal horizontal width and minimal vertical height in pixels.

Please note that if you restrict the size of the resizable control bar, that may result in appearing of not well looking layouts when the size of the main frame window is small and does not allow all the bars to fit the main frame’s area.

Andrew Harding Jun 6, 2006 - 2:22 PM

That fixed it thanks.

You sound as if you would suggest that I not take this approach, is there a different approach you would suggest that would accomplish the same goal. The CExtDynamicControlBars docking placement is decided by the user docking it via mouse drag, since it’s not done programmatically I’m not sure how else to preserve the windows relative sizes. Ordinarily I’d use DockControlBarLTRB () and specify a percentage of the window space to take up but since it’s done via the mouse I’m not sure that this is an option.

Technical Support Jun 7, 2006 - 10:40 AM

No, you can safely use size restriction based on overriding these virtual methods. But we think there is no reason to restrict the size of resizable control bars at all. Any user can configure positions of all the resizable control bars when they run your application for first time. Typically nobody changes the position of application’s main frame window after they start working with it.