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.

218 lines
5.5 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // GenScript.cpp
  7. //
  8. // Abstract:
  9. // Implementation of the CGenericScriptParamsPage class.
  10. //
  11. // Author:
  12. // Geoffrey Pease (GPease) 31-JAN-2000
  13. //
  14. // Revision History:
  15. //
  16. // Notes:
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #include "stdafx.h"
  20. #include "CluAdmX.h"
  21. #include "ExtObj.h"
  22. #include "GenScript.h"
  23. #include "DDxDDv.h"
  24. #include "PropList.h"
  25. #include "HelpData.h" // for g_rghelpmap*
  26. #ifdef _DEBUG
  27. #define new DEBUG_NEW
  28. #undef THIS_FILE
  29. static char THIS_FILE[] = __FILE__;
  30. #endif
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CGenericScriptParamsPage property page
  33. /////////////////////////////////////////////////////////////////////////////
  34. IMPLEMENT_DYNCREATE(CGenericScriptParamsPage, CBasePropertyPage)
  35. /////////////////////////////////////////////////////////////////////////////
  36. // Message Maps
  37. BEGIN_MESSAGE_MAP(CGenericScriptParamsPage, CBasePropertyPage)
  38. //{{AFX_MSG_MAP(CGenericScriptParamsPage)
  39. ON_EN_CHANGE(IDC_PP_GENSCRIPT_PARAMS_SCRIPTFILEPATH, OnChangeRequired)
  40. //}}AFX_MSG_MAP
  41. END_MESSAGE_MAP()
  42. /////////////////////////////////////////////////////////////////////////////
  43. //++
  44. //
  45. // CGenericScriptParamsPage::CGenericScriptParamsPage
  46. //
  47. // Routine Description:
  48. // Default constructor.
  49. //
  50. // Arguments:
  51. // None.
  52. //
  53. // Return Value:
  54. // None.
  55. //
  56. //--
  57. /////////////////////////////////////////////////////////////////////////////
  58. CGenericScriptParamsPage::CGenericScriptParamsPage(void)
  59. : CBasePropertyPage(g_aHelpIDs_IDD_PP_GENSCRIPT_PARAMETERS, g_aHelpIDs_IDD_WIZ_GENSCRIPT_PARAMETERS)
  60. {
  61. //{{AFX_DATA_INIT(CGenericScriptParamsPage)
  62. m_strScriptFilepath = _T("");
  63. //}}AFX_DATA_INIT
  64. // Setup the property array.
  65. {
  66. m_rgProps[epropScriptFilepath].Set(REGPARAM_GENSCRIPT_SCRIPT_FILEPATH, m_strScriptFilepath, m_strPrevScriptFilepath);
  67. } // Setup the property array
  68. m_iddPropertyPage = IDD_PP_GENSCRIPT_PARAMETERS;
  69. m_iddWizardPage = IDD_WIZ_GENSCRIPT_PARAMETERS;
  70. } //*** CGenericScriptParamsPage::CGenericScriptParamsPage()
  71. /////////////////////////////////////////////////////////////////////////////
  72. //++
  73. //
  74. // CGenericScriptParamsPage::DoDataExchange
  75. //
  76. // Routine Description:
  77. // Do data exchange between the dialog and the class.
  78. //
  79. // Arguments:
  80. // pDX [IN OUT] Data exchange object
  81. //
  82. // Return Value:
  83. // None.
  84. //
  85. //--
  86. /////////////////////////////////////////////////////////////////////////////
  87. void CGenericScriptParamsPage::DoDataExchange(CDataExchange * pDX)
  88. {
  89. if (!pDX->m_bSaveAndValidate || !BSaved())
  90. {
  91. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  92. //{{AFX_DATA_MAP(CGenericScriptParamsPage)
  93. DDX_Control(pDX, IDC_PP_GENSCRIPT_PARAMS_SCRIPTFILEPATH, m_editScriptFilepath);
  94. DDX_Text(pDX, IDC_PP_GENSCRIPT_PARAMS_SCRIPTFILEPATH, m_strScriptFilepath);
  95. //}}AFX_DATA_MAP
  96. if (!BBackPressed())
  97. {
  98. DDV_RequiredText(pDX, IDC_PP_GENSCRIPT_PARAMS_SCRIPTFILEPATH, IDC_PP_GENSCRIPT_PARAMS_SCRIPTFILEPATH_LABEL, m_strScriptFilepath);
  99. } // if: Back button not pressed
  100. } // if: not saving or haven't saved yet
  101. CBasePropertyPage::DoDataExchange(pDX);
  102. } //*** CGenericScriptParamsPage::DoDataExchange()
  103. /////////////////////////////////////////////////////////////////////////////
  104. //++
  105. //
  106. // CGenericScriptParamsPage::OnInitDialog
  107. //
  108. // Routine Description:
  109. // Handler for the WM_INITDIALOG message.
  110. //
  111. // Arguments:
  112. // None.
  113. //
  114. // Return Value:
  115. // TRUE We need the focus to be set for us.
  116. // FALSE We already set the focus to the proper control.
  117. //
  118. //--
  119. /////////////////////////////////////////////////////////////////////////////
  120. BOOL CGenericScriptParamsPage::OnInitDialog(void)
  121. {
  122. // Call the base class.
  123. CBasePropertyPage::OnInitDialog();
  124. return TRUE; // return TRUE unless you set the focus to a control
  125. // EXCEPTION: OCX Property Pages should return FALSE
  126. } //*** CGenericScriptParamsPage::OnInitDialog()
  127. /////////////////////////////////////////////////////////////////////////////
  128. //++
  129. //
  130. // CGenericScriptParamsPage::OnSetActive
  131. //
  132. // Routine Description:
  133. // Handler for the PSN_SETACTIVE message.
  134. //
  135. // Arguments:
  136. // None.
  137. //
  138. // Return Value:
  139. // TRUE Page successfully initialized.
  140. // FALSE Page not initialized.
  141. //
  142. //--
  143. /////////////////////////////////////////////////////////////////////////////
  144. BOOL CGenericScriptParamsPage::OnSetActive(void)
  145. {
  146. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  147. // Enable/disable the Next/Finish button.
  148. if (BWizard())
  149. {
  150. if (m_strScriptFilepath.GetLength() == 0)
  151. {
  152. EnableNext(FALSE);
  153. }
  154. else
  155. {
  156. EnableNext(TRUE);
  157. }
  158. } // if: enable/disable the Next button
  159. return CBasePropertyPage::OnSetActive();
  160. } //*** CGenericScriptParamsPage::OnSetActive()
  161. /////////////////////////////////////////////////////////////////////////////
  162. //++
  163. //
  164. // CGenericScriptParamsPage::OnChangeRequired
  165. //
  166. // Routine Description:
  167. // Handler for the EN_CHANGE message on required controls.
  168. //
  169. // Arguments:
  170. // None.
  171. //
  172. // Return Value:
  173. // None.
  174. //
  175. //--
  176. /////////////////////////////////////////////////////////////////////////////
  177. void CGenericScriptParamsPage::OnChangeRequired(void)
  178. {
  179. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  180. OnChangeCtrl();
  181. if (BWizard())
  182. {
  183. if (m_editScriptFilepath.GetWindowTextLength() == 0)
  184. {
  185. EnableNext(FALSE);
  186. }
  187. else
  188. {
  189. EnableNext(TRUE);
  190. }
  191. } // if: in a wizard
  192. } //*** CGenericScriptParamsPage::OnChangeRequired()