|
-
Dec 18th, 2002, 09:09 AM
#1
Thread Starter
Addicted Member
Inserting MFC dialogs into MFC dialogs..?
Right, I have an MFC class derived from the CDialog class. I then have loads more of them. Is there a way to insert these other dialogs into the main dialog class?
If you don't know what I mean, I'm trying to create a GUI that has several stages. I want to place the dialog referring to the current stage into the main dialog so that it can be used.
For example, take a Wizard type GUI, when you press Next (or whatever) you are taken to the next page. Now, if that next page is a different dialog placed on top of the main dialog, then this would be approximately the same as what I want.
Hope you understand and can help.
Thanks
HD
-
Dec 18th, 2002, 10:07 AM
#2
Frenzied Member
Did you try the SetParent() api? It requires the HWND for the proposed parent, proposed child.
It therefore also changes the message chain - so you need to watch out if you are trapping messages for your main window that you don't mess up messages meant for the child.
-
Dec 18th, 2002, 10:13 AM
#3
You mean a chain of dialogs like the VC++6 wizards?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Dec 18th, 2002, 10:22 AM
#4
Thread Starter
Addicted Member
Because I don't have many stages to my app, and I know the contents of the dialogs (controls etc), I will probably create dialogs for each stage. I can then load them when required.
I was asking if I could have a main dialog that would display these dialogs within it. Therefore pressing the Next could increment the counter and load a different dialog into the window.
HD
-
Dec 18th, 2002, 03:46 PM
#5
Addicted Member
I'm pretty sure that what you want is property pages.
-
Dec 18th, 2002, 05:03 PM
#6
No, not quite property pages. Those are a little different.
What is a controlling dialog good for? Why not have more than one dialog that all are top-level and simply shown one after the other?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Dec 19th, 2002, 04:27 AM
#7
Thread Starter
Addicted Member
As I said in my last post - thats probably what I'll do.
The reason for the control is that I have no idea how many Dialogs I may have. At this moment I do, but the expansion to the app could mean numerous dialogs.
HD
-
Dec 19th, 2002, 05:38 AM
#8
Make an array of CDialog pointers (best would be a CTypedPtrArray or CTypedPtrList) and an index that indicates which dialog is current. When the user clicks next you increment the index, when the user clicks previous you decrement it. Do this in a loop until Finish is clicked.
Then all your dialogs are automatically shown and you only need to play around with creating new instances of various dialog subclasses that you then add to the array.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|