home *** CD-ROM | disk | FTP | other *** search
/ PC World 2003 June / PCWorld_2003-06_cd.bin / KOMUNIK / MIRRORIT / SRC / SESSIONPROPERTIESMIRRORPAGE.CPP < prev    next >
C/C++ Source or Header  |  1998-09-01  |  2KB  |  97 lines

  1. // SessionPropertiesMirrorPage.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "MirrorIt.h"
  6. #include "SessionPropertiesMirrorPage.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. // CSessionPropertiesMirrorPage property page
  16.  
  17. IMPLEMENT_DYNCREATE(CSessionPropertiesMirrorPage, CPropertyPage)
  18.  
  19. CSessionPropertiesMirrorPage::CSessionPropertiesMirrorPage() : CPropertyPage(CSessionPropertiesMirrorPage::IDD)
  20. {
  21.     //{{AFX_DATA_INIT(CSessionPropertiesMirrorPage)
  22.     m_Mirror = -1;
  23.     m_LocalURLs = FALSE;
  24.     //}}AFX_DATA_INIT
  25. }
  26.  
  27. CSessionPropertiesMirrorPage::~CSessionPropertiesMirrorPage()
  28. {
  29. }
  30.  
  31. void CSessionPropertiesMirrorPage::DoDataExchange(CDataExchange* pDX)
  32. {
  33.     CPropertyPage::DoDataExchange(pDX);
  34.     //{{AFX_DATA_MAP(CSessionPropertiesMirrorPage)
  35.     DDX_Control(pDX, IDC_LOCALURLS, m_LocalURLsControl);
  36.     DDX_Radio(pDX, IDC_MIRROR1, m_Mirror);
  37.     DDX_Check(pDX, IDC_LOCALURLS, m_LocalURLs);
  38.     //}}AFX_DATA_MAP
  39. }
  40.  
  41.  
  42. BEGIN_MESSAGE_MAP(CSessionPropertiesMirrorPage, CPropertyPage)
  43.     //{{AFX_MSG_MAP(CSessionPropertiesMirrorPage)
  44.     ON_BN_CLICKED(IDC_MIRROR1, OnMirror1)
  45.     ON_BN_CLICKED(IDC_MIRROR2, OnMirror2)
  46.     ON_BN_CLICKED(IDC_MIRROR3, OnMirror3)
  47.     ON_BN_CLICKED(IDC_MIRROR4, OnMirror4)
  48.     //}}AFX_MSG_MAP
  49. END_MESSAGE_MAP()
  50.  
  51. /////////////////////////////////////////////////////////////////////////////
  52. // CSessionPropertiesMirrorPage message handlers
  53.  
  54. void CSessionPropertiesMirrorPage::OnMirror1() 
  55. {
  56.     OnMirror(1);
  57. }
  58.  
  59. void CSessionPropertiesMirrorPage::OnMirror2() 
  60. {
  61.     OnMirror(0);
  62. }
  63.  
  64. void CSessionPropertiesMirrorPage::OnMirror3() 
  65. {
  66.     OnMirror(0);
  67. }
  68.  
  69. void CSessionPropertiesMirrorPage::OnMirror(int i)
  70. {
  71.     m_LocalURLsControl.EnableWindow(i);
  72.     m_LocalURLsControl.SetCheck(i);
  73. }
  74.  
  75. BOOL CSessionPropertiesMirrorPage::OnInitDialog() 
  76. {
  77.     CPropertyPage::OnInitDialog();
  78.  
  79.     SetMirror(m_Mirror);
  80.     
  81.     return TRUE;  // return TRUE unless you set the focus to a control
  82.                   // EXCEPTION: OCX Property Pages should return FALSE
  83. }
  84.  
  85. void CSessionPropertiesMirrorPage::SetMirror(int i)
  86. {
  87.     i = (i > 0) ? 0 : 1;
  88.     m_LocalURLsControl.EnableWindow(i);
  89.     m_LocalURLsControl.SetCheck(i);
  90. }
  91.  
  92.  
  93. void CSessionPropertiesMirrorPage::OnMirror4() 
  94. {
  95.     OnMirror(0);
  96. }
  97.