Solved

Child Dialogs

Posted on 1999-01-29
7
272 Views
Last Modified: 2013-11-20
I've created a Dialog with two nested dialogs. ie a dialog with a child dialog which also has a child dialog, like a
CPropertyPage and CPropertySheet, but with another dialog in the CPropertySheet. (See diagram)

=========================================
=                                                                              =
= DIALOG 1                                                              =
=                   +++++++++++++++++++++++++++++ =
=                   + DIALOG 2                                      + =
=                   +                                   ------------------ + =
=                   +                                   - DIALOG 3- + =
=                   +                                   -                - + =
=                   +                                   -                - + =
=                   +                                   -                - + =
=                   +                                   -                - + =
=                   +                                   ------------------ + =
=                   +                                                      + =
=                   +++++++++++++++++++++++++++++ =
=                                                                              =
=========================================

My question is, is it possible to handle messages from controls on the child dialogs in the main dialog, rather than
creating a separate class for each dialog then sending a custom message to the main dialog?

Thanks

Gavin
0
Comment
Question by:gav061697
7 Comments
 

Author Comment

by:gav061697
ID: 1328514
Edited text of question
0
 

Author Comment

by:gav061697
ID: 1328515
Edited text of question
0
 
LVL 1

Expert Comment

by:arunprakash
ID: 1328516
Get the Message in the pretranslatemessage of the child dialog and call the
pretranslate message of the main dialog and handle it there.
this will do,
thanx,
bye
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:gav061697
ID: 1328517
Doesn't this still mean creating a class for each dialog?

I'm trying to avoid this because I have a lot of dialogs that I use in this way.
0
 
LVL 1

Expert Comment

by:Booth882
ID: 1328518
you have to create a class for each different dialog you are using.  if you want them all to have a common functionality, derive them all from one class, such as

class CBaseDlg : public CDialog
{
  // all the stuff you want it to do
};

class CFirstDlg : public CBaseDlg
{
  // individual workings
};

class CSecondDlg : public CBaseDlg
{
  // individual workings
};

this way you can synchronize how your dialogs work without writing the same code over and over.  also, if all of your child dialogs are the same except for the data the user puts in you can just have one class and make many instances of it.  
0
 

Author Comment

by:gav061697
ID: 1328519
I thought i'd have to do something like that...i was just hoping I didn't.
0
 
LVL 2

Accepted Solution

by:
wuxz earned 100 total points
ID: 1328520
I think you should create one dialog class at least, you can store a child dialog pointer in your dialog class. In its pretranslatemessage function, call the same function of its children one by one. Do you think it is a good idea :)

Regards

0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
sumDigits challenge 9 98
Dell Alienware Graphics Amplifier Driver for non-Alienware systems 18 120
noX challenge 17 77
Path of Workbook 3 45
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
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…

760 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

18 Experts available now in Live!

Get 1:1 Help Now