Solved

CSplitterWnd w/ non-CView derived panes

Posted on 1998-04-11
2
603 Views
Last Modified: 2013-11-20
How do you create a CSplitterWnd that has as its subpanes non CView derived classes?
Specifically, I want a CSplitterWnd with 2 columns.  In the first column is a CTreeCtrl derived class, and in the second column is a CListView derived class.
When I try and use these classes directly in calls to CSplitterWnd::CreateView they aren't created and the splitter doesn't redraw the splitter bar correctly.
0
Comment
Question by:mdouglass
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 total points
ID: 1317635
What you can do is to create a class derived from CView and all it does is be a holder to a control. For example, you can use something like this:

  class CLeftView : public CView
  {
    public:
      CTreeCtrl* m_TreeCtrl;
    // rest
  }

Then in the CLeftView::OnCreate(), create the m_TreeCtrl. Then when the CLeftView receives the following messages: WM_SETFOCUS and WM_SIZE, you need to something to the control. For focus, set the focus to the tree control. For sizing, resize the control to the entire size of the client area of the view. That way, you can make any control behave like a view.

In the long run, this will be easier.
0
 

Author Comment

by:mdouglass
ID: 1317636
Thanks, that seems to work great!
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

Suggested Solutions

Title # Comments Views Activity
Handling string inputs in C/Linux 23 168
Separate into files by filename 12 67
conditional code and condition difference 9 65
Window placement 17 65
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: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

759 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

22 Experts available now in Live!

Get 1:1 Help Now