Solved

Titles for splitter windows

Posted on 1997-04-01
7
350 Views
Last Modified: 2013-11-20
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
Comment
Question by:JohnWeidner
  • 3
  • 3
7 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 100 total points
ID: 1300790
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
 

Author Comment

by:JohnWeidner
ID: 1300791
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
 
LVL 23

Expert Comment

by:chensu
ID: 1300792
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:JohnWeidner
ID: 1300793
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
 
LVL 23

Expert Comment

by:chensu
ID: 1300794
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
 

Author Comment

by:JohnWeidner
ID: 1300795
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
 

Expert Comment

by:kbb
ID: 1300796
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now