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.

196 lines
5.6 KiB

  1. // ActionPagingPage1.cpp : implementation file
  2. //
  3. // 03/05/00 v-marfin bug 59643 : Make this the default starting page.
  4. #include "stdafx.h"
  5. #include "snapin.h"
  6. #include "ActionPagingPage.h"
  7. #include "Action.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CActionPagingPage property page
  15. IMPLEMENT_DYNCREATE(CActionPagingPage, CHMPropertyPage)
  16. CActionPagingPage::CActionPagingPage() : CHMPropertyPage(CActionPagingPage::IDD)
  17. {
  18. //{{AFX_DATA_INIT(CActionPagingPage)
  19. m_iWait = 0;
  20. m_sMessage = _T("");
  21. m_sPagerID = _T("");
  22. m_sPhoneNumber = _T("");
  23. //}}AFX_DATA_INIT
  24. m_sHelpTopic = _T("HMon21.chm::/Healthmon/dpageact.htm");
  25. }
  26. CActionPagingPage::~CActionPagingPage()
  27. {
  28. }
  29. void CActionPagingPage::DoDataExchange(CDataExchange* pDX)
  30. {
  31. CHMPropertyPage::DoDataExchange(pDX);
  32. //{{AFX_DATA_MAP(CActionPagingPage)
  33. DDX_Control(pDX, IDC_COMBO_THROTTLE_UNITS, m_ThrottleUnits);
  34. DDX_Text(pDX, IDC_EDIT_ANSWER_WAIT, m_iWait);
  35. DDX_Text(pDX, IDC_EDIT_MESSAGE, m_sMessage);
  36. DDX_Text(pDX, IDC_EDIT_PAGER_ID, m_sPagerID);
  37. DDX_Text(pDX, IDC_EDIT_PHONE, m_sPhoneNumber);
  38. //}}AFX_DATA_MAP
  39. }
  40. BEGIN_MESSAGE_MAP(CActionPagingPage, CHMPropertyPage)
  41. //{{AFX_MSG_MAP(CActionPagingPage)
  42. ON_BN_CLICKED(IDC_BUTTON_ADVANCED, OnButtonAdvanced)
  43. ON_CBN_SELENDOK(IDC_COMBO_THROTTLE_UNITS, OnSelendokComboThrottleUnits)
  44. ON_EN_CHANGE(IDC_EDIT_ANSWER_WAIT, OnChangeEditAnswerWait)
  45. ON_EN_CHANGE(IDC_EDIT_MESSAGE, OnChangeEditMessage)
  46. ON_EN_CHANGE(IDC_EDIT_PAGER_ID, OnChangeEditPagerId)
  47. ON_EN_CHANGE(IDC_EDIT_PHONE, OnChangeEditPhone)
  48. ON_WM_DESTROY()
  49. //}}AFX_MSG_MAP
  50. END_MESSAGE_MAP()
  51. /////////////////////////////////////////////////////////////////////////////
  52. // CActionPagingPage message handlers
  53. BOOL CActionPagingPage::OnInitDialog()
  54. {
  55. // v-marfin : bug 59643 : This will be the default starting page for the property
  56. // sheet so call CnxPropertyPageCreate() to unmarshal the
  57. // connection for this thread. This function must be called
  58. // by the first page of the property sheet. It used to
  59. // be called by the "General" page and its call still remains
  60. // there as well in case the general page is loaded by a
  61. // different code path that does not also load this page.
  62. // The CnxPropertyPageCreate function has been safeguarded
  63. // to simply return if the required call has already been made.
  64. // CnxPropertyPageDestory() must be called from this page's
  65. // OnDestroy function.
  66. // unmarshal connmgr
  67. CnxPropertyPageCreate();
  68. CHMPropertyPage::OnInitDialog();
  69. CWbemClassObject* pConsumerObject = ((CAction*)GetObjectPtr())->GetConsumerClassObject();
  70. if( pConsumerObject )
  71. {
  72. pConsumerObject->GetProperty(_T("PhoneNumber"),m_sPhoneNumber);
  73. pConsumerObject->GetProperty(_T("ID"),m_sPagerID);
  74. pConsumerObject->GetProperty(_T("Message"),m_sMessage);
  75. pConsumerObject->GetProperty(_T("AnswerTimeout"),m_iWait);
  76. delete pConsumerObject;
  77. }
  78. SendDlgItemMessage(IDC_SPIN1,UDM_SETRANGE32,0,INT_MAX-1);
  79. SendDlgItemMessage(IDC_SPIN2,UDM_SETRANGE32,0,INT_MAX-1);
  80. UpdateData(FALSE);
  81. return TRUE; // return TRUE unless you set the focus to a control
  82. // EXCEPTION: OCX Property Pages should return FALSE
  83. }
  84. BOOL CActionPagingPage::OnApply()
  85. {
  86. if( ! CHMPropertyPage::OnApply() )
  87. {
  88. return FALSE;
  89. }
  90. UpdateData();
  91. CWbemClassObject* pConsumerObject = ((CAction*)GetObjectPtr())->GetConsumerClassObject();
  92. if( pConsumerObject )
  93. {
  94. pConsumerObject->SetProperty(_T("PhoneNumber"),m_sPhoneNumber);
  95. pConsumerObject->SetProperty(_T("ID"),m_sPagerID);
  96. pConsumerObject->SetProperty(_T("Message"),m_sMessage);
  97. pConsumerObject->SetProperty(_T("AnswerTimeout"),m_iWait);
  98. pConsumerObject->SaveAllProperties();
  99. delete pConsumerObject;
  100. }
  101. SetModified(FALSE);
  102. return TRUE;
  103. }
  104. void CActionPagingPage::OnButtonAdvanced()
  105. {
  106. SetModified();
  107. }
  108. void CActionPagingPage::OnSelendokComboThrottleUnits()
  109. {
  110. SetModified();
  111. }
  112. void CActionPagingPage::OnChangeEditAnswerWait()
  113. {
  114. // TODO: If this is a RICHEDIT control, the control will not
  115. // send this notification unless you override the CHMPropertyPage::OnInitDialog()
  116. // function and call CRichEditCtrl().SetEventMask()
  117. // with the ENM_CHANGE flag ORed into the mask.
  118. SetModified();
  119. }
  120. void CActionPagingPage::OnChangeEditMessage()
  121. {
  122. // TODO: If this is a RICHEDIT control, the control will not
  123. // send this notification unless you override the CHMPropertyPage::OnInitDialog()
  124. // function and call CRichEditCtrl().SetEventMask()
  125. // with the ENM_CHANGE flag ORed into the mask.
  126. SetModified();
  127. }
  128. void CActionPagingPage::OnChangeEditPagerId()
  129. {
  130. // TODO: If this is a RICHEDIT control, the control will not
  131. // send this notification unless you override the CHMPropertyPage::OnInitDialog()
  132. // function and call CRichEditCtrl().SetEventMask()
  133. // with the ENM_CHANGE flag ORed into the mask.
  134. SetModified();
  135. }
  136. void CActionPagingPage::OnChangeEditPhone()
  137. {
  138. // TODO: If this is a RICHEDIT control, the control will not
  139. // send this notification unless you override the CHMPropertyPage::OnInitDialog()
  140. // function and call CRichEditCtrl().SetEventMask()
  141. // with the ENM_CHANGE flag ORed into the mask.
  142. SetModified();
  143. }
  144. void CActionPagingPage::OnDestroy()
  145. {
  146. CHMPropertyPage::OnDestroy();
  147. // v-marfin : bug 59643 : CnxPropertyPageDestory() must be called from this page's
  148. // OnDestroy function.
  149. CnxPropertyPageDestroy();
  150. }