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 » Hide a pane in CExtSplitterWnd Collapse All
Subject Author Date
Mel Sampat Aug 18, 2005 - 11:28 AM

I have a splitter with 2 rows.


At runtime, I want to dynamically show or hide the bottom row.


I tried doing SetRowInfo(1, 0, 0) to set the row’s size to 0, but that doesn’t have any effect. Can you suggest a way to do it, or provide some sample code? Ideally, I’d like a function as follows:


void CMainFrame::ShowBottomRow(BOOL bShow);


Thanks.


-Mel

Technical Support Aug 18, 2005 - 2:24 PM

To perform this task, it would be much easier to forget about the splitter control and use resizable control bars (the CExtControlBar class) without caption (i.e. the CBRS_GRIPPER style is not applied) instead. Please take a look at the PageNavigator and PageContainer sample applications. PageNavigator uses the splitter window in which the page navigator control is inserted into the splitter’s left pane and cannot be hidden. The PageContainer application uses the resizable control bar and you can show/hide both horizontal and vertical page containers with the View pop-up menu in the menu bar. There is no visual difference between resizable control bars and splitters.

Mel Sampat Aug 18, 2005 - 4:35 PM

Thanks, that’s a good idea. Is it possible to make the CExtControlBar a child of another existing splitter pane?


I have a UI similar to Outlook Express. A Tree View on the left side and a "details" view on the right side, with a vertical splitter in between.


I want to add a CExtControlBar where the message body would be dispayed in the Outlook Express UI.  So this control bar would be a child of the 2nd column of the vertical splitter, right? How do I create it?


I tried this:


CExtControlBar m_wndNotesContainer; // declared in MainFrm.h


m_wndNotesContainer.Create(NULL, m_wndSplitter.GetPane(0, 1), 0, WS_CHILD|WS_VISIBLE|CBRS_TOP|CBRS_FLYBY|CBRS_SIZE_DYNAMIC);


But the above prevents my app from starting (not sure why). Any ideas?

Technical Support Aug 19, 2005 - 8:42 AM

It is not possible to use a control bar inside another control bar directly. The control bars are not splitters, but you can use them to create a GUI absolutely similar to the GUI based on nested splitters. You should dock a control bar with the left side of the frame window. This control bar will be a tree view bar and it will occupy the entire column on the left side:

    pTreeViewControlBar->DockControlBarInnerOuter(
        AFX_IDW_DOCKBAR_LEFT, true  );

The table of messages is the main view window in your SDI application. It is not a child of any control bar.

If you need a message preview control bar at the bottom of the table of messages (which is, as we said above, a child view window), then this bar can be docked as follows:

    pMessagePreviewControlBar->DockControlBarInnerOuter(
        AFX_IDW_DOCKBAR_BOTTOM, true  );

The message preview control bar should be docked after the tree view control bar.

Finally, if you need a news tree in the same column with the mail folders tree, then you can create a resizable control bar for this tree and dock it relative to the main folders tree:

    pTreeViewControlBar->DockControlBarLTRB(
        pNewsTreeControlBar, AFX_IDW_DOCKBAR_BOTTOM );

Of course, we assume that all the control bars were created without CBRS_GRIPPER style and have no captions. If so, you will get a splitter-like layout similar to that in Outlook Express. You don’t need to create one control bar inside another. The CExtControlBar::DockControlBarLTRB() methods allow you to dock one bar relative to other already docked control bar and, as result, two control bars will occupy the area previously occupied by one control bar. As we said before, you will be able to hide any of your control bars any time and that is the main advantage which is not provided by splitter windows. If you encounter any difficulties, just send us your project or source code so that we can help you.