Solved

Child Dialogs

Posted on 1999-01-29
7
275 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
Creating Labels and Frequency list style reports in SAS code 9 105
viewing source code from eclipse 13 110
fizzArray  challenge 1 96
moto 4g phone enable finger print 4 26
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: 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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

856 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