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.

127 lines
2.9 KiB

  1. //
  2. // Application Verifier UI
  3. // Copyright (c) Microsoft Corporation, 1999
  4. //
  5. //
  6. //
  7. // module: VerfPage.cpp
  8. // author: DMihai
  9. // created: 11/1/00
  10. //
  11. // Description:
  12. //
  13. // Common parent for all our wizard property page classes
  14. //
  15. #include "stdafx.h"
  16. #include "appverif.h"
  17. #include "AVPage.h"
  18. #include "AVGlobal.h"
  19. #ifdef _DEBUG
  20. #define new DEBUG_NEW
  21. #undef THIS_FILE
  22. static char THIS_FILE[] = __FILE__;
  23. #endif
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CAppverifPage property page
  26. IMPLEMENT_DYNAMIC(CAppverifPage, CPropertyPage)
  27. CAppverifPage::CAppverifPage(ULONG uDialogId) :
  28. CPropertyPage( uDialogId )
  29. {
  30. //{{AFX_DATA_INIT(CAppverifPage)
  31. // NOTE: the ClassWizard will add member initialization here
  32. //}}AFX_DATA_INIT
  33. m_pParentSheet = NULL;
  34. }
  35. CAppverifPage::~CAppverifPage()
  36. {
  37. }
  38. BEGIN_MESSAGE_MAP(CAppverifPage, CPropertyPage)
  39. //{{AFX_MSG_MAP(CAppverifPage)
  40. ON_WM_HELPINFO()
  41. //}}AFX_MSG_MAP
  42. END_MESSAGE_MAP()
  43. /////////////////////////////////////////////////////////////////////////////
  44. ULONG CAppverifPage::GetDialogId() const
  45. {
  46. //
  47. // Oops, how did we get here ?!?
  48. // This is a virtual pure function.
  49. //
  50. //ASSERT( FALSE );
  51. return 0;
  52. }
  53. /////////////////////////////////////////////////////////////////////////////
  54. //
  55. // Return the previous page ID, based on our history array
  56. // and remove it from the array because will activate. Called
  57. // by our property pages when the "back" button is clicked
  58. //
  59. ULONG CAppverifPage::GetAndRemovePreviousDialogId()
  60. {
  61. ULONG uPrevId;
  62. INT_PTR nCrtWizardStep;
  63. nCrtWizardStep = g_aPageIds.GetSize();
  64. ASSERT( nCrtWizardStep > 0 );
  65. uPrevId = g_aPageIds.GetAt( nCrtWizardStep - 1 );
  66. g_aPageIds.RemoveAt( nCrtWizardStep - 1 );
  67. return uPrevId;
  68. }
  69. /////////////////////////////////////////////////////////////////////////////
  70. //
  71. // Property pages derived from this class should notify us
  72. // whenever we go to a next page to record the current page ID in
  73. // the global array g_aPageIds
  74. //
  75. VOID CAppverifPage::GoingToNextPageNotify( LRESULT lNextPageId )
  76. {
  77. ULONG uMyDialogId;
  78. if( -1 != lNextPageId )
  79. {
  80. //
  81. // Will go to the next page. Add our ID to the global IDs array
  82. // used for implementing the "back" button functionality.
  83. //
  84. uMyDialogId = GetDialogId();
  85. ASSERT( ( 0 == g_aPageIds.GetSize() ) || ( uMyDialogId != g_aPageIds.GetAt( g_aPageIds.GetSize() - 1 ) ) );
  86. g_aPageIds.Add( uMyDialogId );
  87. }
  88. }
  89. /////////////////////////////////////////////////////////////////////////////
  90. LRESULT CAppverifPage::OnWizardBack()
  91. {
  92. return GetAndRemovePreviousDialogId();
  93. }
  94. /////////////////////////////////////////////////////////////////////////////
  95. // CAppverifPage message handlers
  96. BOOL CAppverifPage::OnHelpInfo(HELPINFO* pHelpInfo)
  97. {
  98. return TRUE;
  99. }