Solved

Splitter window and Tree View

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

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

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: 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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

828 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