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.

110 lines
2.5 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1998 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // AtlBaseWizPage.cpp
  7. //
  8. // Abstract:
  9. // Implementation of wizard page classes
  10. //
  11. // Author:
  12. // David Potter (davidp) May 26, 1998
  13. //
  14. // Revision History:
  15. //
  16. // Notes:
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #include "AtlBaseWizPage.h"
  20. /////////////////////////////////////////////////////////////////////////////
  21. // class CWizardPageList
  22. ///////////////////////////////////////////////////////////////////////////
  23. /////////////////////////////////////////////////////////////////////////////
  24. //++
  25. //
  26. // CWizardPageList::PwpageFromID
  27. //
  28. // Routine Description:
  29. // Get a pointer to a page from a dialog ID.
  30. //
  31. // Arguments:
  32. // psz [IN] Dialog ID.
  33. //
  34. // Return Value:
  35. // pwpage Pointer to page corresponding to the dialog ID.
  36. // NULL Page wasn't found.
  37. //
  38. // Exceptions Thrown:
  39. // None.
  40. //
  41. //--
  42. /////////////////////////////////////////////////////////////////////////////
  43. CWizardPageWindow * CWizardPageList::PwpageFromID( IN LPCTSTR psz )
  44. {
  45. ATLASSERT( psz != NULL );
  46. CWizardPageWindow * pwpage = NULL;
  47. iterator itCurrent = begin();
  48. iterator itLast = end();
  49. for ( ; itCurrent != itLast ; itCurrent++ )
  50. {
  51. ATLASSERT( *itCurrent != NULL );
  52. if ( (*itCurrent)->Ppsp()->pszTemplate == psz )
  53. {
  54. pwpage = *itCurrent;
  55. break;
  56. } // if: found match
  57. } // for: each item in the list
  58. return pwpage;
  59. } //*** CWizardPageList::PwpageFromID()
  60. /////////////////////////////////////////////////////////////////////////////
  61. //++
  62. //
  63. // CWizardPageList::PwpageFromID
  64. //
  65. // Routine Description:
  66. // Get a pointer to the next page from a dialog ID.
  67. //
  68. // Arguments:
  69. // psz [IN] Dialog ID.
  70. //
  71. // Return Value:
  72. // pwpage Pointer to page corresponding to the dialog ID.
  73. // NULL Page wasn't found.
  74. //
  75. // Exceptions Thrown:
  76. // None.
  77. //
  78. //--
  79. /////////////////////////////////////////////////////////////////////////////
  80. CWizardPageWindow * CWizardPageList::PwpageNextFromID( IN LPCTSTR psz )
  81. {
  82. ATLASSERT( psz != NULL );
  83. CWizardPageWindow * pwpage = NULL;
  84. iterator itCurrent = begin();
  85. iterator itLast = end();
  86. for ( ; itCurrent != itLast ; itCurrent++ )
  87. {
  88. ATLASSERT( *itCurrent != NULL );
  89. if ( (*itCurrent)->Ppsp()->pszTemplate == psz )
  90. {
  91. itCurrent++;
  92. if ( itCurrent != end() )
  93. {
  94. pwpage = *itCurrent;
  95. } // if: not last page
  96. break;
  97. } // if: found match
  98. } // for: each item in the list
  99. return pwpage;
  100. } //*** CWizardPageList::PwpageNextFromID()