[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 377
  • Last Modified:

Titles for splitter windows

I have a CSplitterWnd with a CTreeView on the left and a CScrollView on the right.   I'd like to place titles above the CTreeView and CScrollView. (Similar to the "All Folders" and "Contents of..." titles displayed by Windows Explorer.)  How do I do this?
0
JohnWeidner
Asked:
JohnWeidner
  • 3
  • 3
1 Solution
 
chensuCommented:
The "All Folders" and "Contents of..." titles displayed by Windows Explorer are static windows. You can use CStatic class to create them and use CWnd::SetWindowText() (CStatic is derived from CWnd) to set the text.

0
 
JohnWeidnerAuthor Commented:
Yes, but how do I make the title's CStatic windows appear as being within the splitter area and above the TreeView and ScrollView.
0
 
chensuCommented:
You can use CSplitterWnd::CreateStatic() to create a static splitter window with four panes: two CStatic, CTreeView and CScrollView. Please see Programming with MFC - Technical Note 29 for how to create nonview panes.

Or, you can create two views CLeftView (CStatic and CTreeView are its child windows) and CRightView (CStatic and CScrollView are its child windows). Then, create a static splitter window with two panes: CLeftView and CRightView.

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
JohnWeidnerAuthor Commented:
If I used the first suggestion (one splitter with four panes) wouldn't the user be able to resize the split between the titles and the views below them?  The second suggestion sounds more like what I think I need to do.  Considering, that the program already has the splitter with the tree and scroll views set up, I was wishing there would be an easier way to simply add titles.
0
 
chensuCommented:
Yes, the first method is not good. I am also wondering whether we can put two windows (e.g., CStatic and CTreeView) into one pane by calling CSplitterWnd::CreateView() twice with the same pane. And set their initial position and size within OnCreate() of the two windows. If this way is OK, please let me know. Thank you.


0
 
JohnWeidnerAuthor Commented:
Sorry, it took so long for me to grade.  I got side tracked on other projects.  I have yet to try to implement your suggestions but I didn't want to string you out waiting for a grade any longer.
0
 
kbbCommented:
What about having the title be a status bar control, docked to the top of each of the splitter's two frame views? Haven't tried it yet, but that's what I figured Microsoft had done in their explorer.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now