home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / C_C++ / BisonFlexWizard / data1.cab / Src / Wizard / Chooser.cpp next >
Encoding:
C/C++ Source or Header  |  2000-01-16  |  1.4 KB  |  60 lines

  1. // chooser.cpp : Implements the CDialogChooser class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Parser.h"
  6. #include "chooser.h"
  7. #include "ProjectFilesDlg.h"
  8.  
  9. #ifdef _PSEUDO_DEBUG
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. // On construction, set up internal array with pointers to each step.
  15. CDialogChooser::CDialogChooser()
  16. {
  17.     m_pDlgs[0] = NULL;
  18.  
  19.     m_pDlgs[1] = new CProjectFilesDlg;
  20.     //m_pDlgs[2] = new CCustom2Dlg;
  21.     //m_pDlgs[3] = new CCustom3Dlg;
  22.  
  23.     m_nCurrDlg = 0;
  24. }
  25. // Remember where the custom steps begin, so we can delete them in
  26. //  the destructor
  27. #define FIRST_CUSTOM_STEP 1
  28. #define LAST_CUSTOM_STEP 1
  29.  
  30. // The destructor deletes entries in the internal array corresponding to
  31. //  custom steps.
  32. CDialogChooser::~CDialogChooser()
  33. {
  34.     for (int i = FIRST_CUSTOM_STEP; i <= LAST_CUSTOM_STEP; i++)
  35.     {
  36.         ASSERT(m_pDlgs[i] != NULL);
  37.         delete m_pDlgs[i];
  38.     }
  39. }
  40.  
  41. // Use the internal array to determine the next step.
  42. CAppWizStepDlg* CDialogChooser::Next(CAppWizStepDlg* pDlg)
  43. {
  44.     ASSERT(0 <= m_nCurrDlg && m_nCurrDlg < LAST_DLG);
  45.     ASSERT(pDlg == m_pDlgs[m_nCurrDlg]);
  46.  
  47.     m_nCurrDlg++;
  48.     return m_pDlgs[m_nCurrDlg];
  49. }
  50.  
  51. // Use the internal array to determine the previous step.
  52. CAppWizStepDlg* CDialogChooser::Back(CAppWizStepDlg* pDlg)
  53. {
  54.     ASSERT(1 <= m_nCurrDlg && m_nCurrDlg <= LAST_DLG);
  55.     ASSERT(pDlg == m_pDlgs[m_nCurrDlg]);
  56.  
  57.     m_nCurrDlg--;
  58.     return m_pDlgs[m_nCurrDlg];
  59. }
  60.