Solved

CSplitterWnd w/ non-CView derived panes

Posted on 1998-04-11
2
652 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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 is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

726 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