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.

250 lines
6.7 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998 <company name>
  4. //
  5. // Module Name:
  6. // ResProp.cpp
  7. //
  8. // Abstract:
  9. // Implementation of the resource extension property page classes.
  10. //
  11. // Author:
  12. // <name> (<e-mail name>) Mmmm DD, 1998
  13. //
  14. // Revision History:
  15. //
  16. // Notes:
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #include "stdafx.h"
  20. #include "DummyEx.h"
  21. #include "ResProp.h"
  22. #include "ExtObj.h"
  23. #include "DDxDDv.h"
  24. #ifdef _DEBUG
  25. #define new DEBUG_NEW
  26. #undef THIS_FILE
  27. static char THIS_FILE[] = __FILE__;
  28. #endif
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CDummyParamsPage property page
  31. /////////////////////////////////////////////////////////////////////////////
  32. IMPLEMENT_DYNCREATE(CDummyParamsPage, CBasePropertyPage)
  33. /////////////////////////////////////////////////////////////////////////////
  34. // Message Maps
  35. BEGIN_MESSAGE_MAP(CDummyParamsPage, CBasePropertyPage)
  36. //{{AFX_MSG_MAP(CDummyParamsPage)
  37. //}}AFX_MSG_MAP
  38. // TODO: Modify the following lines to represent the data displayed on this page.
  39. ON_EN_CHANGE(IDC_PP_DUMMY_PENDING, CBasePropertyPage::OnChangeCtrl)
  40. ON_EN_CHANGE(IDC_PP_DUMMY_PENDTIME, CBasePropertyPage::OnChangeCtrl)
  41. ON_EN_CHANGE(IDC_PP_DUMMY_OPENSFAIL, CBasePropertyPage::OnChangeCtrl)
  42. ON_EN_CHANGE(IDC_PP_DUMMY_FAILED, CBasePropertyPage::OnChangeCtrl)
  43. ON_EN_CHANGE(IDC_PP_DUMMY_ASYNCHRONOUS, CBasePropertyPage::OnChangeCtrl)
  44. END_MESSAGE_MAP()
  45. /////////////////////////////////////////////////////////////////////////////
  46. //++
  47. //
  48. // CDummyParamsPage::CDummyParamsPage
  49. //
  50. // Routine Description:
  51. // Default constructor.
  52. //
  53. // Arguments:
  54. // None.
  55. //
  56. // Return Value:
  57. // None.
  58. //
  59. //--
  60. /////////////////////////////////////////////////////////////////////////////
  61. CDummyParamsPage::CDummyParamsPage(void) : CBasePropertyPage(CDummyParamsPage::IDD)
  62. {
  63. // TODO: Modify the following lines to represent the data displayed on this page.
  64. //{{AFX_DATA_INIT(CDummyParamsPage)
  65. m_bPending = 0;
  66. m_nPendTime = (DWORD) (0);
  67. m_bOpensFail = 0;
  68. m_bFailed = 0;
  69. m_bAsynchronous = 0;
  70. //}}AFX_DATA_INIT
  71. // Setup the property array.
  72. {
  73. m_rgProps[epropPending].Set(REGPARAM_DUMMY_PENDING, m_bPending, m_bPrevPending);
  74. m_rgProps[epropPendTime].Set(REGPARAM_DUMMY_PENDTIME, m_nPendTime, m_nPrevPendTime);
  75. m_rgProps[epropOpensFail].Set(REGPARAM_DUMMY_OPENSFAIL, m_bOpensFail, m_bPrevOpensFail);
  76. m_rgProps[epropFailed].Set(REGPARAM_DUMMY_FAILED, m_bFailed, m_bPrevFailed);
  77. m_rgProps[epropAsynchronous].Set(REGPARAM_DUMMY_ASYNCHRONOUS, m_bAsynchronous, m_bPrevAsynchronous);
  78. } // Setup the property array
  79. m_iddPropertyPage = IDD_PP_DUMMY_PARAMETERS;
  80. m_iddWizardPage = IDD_WIZ_DUMMY_PARAMETERS;
  81. } //*** CDummyParamsPage::CDummyParamsPage()
  82. /////////////////////////////////////////////////////////////////////////////
  83. //++
  84. //
  85. // CDummyParamsPage::DoDataExchange
  86. //
  87. // Routine Description:
  88. // Do data exchange between the dialog and the class.
  89. //
  90. // Arguments:
  91. // pDX [IN OUT] Data exchange object
  92. //
  93. // Return Value:
  94. // None.
  95. //
  96. //--
  97. /////////////////////////////////////////////////////////////////////////////
  98. void CDummyParamsPage::DoDataExchange(CDataExchange * pDX)
  99. {
  100. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  101. // TODO: Modify the following lines to represent the data displayed on this page.
  102. //{{AFX_DATA_MAP(CDummyParamsPage)
  103. DDX_Text(pDX, IDC_PP_DUMMY_PENDING, m_bPending);
  104. DDX_Text(pDX, IDC_PP_DUMMY_PENDTIME, m_nPendTime);
  105. DDX_Text(pDX, IDC_PP_DUMMY_OPENSFAIL, m_bOpensFail);
  106. DDX_Text(pDX, IDC_PP_DUMMY_FAILED, m_bFailed);
  107. DDX_Text(pDX, IDC_PP_DUMMY_ASYNCHRONOUS, m_bAsynchronous);
  108. //}}AFX_DATA_MAP
  109. // Handle numeric parameters.
  110. if (!BBackPressed())
  111. {
  112. DDX_Number(pDX, IDC_PP_DUMMY_PENDTIME, m_nPendTime, (DWORD) (0), (DWORD) (4294967295), FALSE /*bSigned*/);
  113. } // if: back button not pressed
  114. // TODO: Add any additional field validation here.
  115. if (pDX->m_bSaveAndValidate)
  116. {
  117. // Make sure all required fields are present.
  118. if (!BBackPressed())
  119. {
  120. } // if: back button not pressed
  121. } // if: saving data from dialog
  122. CBasePropertyPage::DoDataExchange(pDX);
  123. } //*** CDummyParamsPage::DoDataExchange()
  124. /////////////////////////////////////////////////////////////////////////////
  125. //++
  126. //
  127. // CDummyParamsPage::OnInitDialog
  128. //
  129. // Routine Description:
  130. // Handler for the WM_INITDIALOG message.
  131. //
  132. // Arguments:
  133. // None.
  134. //
  135. // Return Value:
  136. // TRUE We need the focus to be set for us.
  137. // FALSE We already set the focus to the proper control.
  138. //
  139. //--
  140. /////////////////////////////////////////////////////////////////////////////
  141. BOOL CDummyParamsPage::OnInitDialog(void)
  142. {
  143. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  144. CBasePropertyPage::OnInitDialog();
  145. // TODO:
  146. // Limit the size of the text that can be entered in edit controls.
  147. return TRUE; // return TRUE unless you set the focus to a control
  148. // EXCEPTION: OCX Property Pages should return FALSE
  149. } //*** CDummyParamsPage::OnInitDialog()
  150. /////////////////////////////////////////////////////////////////////////////
  151. //++
  152. //
  153. // CDummyParamsPage::OnSetActive
  154. //
  155. // Routine Description:
  156. // Handler for the PSN_SETACTIVE message.
  157. //
  158. // Arguments:
  159. // None.
  160. //
  161. // Return Value:
  162. // TRUE Page successfully initialized.
  163. // FALSE Page not initialized.
  164. //
  165. //--
  166. /////////////////////////////////////////////////////////////////////////////
  167. BOOL CDummyParamsPage::OnSetActive(void)
  168. {
  169. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  170. // Enable/disable the Next/Finish button.
  171. if (BWizard())
  172. EnableNext(BAllRequiredFieldsPresent());
  173. return CBasePropertyPage::OnSetActive();
  174. } //*** CDummyParamsPage::OnSetActive()
  175. /////////////////////////////////////////////////////////////////////////////
  176. //++
  177. //
  178. // CDummyParamsPage::OnChangeRequiredField
  179. //
  180. // Routine Description:
  181. // Handler for the EN_CHANGE message on the Share name or Path edit
  182. // controls.
  183. //
  184. // Arguments:
  185. // None.
  186. //
  187. // Return Value:
  188. // None.
  189. //
  190. //--
  191. /////////////////////////////////////////////////////////////////////////////
  192. void CDummyParamsPage::OnChangeRequiredField(void)
  193. {
  194. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  195. OnChangeCtrl();
  196. if (BWizard())
  197. EnableNext(BAllRequiredFieldsPresent());
  198. } //*** CDummyParamsPage::OnChangeRequiredField()
  199. /////////////////////////////////////////////////////////////////////////////
  200. //++
  201. //
  202. // CDummyParamsPage::BAllRequiredFieldsPresent
  203. //
  204. // Routine Description:
  205. // Handler for the EN_CHANGE message on the Share name or Path edit
  206. // controls.
  207. //
  208. // Arguments:
  209. // None.
  210. //
  211. // Return Value:
  212. // None.
  213. //
  214. //--
  215. /////////////////////////////////////////////////////////////////////////////
  216. BOOL CDummyParamsPage::BAllRequiredFieldsPresent(void) const
  217. {
  218. return TRUE;
  219. } //*** CDummyParamsPage::BAllRequiredFieldsPresent()