Solved

Building Tree Ctrl into Dialog

Posted on 1998-09-17
2
283 Views
Last Modified: 2013-11-20
Help ! I'm trying to build a tree control into a dialog. I can create such a control by "drawing" it in the dialog box then assigning a member variable to it and manipulating it using the dialog class and using the member variable to fill the tree with data - so far no problem !

But my app needs to be able to read a file containing tree structure data when it opens, the user can modify that data, then the updated data is saved on exit.

The problem is that in order to save the data I need access to the Serialise function of the control. I think this means that I need to create a separate new class based on CTreeCtrl. However, within that new class I cannot find a way of connecting it to the control which I have created in my dialog box, and no way of mapping its members.

Please can someone tell me how I can make "child" control classes such as CTreeCtrl work with a "parent" dialog class so that the dialog class is linking with the control class, and where I should be adding data to my control - within the Dialog class or the CTreeCtrl class. How are you supposed to implement these control classes?

Sorry if the question is a messy one  - ask for more details or tell me if I'm being an idiot !

Thank you,
Boedeker
0
Comment
Question by:boedeker
2 Comments
 
LVL 1

Accepted Solution

by:
girts063098 earned 130 total points
Comment Utility
As I understood you want to create new class such as CMyTreeCtrl with new(your own) methods like LoadDataFromFile(). To do it you have to:
(you have already "drew" tree control in dialog box)
1.Create new class CMyTreeCtrl with CTreeCtrl as base class.
2.When assigning a member variable to it choose type - CMyTreeCtrl.
Now CMyTreeCtrl is the base class of tree control you "drew".
Now you can add your own methods to CMyTreeCtrl or override existing ones.

Girts.
0
 

Author Comment

by:boedeker
Comment Utility
Thanks a lot Girt - I just needed to know how to map the member variable to my "child" class, so your answer is perfect !

Boedeker
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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 …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

12 Experts available now in Live!

Get 1:1 Help Now