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.

138 lines
3.1 KiB

  1. // AlertPage.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "snapin.h"
  5. #include "AlertPage.h"
  6. #include "ScopePane.h"
  7. #include "HMListView.h"
  8. #include "HMEventResultsPaneItem.h"
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CAlertPage property page
  16. IMPLEMENT_DYNCREATE(CAlertPage, CPropertyPage)
  17. CAlertPage::CAlertPage() : CPropertyPage(CAlertPage::IDD)
  18. {
  19. //{{AFX_DATA_INIT(CAlertPage)
  20. m_sAlert = _T("");
  21. m_sComputer = _T("");
  22. m_sDataCollector = _T("");
  23. m_sDTime = _T("");
  24. m_sID = _T("");
  25. m_sSeverity = _T("");
  26. //}}AFX_DATA_INIT
  27. }
  28. CAlertPage::~CAlertPage()
  29. {
  30. }
  31. void CAlertPage::DoDataExchange(CDataExchange* pDX)
  32. {
  33. CPropertyPage::DoDataExchange(pDX);
  34. //{{AFX_DATA_MAP(CAlertPage)
  35. DDX_Text(pDX, IDC_EDIT_ALERT, m_sAlert);
  36. DDX_Text(pDX, IDC_EDIT_COMPUTER, m_sComputer);
  37. DDX_Text(pDX, IDC_EDIT_DATA_COLLECTOR, m_sDataCollector);
  38. DDX_Text(pDX, IDC_EDIT_DTIME, m_sDTime);
  39. DDX_Text(pDX, IDC_EDIT_ID, m_sID);
  40. DDX_Text(pDX, IDC_EDIT_SEVERITY, m_sSeverity);
  41. //}}AFX_DATA_MAP
  42. }
  43. BEGIN_MESSAGE_MAP(CAlertPage, CPropertyPage)
  44. //{{AFX_MSG_MAP(CAlertPage)
  45. ON_WM_HELPINFO()
  46. ON_BN_CLICKED(IDC_BUTTON_NEXT, OnButtonNext)
  47. ON_BN_CLICKED(IDC_BUTTON_PREVIOUS, OnButtonPrevious)
  48. //}}AFX_MSG_MAP
  49. END_MESSAGE_MAP()
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CAlertPage message handlers
  52. BOOL CAlertPage::OnInitDialog()
  53. {
  54. CDialog::OnInitDialog();
  55. return TRUE; // return TRUE unless you set the focus to a control
  56. // EXCEPTION: OCX Property Pages should return FALSE
  57. }
  58. BOOL CAlertPage::OnHelpInfo(HELPINFO* pHelpInfo)
  59. {
  60. if( m_pScopePane )
  61. {
  62. m_pScopePane->ShowTopic(_T("HMon21.chm::/oHMon21.htm"));
  63. }
  64. return CDialog::OnHelpInfo(pHelpInfo);
  65. }
  66. void CAlertPage::OnButtonNext()
  67. {
  68. if( m_iIndex > m_pListView->GetItemCount() )
  69. {
  70. return;
  71. }
  72. m_iIndex++;
  73. CHMEventResultsPaneItem* pItem = (CHMEventResultsPaneItem*)m_pListView->GetItem(m_iIndex);
  74. if( ! GfxCheckObjPtr(pItem,CHMEventResultsPaneItem) )
  75. {
  76. return;
  77. }
  78. m_sSeverity = pItem->GetDisplayName(0);
  79. m_sID = pItem->GetDisplayName(1);
  80. m_sDTime = pItem->GetDisplayName(2);
  81. m_sDataCollector = pItem->GetDisplayName(3);
  82. m_sComputer = pItem->GetDisplayName(4);
  83. m_sAlert = pItem->GetDisplayName(5);
  84. UpdateData(FALSE);
  85. }
  86. void CAlertPage::OnButtonPrevious()
  87. {
  88. if( m_iIndex == 0 )
  89. {
  90. return;
  91. }
  92. m_iIndex--;
  93. CHMEventResultsPaneItem* pItem = (CHMEventResultsPaneItem*)m_pListView->GetItem(m_iIndex);
  94. if( ! GfxCheckObjPtr(pItem,CHMEventResultsPaneItem) )
  95. {
  96. return;
  97. }
  98. m_sSeverity = pItem->GetDisplayName(0);
  99. m_sID = pItem->GetDisplayName(1);
  100. m_sDTime = pItem->GetDisplayName(2);
  101. m_sDataCollector = pItem->GetDisplayName(3);
  102. m_sComputer = pItem->GetDisplayName(4);
  103. m_sAlert = pItem->GetDisplayName(5);
  104. UpdateData(FALSE);
  105. }
  106. LRESULT CAlertPage::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
  107. {
  108. if( message == WM_COMMAND )
  109. {
  110. if( wParam == 57670 )
  111. OnHelpInfo(NULL);
  112. }
  113. return CPropertyPage::WindowProc(message, wParam, lParam);
  114. }