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 & CalcDynamicLayout Collapse All
Subject Author Date
Daniel Dupre Oct 28, 2007 - 4:57 PM

I have a floating window that I use for preview in a video editing application, therefore I need to maintain an aspect while resizing the preview bar, ie (4:3, 16:9). Previously I was using a CDialogBar derived class attached to the mainframe that would handel the CalcDynamicLayout(int nLength, DWORD dwMode), which I would use to get the direction of resizing and formulate the size to maintain the aspect on sizing. I switched this over to a CExtControlBar derived class, but the dwMode coming in always equals 6. Is there any way to implement the behaviour I need?

Technical Support Oct 29, 2007 - 10:27 AM

All control bars in Prof-UIS are based on CExtControlBar. There are two types of control bars which behave in an absolutely different way in Prof-UIS.

1) Resizable control bars (CExtControlBar), which are designed to be similar to resizable panels in Visual Studio .NET and Visual Studio 2005. These control bars are designed to be fully resizable without any restriction. We can implement some restriction on its size for these control bars but only in particular cases. But two resizable control bars with such a restriction may conflict with each other when they both are docked into one tabbed group or one row/column of control bars. So it’s not a good idea to restrict the size of these control bars. The CControlBar::CalcDynamicLayout() virtual method is used differently for resizable control bars in comparision with MFC control bars. If you decide to use a resizable control bar as a video player container, you should put the video player into scrollable container as it is demonstrated in the following sample application.

2) Fixed-size control bars, which are very close to MFC control bars. The fixed-size control bars can be non-resizable at all or resizable with some rules and restrictions. The CExtToolControlBar and CExtPanelControlBar classes are kind of fixed-size control bars. You can find how they are used in the FixedSizePanels sample. The CExtPanelControlBar class may be a good container for your video player and, in this case, the CControlBar::CalcDynamicLayout() virtual method is used in a similar way like in the MFC’s control bars.