Solved

Splitter window and Tree View

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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 used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

910 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

25 Experts available now in Live!

Get 1:1 Help Now