Multiple Level Dialog with Back, Next buttons 
Author Message
 Multiple Level Dialog with Back, Next buttons

Wendy,

I think that you probably want to have a look at CPropertySheet and
CPropertyPage which will implement most of the functionality for tab sheets
automatically. This will avoid the need for your OnBack() and OnNext()
handlers.

Hope this is helpful.

Anthony



Quote:
> Hi!

> I'm trying to implement a multiple level dialog with Next, Back and
Finish
> buttons at each level.  Something like InstallShield.  

> I'm having trouble navigating back and forth between levels.

> Let say there are two levels.  Whenever I navigate back to the parent
> dialog (by means of CChildDlg::OnBack()), the parent dialog will get
stuck
> and would not process any message.

> Am I totally off track?



Tue, 01 Feb 2000 03:00:00 GMT  
 Multiple Level Dialog with Back, Next buttons



Quote:
> Anthony,

> No, I need to hold the user's hand to go through each dialog in a
> particular sequence, just like InstallShield which cannot be suffice by a
> CPropertySheet.

> As with the CPropertySheet, it's up to the user whether to go through
each
> CPropertyPage in any sequence they want.

Ok. Let's be more specific: Look up CPropertySheet::SetWizardMode and
CPropertySheet::SetWizardButtons.
THEN look at the rest of CPropertySheet and CPropertyPage.

Those two fns configure a wizard as opposed to a normal CPropertySheet.
--Curtis



Tue, 01 Feb 2000 03:00:00 GMT  
 Multiple Level Dialog with Back, Next buttons

Quote:

> Hi!

> I'm trying to implement a multiple level dialog with Next, Back and
> Finish
> buttons at each level.  Something like InstallShield.

> I'm having trouble navigating back and forth between levels.

> Let say there are two levels.  Whenever I navigate back to the parent
> dialog (by means of CChildDlg::OnBack()), the parent dialog will get
> stuck
> and would not process any message.

> Am I totally off track?  Can someone please point me to the right
> direction, some sample, etc.

> void CParentDlg::OnNext()
> {
>         // Always hide itself first
>         ShowWindow(SW_HIDE);

>         // Then, show the child dlg if it's been created already
>         if (m_pChildDlg != NULL){
>                 m_pChildDlg->ShowWindow(SW_SHOW);
>                 return;
>         }

>         // Create for the first time
>         CChildDlg dlg;
>         dlg.DoModal();

>         // Save the child dlg ptr for the next OnNext event (see the
> second code
> block above)
>         m_pChildDlg = &dlg;
> }

> void CChildDlg::OnBack()
> {
>         // Always hide itself first
>         ShowWindow(SW_HIDE);

>         // Show it's parent dlg
>         GetParent()->ShowWindow(SW_SHOW);
> }

> Thanks in advance!
> Wendy

   Dear Wendy,
    you are probably not on the right track...sorry,
    the are two ways to invoke a dialog box - modal and modaless,
    when you use a modal dialog, nothing else will be active untile the
dialog returns it's result to the calling thread, on the other hand,
when using a modaless dialog, you cvreate another thread (like the
find/replace dialog).

    what's wrong with your code, is that as long as the child modal is
active(in modal state), the parent dialog does not get input. if you
want to remain using the modal state try this:

#define ID_BACK 0x8765  //user defined message

CParentDialog::OnNext()
{
    CChildDlg dlg;

    ShowWindow(SW_HIDE);
    int result = dlg.DoModal();
    ShowWindow(SW_SHOW);

    if(result == ID_BACK) //did jony pressed the back button of the
child dialog?
    {
    }
    else //do here whateven you want
    {
    }

Quote:
}

CChildDialog::OnBack()
{
    EndModalLoop(ID_BACK);

Quote:
}

 if there is something you didn't understand, just EMail me.

 best
     Ya'eer


http://www.israelkehat.com



Tue, 01 Feb 2000 03:00:00 GMT  
 Multiple Level Dialog with Back, Next buttons

Anthony,

No, I need to hold the user's hand to go through each dialog in a
particular sequence, just like InstallShield which cannot be suffice by a
CPropertySheet.

As with the CPropertySheet, it's up to the user whether to go through each
CPropertyPage in any sequence they want.



Quote:
> Wendy,

> I think that you probably want to have a look at CPropertySheet and
> CPropertyPage which will implement most of the functionality for tab
sheets
> automatically. This will avoid the need for your OnBack() and OnNext()
> handlers.

