home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 21 / IOPROG_21.ISO / SOFT / WIZPROP.ZIP / WizPropertySheet.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-03  |  1.6 KB  |  77 lines

  1. // WizPropertySheet.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "MySetup.h"
  6. #include "WizPropertySheet.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CWizPropertySheet
  16.  
  17. IMPLEMENT_DYNAMIC(CWizPropertySheet, CPropertySheet)
  18.  
  19. CWizPropertySheet::CWizPropertySheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
  20.     :CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
  21. {
  22.     SetWizardMode();
  23. }
  24.  
  25. CWizPropertySheet::CWizPropertySheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
  26.     :CPropertySheet(pszCaption, pParentWnd, iSelectPage)
  27. {
  28.     SetWizardMode();
  29. }
  30.  
  31. CWizPropertySheet::~CWizPropertySheet()
  32. {
  33. }
  34.  
  35. void CWizPropertySheet::AddPage( CWizPropertyPage *pPage )
  36. {
  37.     CPropertySheet::AddPage(pPage);
  38.     pPage->m_pPropSheet = this;
  39. }
  40.  
  41.  
  42. BEGIN_MESSAGE_MAP(CWizPropertySheet, CPropertySheet)
  43.     //{{AFX_MSG_MAP(CWizPropertySheet)
  44.         // NOTE - the ClassWizard will add and remove mapping macros here.
  45.     //}}AFX_MSG_MAP
  46. END_MESSAGE_MAP()
  47.  
  48. /////////////////////////////////////////////////////////////////////////////
  49. // CWizPropertySheet message handlers
  50.  
  51. void CWizPropertySheet::EnablePages(BOOL bEnable, int nStart, int nEnd /* = -1 */)
  52. {
  53.     if (nEnd == -1)
  54.         nEnd = nStart;
  55.  
  56.     if (nStart > nEnd)
  57.     {
  58.         int tmp = nEnd;
  59.         nEnd = nStart;
  60.         nStart = tmp;
  61.     }
  62.  
  63.     int count = GetPageCount();
  64.  
  65.     if (nEnd >= count)
  66.         nEnd = count -1;
  67.  
  68.     CWizPropertyPage *pPage;
  69.  
  70.     
  71.     for (int act=nStart; act <= nEnd;act++)
  72.     {
  73.         pPage = (CWizPropertyPage*) GetPage(act);
  74.         pPage->Enable(bEnable);
  75.     }
  76. }
  77.