Solved

Splitter window and Tree View

Posted on 1998-05-14
2
221 Views
Last Modified: 2013-11-20
I'm trying to figure out how to route the windows messages in the following scenario.

I have the following classes
CWLSFrame - This frame handles create a static splitter window.  There are only two windows.  The left window is assigned the my CWLSTreeView class, and the right window is assigned to my CWLSEntityView class.

CWLSTreeView - This class takes care of the TreeCtrl and inserts items into the tree.  It also receives the message when the user changes the currently selected tree item.

CWLSEntityView - A generic view class of the Tree.

CWLSSoundView - When the user selects a "sound item" in the tree, I want it to use this view.

I understand how to manipulate the above classes into the different views.  My question is, when a user changes their selection in the Tree.  How can I get this message to the CWLSFrame so that it can change the splitter window?

Thanks in advance
Chris Paalman
cpaalman@cnc-inc.com
0
Comment
Question by:cpaalman
[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 1

Accepted Solution

by:
guruprasad031298 earned 200 total points
ID: 1311008
In your case CWLSFrame is the parent frame of CWLSTreeView, hence you can do this :

1. Handle the TVN_SELCHANGED reflected message in your tree control class member of the TreeView

2. In the handler, which will most probably be OnSelChanged, make a call to GetParentFrame () and type cast the result with (CWLSFrame *) to get a pointer to the parent frame window, say pWLSFrame

3. Add an user defined message, say WM_CHANGESPLITTER (message to change your splitter) to the CWLSFrame class and a handler for the same. Put your 'splitter change' functionality in the handler sunction.

4. Send WM_CHANGESPLITTER message from OnSelChanged handler of the tree control, using

pWLSFrame->SendMessage (WM_CHANGESPLITTER, (WPARAM) 0, (LPARAM)0)

which should call your WM_CHANGESPLITTER handler (say OnChangeSplitter) in CWLSFrame.
0
 

Author Comment

by:cpaalman
ID: 1311009
WOW, this is the time I've been on this web site, and I asked my first question and in less than 2 hours I had the answer I needed.  Thanks!!!
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Get filename and folder into excel 7 87
Pressing cancel button with C# UI Automation 3 101
Fibonacci challenge 11 140
Notepad++ Question 11 22
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses

739 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