home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / internet / httpsvr / genpage.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  2.4 KB  |  106 lines

  1. // GenPage.cpp : implementation file
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1997-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "httpsvr.h"
  15. #include "GenPage.h"
  16. #include "HttpDoc.h"
  17.  
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CGenPage property page
  26.  
  27. IMPLEMENT_DYNCREATE(CGenPage, CPropertyPage)
  28.  
  29. CGenPage::CGenPage() : CPropertyPage(CGenPage::IDD)
  30. {
  31. }
  32.  
  33. CGenPage::CGenPage( CHttpSvrDoc* pDoc )
  34.     : CPropertyPage(CGenPage::IDD)
  35. {
  36.     //{{AFX_DATA_INIT(CGenPage)
  37.     m_bListIcon = FALSE;
  38.     m_bAllowListing = FALSE;
  39.     m_bLoggingOn = FALSE;
  40.     //}}AFX_DATA_INIT
  41.     m_pDoc = pDoc;
  42. }
  43.  
  44. CGenPage::~CGenPage()
  45. {
  46. }
  47.  
  48. void CGenPage::DoDataExchange(CDataExchange* pDX)
  49. {
  50.     CPropertyPage::DoDataExchange(pDX);
  51.     //{{AFX_DATA_MAP(CGenPage)
  52.     DDX_Check(pDX, IDC_LISTICONS, m_bListIcon);
  53.     DDX_Check(pDX, IDC_ALLOWLIST, m_bAllowListing);
  54.     DDX_Check(pDX, IDC_LOGGINGON, m_bLoggingOn);
  55.     //}}AFX_DATA_MAP
  56. }
  57.  
  58.  
  59. BEGIN_MESSAGE_MAP(CGenPage, CPropertyPage)
  60.     //{{AFX_MSG_MAP(CGenPage)
  61.     ON_BN_CLICKED(IDC_ALLOWLIST, OnAllowList)
  62.     //}}AFX_MSG_MAP
  63. END_MESSAGE_MAP()
  64.  
  65. /////////////////////////////////////////////////////////////////////////////
  66. // CGenPage message handlers
  67.  
  68. void CGenPage::OnOK()
  69. {
  70.     BOOL bModified = FALSE;
  71.     if ( m_pDoc->m_bListIcon != m_bListIcon )
  72.     {
  73.         m_pDoc->m_bListIcon = m_bListIcon;
  74.         bModified = TRUE;
  75.     }
  76.     if ( m_pDoc->m_bAllowListing != m_bAllowListing )
  77.     {
  78.         m_pDoc->m_bAllowListing = m_bAllowListing;
  79.         bModified = TRUE;
  80.     }
  81.     if ( m_pDoc->m_bLoggingOn != m_bLoggingOn )
  82.     {
  83.         m_pDoc->m_bLoggingOn = m_bLoggingOn;
  84.         bModified = TRUE;
  85.     }
  86.  
  87.     if ( bModified )
  88.         m_pDoc->SetModifiedFlag( TRUE );
  89.  
  90.     CPropertyPage::OnOK();
  91. }
  92.  
  93.  
  94. void CGenPage::OnAllowList()
  95. {
  96.     GetDlgItem(IDC_LISTICONS)->EnableWindow(
  97.         IsDlgButtonChecked(IDC_ALLOWLIST) );
  98. }
  99.  
  100. BOOL CGenPage::OnInitDialog()
  101. {
  102.     CPropertyPage::OnInitDialog();
  103.     return TRUE;  // return TRUE unless you set the focus to a control
  104.                   // EXCEPTION: OCX Property Pages should return FALSE
  105. }
  106.