Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.5 KiB

  1. // chooser.cpp : Implements the CDialogChooser class
  2. //
  3. #include "stdafx.h"
  4. #include "resource.h"
  5. #include "ExtAw.h"
  6. #include "chooser.h"
  7. #include "extdlg.h"
  8. #include "shextdlg.h"
  9. #ifdef _PSEUDO_DEBUG
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. // On construction, set up internal array with pointers to each step.
  14. CDialogChooser::CDialogChooser()
  15. {
  16. m_pDlgs[0] = NULL;
  17. m_pDlgs[1] = new ExtensionChoice;
  18. m_pDlgs[2] = new ShellExtensions;
  19. m_nCurrDlg = 0;
  20. }
  21. // Remember where the custom steps begin, so we can delete them in
  22. // the destructor
  23. #define FIRST_CUSTOM_STEP 2
  24. #define LAST_CUSTOM_STEP 2
  25. // The destructor deletes entries in the internal array corresponding to
  26. // custom steps.
  27. CDialogChooser::~CDialogChooser()
  28. {
  29. // NOTE: Be sure to delete all of your custom steps here, but don't delete
  30. // any standard AppWizard steps you got through the GetDialog API.
  31. for (int i = FIRST_CUSTOM_STEP; i <= LAST_CUSTOM_STEP; i++)
  32. {
  33. ASSERT(m_pDlgs[i] != NULL);
  34. delete m_pDlgs[i];
  35. }
  36. }
  37. // Use the internal array to determine the next step.
  38. CAppWizStepDlg* CDialogChooser::Next(CAppWizStepDlg* pDlg)
  39. {
  40. ASSERT(0 <= m_nCurrDlg && m_nCurrDlg < LAST_DLG);
  41. ASSERT(pDlg == m_pDlgs[m_nCurrDlg]);
  42. m_nCurrDlg++;
  43. return m_pDlgs[m_nCurrDlg];
  44. }
  45. // Use the internal array to determine the previous step.
  46. CAppWizStepDlg* CDialogChooser::Back(CAppWizStepDlg* pDlg)
  47. {
  48. ASSERT(1 <= m_nCurrDlg && m_nCurrDlg <= LAST_DLG);
  49. ASSERT(pDlg == m_pDlgs[m_nCurrDlg]);
  50. m_nCurrDlg--;
  51. return m_pDlgs[m_nCurrDlg];
  52. }