> Hope this is helpful.

> Anthony



Tue, 01 Feb 2000 03:00:00 GMT  
 Multiple Level Dialog with Back, Next buttons

Hi Ya'eer!

Thanks for your suggestion.  I think I'm going to take the CPropertySheet
approach which suggested by two other postings.



Quote:
>    Dear Wendy,
>     you are probably not on the right track...sorry,
>     the are two ways to invoke a dialog box - modal and modaless,
>     when you use a modal dialog, nothing else will be active untile the
> dialog returns it's result to the calling thread, on the other hand,
> when using a modaless dialog, you cvreate another thread (like the
> find/replace dialog).

>     what's wrong with your code, is that as long as the child modal is
> active(in modal state), the parent dialog does not get input. if you
> want to remain using the modal state try this:

> #define ID_BACK 0x8765  //user defined message

> CParentDialog::OnNext()
> {
>     CChildDlg dlg;

>     ShowWindow(SW_HIDE);
>     int result = dlg.DoModal();
>     ShowWindow(SW_SHOW);

>     if(result == ID_BACK) //did jony pressed the back button of the
> child dialog?
>     {
>     }
>     else //do here whateven you want
>     {
>     }
> }

> CChildDialog::OnBack()
> {
>     EndModalLoop(ID_BACK);
> }

>  if there is something you didn't understand, just EMail me.

>  best
>      Ya'eer


> http://www.israelkehat.com



Tue, 01 Feb 2000 03:00:00 GMT  
 Multiple Level Dialog with Back, Next buttons

Configure your property sheet as a wizard to get this behavior. There is a
Win32 sample which ships with VC5 showing the mechanics. It's not hard to
modify the sample into an MFC app. Just search on "wizard" to find what you
need.

--
Don Howes
Infonet Software Solutions



Quote:
> Anthony,

> No, I need to hold the user's hand to go through each dialog in a
> particular sequence, just like InstallShield which cannot be suffice by a
> CPropertySheet.

> As with the CPropertySheet, it's up to the user whether to go through
each
> CPropertyPage in any sequence they want.



> > Wendy,

> > I think that you probably want to have a look at CPropertySheet and
> > CPropertyPage which will implement most of the functionality for tab
> sheets
> > automatically. This will avoid the need for your OnBack() and OnNext()
> > handlers.

> > Hope this is helpful.

> > Anthony



Tue, 01 Feb 2000 03:00:00 GMT  
 Multiple Level Dialog with Back, Next buttons

Hi!

I'm trying to implement a multiple level dialog with Next, Back and Finish
buttons at each level.  Something like InstallShield.  

I'm having trouble navigating back and forth between levels.

Let say there are two levels.  Whenever I navigate back to the parent
dialog (by means of CChildDlg::OnBack()), the parent dialog will get stuck
and would not process any message.

Am I totally off track?  Can someone please point me to the right
direction, some sample, etc.

void CParentDlg::OnNext()
{
        // Always hide itself first
        ShowWindow(SW_HIDE);  

        // Then, show the child dlg if it's been created already
        if (m_pChildDlg != NULL){
                m_pChildDlg->ShowWindow(SW_SHOW);
                return;
        }

        // Create for the first time
        CChildDlg dlg;
        dlg.DoModal();

        // Save the child dlg ptr for the next OnNext event (see the second code
block above)
        m_pChildDlg = &dlg;

Quote:
}

void CChildDlg::OnBack()
{
        // Always hide itself first
        ShowWindow(SW_HIDE);    

        // Show it's parent dlg
        GetParent()->ShowWindow(SW_SHOW);    

Quote:
}

Thanks in advance!
Wendy


Tue, 01 Feb 2000 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Multiple Level Dialog with Back, Next buttons

2. Multiple Level Dialog with Back, Next buttons

3. Owner draw button in replacement of the next/back button in a CPropertySheet in Wizard mode

4. Wizard BACK, NEXT buttons

5. Property Page + Back & Next button Focus

6. Relabeling the Final/Next/Back buttons in Wizard mode on CPropertySheet

7. Wizard Buttons: Back AND Next AND Finish

8. Wizard BACK, NEXT buttons

9. Dialog Box with Next Button

10. Hopefully move to the next level

11. Boost Your Engineering Career To The Next Level

12. Take IIS Customaiztion to the next level

 

 
Powered by phpBB® Forum Software