Solved

Titles for splitter windows

Posted on 1997-04-01
7
358 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question regarding Copy/Paste 16 96
Host to IP 7 78
substring method in java 1 120
twoTwo  challenge 35 102
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 …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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