Solved

Titles for splitter windows

Posted on 1997-04-01
7
343 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

757 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