Solved

CSplitterWnd w/ non-CView derived panes

Posted on 1998-04-11
2
637 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

792 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