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.

123 lines
2.9 KiB

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