Solved

Splitter window and Tree View

Posted on 1998-05-14
2
216 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
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

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

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 …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 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

16 Experts available now in Live!

Get 1:1 Help Now