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 » Blank Spot in Application Collapse All
Subject Author Date
Bill Olson Oct 22, 2009 - 2:12 AM

I have a CExtPanelControlBar under the menu bar in my application.  It has a dialog installed within it.  At start, the CExtPanelControlBar is disabled and not visible.  At the start the application looks like a dialog based one (though it is a Form View).  It later resizes to full screen and the CExtPanelControlBar is turned on and is visible.


If I make the template for the dialog installed in the CExtPanelControlBar very wide, it extends full screen, but I would prefer to change its size when I’m calculating the screen dimensions and resizing the other controls.  I haven’t been too successful at that, though I have a bigger problem.


If the dialog template is not as wide as the screen, there is a hole to the right of the dialog.  Whatever was behind the application when the app was started (which is usually the Visual Studio IDE) shows through.  I have tried to reproduce this in a test program, but I have not been able to.  What is causing it?  I can’t seem to figure out how to get it to go away.  I would like the CExtPanelControlBar to extend horizontally across the entire top of the application’s window.


I have another converted dialog bar that sometimes shows up below this bar and the same phenomenon exists behind it.  I can see the application behind this one around the edges of the panel.


Bill

Bill Olson Oct 22, 2009 - 7:57 PM

Here is an example of what I’m talking about



The dark gray is my application,  The buttons and the "Toggle Breakpoints" text are in the Visual Studio IDE that is behind the application.  It is like there is a hole in the application at the end of the bar.  When I have created similar bars in a test application, they span the entire area by default.  I will look into OnQueryFixedBarNewSize.


Bill

Technical Support Oct 23, 2009 - 1:19 PM

Here is some important information about MFC and Prof-UIS control bars:

1) Some types of MFC control bars are designed as non-redockable. The status bar (CExtStatusControlBar in Prof-UIS, CStatusBar in MFC) is such kind of control bar. Prof-UIS also contains C++ classes which are not really the control bars but implementing the same static/non-redockable control bar behavior (the CExtTabMdiWnd class implements the MDI tab control which is always docked near control bars or even between them).

2) Other control bars can be either redockable or static. The menu bar (CExtMenuControlBar) and toolbar CExtToolControlBar are such kind of control bars.

3) Finally, some control bars can be created as re-dockable control bars and cannot behave like statically docked status bar. The resizable control bars (CExtControlBar) similar to the Visual Studio .NET, Visual Studio 2005 and Visual Studio 2008 dockable panes and the panel control bars (CExtPanelControlBar) are such kind of control bars.

We suspect you tried to use the CExtPanelControlBar panel control bar as non-redockable. This is not supported.

If you need to place some child dialog near some border of its parent frame window, then you should create your dialog directly as child of the frame window and handle the WM_SIZEPARENT message in your dialog class. This message is sent by MFC frame windows (CFrameWnd) to their children windows for computing the mutable layout. Each children window request some space for it near some border of the frame window. The WM_SIZEPARENT message can be sent for querying the children window for information about how much space it needs and near which border. It can be sent to let the children window reposition itself near the frame border.

You don’t need any control bar classes. You should just handle the WM_SIZEPARENT message in your dialog class created as child of the main frame window. Please let us show you the real life example. We have the CExtScrollBar class and you can see two scroll bar windows are automatically docked to the sides of their parent CExtGridWnd grid control (or CExtTreeGridWnd, or CExtReportGridWnd). But the grid control does not have any code which detects and moves any scroll bar windows. The grid simply invokes the CWnd::ReposionBars() API when the WM_SIZE message is received. This is exactly the same what the MFC frame windows do: when the CFrameWnd class receives the WM_SIZE message, then it invokes the CFrameWnd::RecalcLayout() method that is the same as the CWnd::ReposionBars() method. The CWnd::ReposionBars() method sends the WM_SIZEPARENT messages to all the children windows: all the frame’s control bars, all the scroll bars inside Prof-UIS grid controls. Our CExtScrollBar control handles the WM_SIZEPARENT message which allows the scroll bar to position itself near the border of its parent window.

Technical Support Oct 22, 2009 - 1:02 PM

The CExtPanelControlBar::OnQueryFixedBarNewSize() virtual method returns the size of the panel control bar. This method is invoked for computing the horizontally docked, vertically docked and floating bar sizes. You can override it, invoke the parent class method and return modified size. For example, if you need the horizontally docked panel bar to occupy entire width of the main frame window, then you should specify width of main frame’s client area.

Please also take a look at the resizable bars containing the Internet Explorer windows in the FixedSizePanels sample application. These bars are not the panel bars. But they are always occupying the entire available width/height when docked.