Team Fortress 2 Source Code as on 22/4/2020
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.

77 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. // chooser.cpp : Implements the CDialogChooser class
  9. //
  10. #include "stdafx.h"
  11. #include "valvelib.h"
  12. #include "chooser.h"
  13. #include "cstm1dlg.h"
  14. #ifdef _PSEUDO_DEBUG
  15. #undef THIS_FILE
  16. static char THIS_FILE[] = __FILE__;
  17. #endif
  18. // On construction, set up internal array with pointers to each step.
  19. CDialogChooser::CDialogChooser()
  20. {
  21. m_pDlgs[0] = NULL;
  22. m_pDlgs[1] = new CCustom1Dlg;
  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. // The destructor deletes entries in the internal array corresponding to
  30. // custom steps.
  31. CDialogChooser::~CDialogChooser()
  32. {
  33. for (int i = FIRST_CUSTOM_STEP; i <= LAST_CUSTOM_STEP; i++)
  34. {
  35. ASSERT(m_pDlgs[i] != NULL);
  36. delete m_pDlgs[i];
  37. }
  38. }
  39. // Use the internal array to determine the next step.
  40. CAppWizStepDlg* CDialogChooser::Next(CAppWizStepDlg* pDlg)
  41. {
  42. ASSERT(0 <= m_nCurrDlg && m_nCurrDlg < LAST_DLG);
  43. ASSERT(pDlg == m_pDlgs[m_nCurrDlg]);
  44. m_nCurrDlg++;
  45. // Force the custom dialog to re-figire out stuff when we enter it...
  46. // if (m_nCurrDlg == 1)
  47. // {
  48. // (CCustom1Dlg*)m_pDlgs[1]->Refresh
  49. // }
  50. return m_pDlgs[m_nCurrDlg];
  51. }
  52. // Use the internal array to determine the previous step.
  53. CAppWizStepDlg* CDialogChooser::Back(CAppWizStepDlg* pDlg)
  54. {
  55. ASSERT(1 <= m_nCurrDlg && m_nCurrDlg <= LAST_DLG);
  56. ASSERT(pDlg == m_pDlgs[m_nCurrDlg]);
  57. m_nCurrDlg--;
  58. // Force the custom dialog to re-figire out stuff when we enter it...
  59. if (m_nCurrDlg == 1)
  60. {
  61. }
  62. return m_pDlgs[m_nCurrDlg];
  63. }