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.

137 lines
3.0 KiB

  1. // DPGeneralPage.cpp : implementation file
  2. //
  3. // Copyright (c) 2000 Microsoft Corporation
  4. //
  5. // 03/24/00 v-marfin Fixed help link.
  6. //
  7. #include "stdafx.h"
  8. #include "snapin.h"
  9. #include "DPGeneralPage.h"
  10. #include "HMObject.h"
  11. #ifdef _DEBUG
  12. #define new DEBUG_NEW
  13. #undef THIS_FILE
  14. static char THIS_FILE[] = __FILE__;
  15. #endif
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CDPGeneralPage property page
  18. IMPLEMENT_DYNCREATE(CDPGeneralPage, CHMPropertyPage)
  19. CDPGeneralPage::CDPGeneralPage() : CHMPropertyPage(CDPGeneralPage::IDD)
  20. {
  21. //{{AFX_DATA_INIT(CDPGeneralPage)
  22. m_sName = _T("");
  23. m_sComment = _T("");
  24. m_sCreationDate = _T("");
  25. m_sModifiedDate = _T("");
  26. //}}AFX_DATA_INIT
  27. CnxPropertyPageInit();
  28. // v-marfin 60145 : Fixed help link
  29. m_sHelpTopic = _T("HMon21.chm::/dDEgen.htm");
  30. }
  31. CDPGeneralPage::~CDPGeneralPage()
  32. {
  33. }
  34. void CDPGeneralPage::DoDataExchange(CDataExchange* pDX)
  35. {
  36. CHMPropertyPage::DoDataExchange(pDX);
  37. //{{AFX_DATA_MAP(CDPGeneralPage)
  38. DDX_Text(pDX, IDC_EDIT_NAME, m_sName);
  39. DDX_Text(pDX, IDC_EDIT_COMMENT, m_sComment);
  40. DDX_Text(pDX, IDC_STATIC_CREATED, m_sCreationDate);
  41. DDX_Text(pDX, IDC_STATIC_MODIFIED, m_sModifiedDate);
  42. //}}AFX_DATA_MAP
  43. }
  44. BEGIN_MESSAGE_MAP(CDPGeneralPage, CHMPropertyPage)
  45. //{{AFX_MSG_MAP(CDPGeneralPage)
  46. ON_WM_DESTROY()
  47. ON_EN_CHANGE(IDC_EDIT_COMMENT, OnChangeEditComment)
  48. ON_EN_CHANGE(IDC_EDIT_NAME, OnChangeEditName)
  49. //}}AFX_MSG_MAP
  50. END_MESSAGE_MAP()
  51. /////////////////////////////////////////////////////////////////////////////
  52. // CDPGeneralPage message handlers
  53. BOOL CDPGeneralPage::OnInitDialog()
  54. {
  55. // unmarshal connmgr
  56. CnxPropertyPageCreate();
  57. CHMPropertyPage::OnInitDialog();
  58. m_sName = GetObjectPtr()->GetName();
  59. m_sComment = GetObjectPtr()->GetComment();
  60. GetObjectPtr()->GetCreateDateTime(m_sCreationDate);
  61. GetObjectPtr()->GetModifiedDateTime(m_sModifiedDate);
  62. UpdateData(FALSE);
  63. return TRUE; // return TRUE unless you set the focus to a control
  64. // EXCEPTION: OCX Property Pages should return FALSE
  65. }
  66. void CDPGeneralPage::OnDestroy()
  67. {
  68. CHMPropertyPage::OnDestroy();
  69. CnxPropertyPageDestroy();
  70. }
  71. void CDPGeneralPage::OnOK()
  72. {
  73. CHMPropertyPage::OnOK();
  74. }
  75. BOOL CDPGeneralPage::OnApply()
  76. {
  77. if( ! CHMPropertyPage::OnApply() )
  78. {
  79. return FALSE;
  80. }
  81. UpdateData();
  82. GetObjectPtr()->Rename(m_sName);
  83. GetObjectPtr()->UpdateComment(m_sComment);
  84. SetModified(FALSE);
  85. return TRUE;
  86. }
  87. void CDPGeneralPage::OnChangeEditComment()
  88. {
  89. // TODO: If this is a RICHEDIT control, the control will not
  90. // send this notification unless you override the CHMPropertyPage::OnInitDialog()
  91. // function and call CRichEditCtrl().SetEventMask()
  92. // with the ENM_CHANGE flag ORed into the mask.
  93. UpdateData();
  94. SetModified();
  95. }
  96. void CDPGeneralPage::OnChangeEditName()
  97. {
  98. // TODO: If this is a RICHEDIT control, the control will not
  99. // send this notification unless you override the CHMPropertyPage::OnInitDialog()
  100. // function and call CRichEditCtrl().SetEventMask()
  101. // with the ENM_CHANGE flag ORed into the mask.
  102. UpdateData();
  103. SetModified();
  104. }