Leaked source code of windows server 2003
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.

230 lines
6.3 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1997-2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ResProp.cpp
  7. //
  8. // Description:
  9. // Implementation of the resource extension property page classes.
  10. //
  11. // Maintained By:
  12. // David Potter (DavidP) Mmmm DD, 1997
  13. //
  14. // Revision History:
  15. //
  16. // Notes:
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #include "stdafx.h"
  20. #include "DebugEx.h"
  21. #include "ResProp.h"
  22. #include "ExtObj.h"
  23. #include "HelpData.h"
  24. #ifdef _DEBUG
  25. #define new DEBUG_NEW
  26. #undef THIS_FILE
  27. static char THIS_FILE[] = __FILE__;
  28. #endif
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CDebugParamsPage property page
  31. /////////////////////////////////////////////////////////////////////////////
  32. IMPLEMENT_DYNCREATE(CDebugParamsPage, CBasePropertyPage)
  33. /////////////////////////////////////////////////////////////////////////////
  34. // Message Maps
  35. BEGIN_MESSAGE_MAP(CDebugParamsPage, CBasePropertyPage)
  36. //{{AFX_MSG_MAP(CDebugParamsPage)
  37. //}}AFX_MSG_MAP
  38. // TODO: Modify the following lines to represent the data displayed on this page.
  39. ON_EN_CHANGE(IDC_PP_DEBUG_DEBUGPREFIX, CBasePropertyPage::OnChangeCtrl)
  40. END_MESSAGE_MAP()
  41. /////////////////////////////////////////////////////////////////////////////
  42. //++
  43. //
  44. // CDebugParamsPage::CDebugParamsPage
  45. //
  46. // Routine Description:
  47. // Default constructor.
  48. //
  49. // Arguments:
  50. // None.
  51. //
  52. // Return Value:
  53. // None.
  54. //
  55. //--
  56. /////////////////////////////////////////////////////////////////////////////
  57. CDebugParamsPage::CDebugParamsPage(void)
  58. : CBasePropertyPage(IDD, g_aHelpIDs_IDD_PP_RESOURCE_DEBUG_PAGE, NULL)
  59. {
  60. // TODO: Modify the following lines to represent the data displayed on this page.
  61. //{{AFX_DATA_INIT(CDebugParamsPage)
  62. m_strText = _T("");
  63. m_strDebugPrefix = _T("");
  64. //}}AFX_DATA_INIT
  65. m_cprops = 0;
  66. m_iddPropertyPage = IDD_PP_RESOURCE_DEBUG_PAGE;
  67. } //*** CDebugParamsPage::CDebugParamsPage()
  68. /////////////////////////////////////////////////////////////////////////////
  69. //++
  70. //
  71. // CDebugParamsPage::BInit
  72. //
  73. // Routine Description:
  74. // Initialize the page.
  75. //
  76. // Arguments:
  77. // peo [IN OUT] Pointer to the extension object.
  78. //
  79. // Return Value:
  80. // TRUE Page initialized successfully.
  81. // FALSE Page failed to initialize.
  82. //
  83. //--
  84. /////////////////////////////////////////////////////////////////////////////
  85. BOOL CDebugParamsPage::BInit(IN OUT CExtObject * peo)
  86. {
  87. ASSERT(peo != NULL);
  88. m_peo = peo;
  89. // Setup the property array.
  90. m_rgProps[epropDebugPrefix].Set(REGPARAM_DEBUG_PREFIX, m_strDebugPrefix, m_strPrevDebugPrefix);
  91. if (Cot() == CLUADMEX_OT_RESOURCE)
  92. {
  93. m_rgProps[epropSeparateMonitor].Set(REGPARAM_SEPARATE_MONITOR, m_bSeparateMonitor, m_bPrevSeparateMonitor);
  94. m_cprops = sizeof(m_rgProps) / sizeof(CObjectProperty);
  95. } // if: resource object
  96. else if (Cot() == CLUADMEX_OT_RESOURCETYPE)
  97. m_cprops = (sizeof(m_rgProps) / sizeof(CObjectProperty)) - 1;
  98. else
  99. {
  100. ASSERT(0);
  101. return FALSE;
  102. } // else: unsupport object type
  103. // Call the base class method.
  104. return CBasePropertyPage::BInit(peo);
  105. } //*** CDebugParamsPage::BInit()
  106. /////////////////////////////////////////////////////////////////////////////
  107. //++
  108. //
  109. // CDebugParamsPage::DoDataExchange
  110. //
  111. // Routine Description:
  112. // Do data exchange between the dialog and the class.
  113. //
  114. // Arguments:
  115. // pDX [IN OUT] Data exchange object
  116. //
  117. // Return Value:
  118. // None.
  119. //
  120. //--
  121. /////////////////////////////////////////////////////////////////////////////
  122. void CDebugParamsPage::DoDataExchange(CDataExchange * pDX)
  123. {
  124. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  125. // TODO: Modify the following lines to represent the data displayed on this page.
  126. //{{AFX_DATA_MAP(CDebugParamsPage)
  127. DDX_Control(pDX, IDC_PP_DEBUG_DEBUGPREFIX, m_editPrefix);
  128. DDX_Text(pDX, IDC_PP_DEBUG_TEXT, m_strText);
  129. DDX_Text(pDX, IDC_PP_DEBUG_DEBUGPREFIX, m_strDebugPrefix);
  130. //}}AFX_DATA_MAP
  131. CBasePropertyPage::DoDataExchange(pDX);
  132. } //*** CDebugParamsPage::DoDataExchange()
  133. /////////////////////////////////////////////////////////////////////////////
  134. //++
  135. //
  136. // CDebugParamsPage::OnInitDialog
  137. //
  138. // Routine Description:
  139. // Handler for the WM_INITDIALOG message.
  140. //
  141. // Arguments:
  142. // None.
  143. //
  144. // Return Value:
  145. // TRUE We need the focus to be set for us.
  146. // FALSE We already set the focus to the proper control.
  147. //
  148. //--
  149. /////////////////////////////////////////////////////////////////////////////
  150. BOOL CDebugParamsPage::OnInitDialog(void)
  151. {
  152. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  153. // Load the help text.
  154. {
  155. UINT ids;
  156. if (Cot() == CLUADMEX_OT_RESOURCE)
  157. ids = IDS_RESOURCE_TEXT;
  158. else
  159. ids = IDS_RESOURCE_TYPE_TEXT;
  160. m_strText.LoadString(ids);
  161. } // Load the help text.
  162. // Call the base class method.
  163. CBasePropertyPage::OnInitDialog();
  164. // Limit the size of the text that can be entered in edit controls.
  165. m_editPrefix.SetLimitText(_MAX_PATH);
  166. return TRUE; // return TRUE unless you set the focus to a control
  167. // EXCEPTION: OCX Property Pages should return FALSE
  168. } //*** CDebugParamsPage::OnInitDialog()
  169. /////////////////////////////////////////////////////////////////////////////
  170. //++
  171. //
  172. // CDebugParamsPage::BApplyChanges
  173. //
  174. // Routine Description:
  175. // Apply changes made on the page.
  176. //
  177. // Arguments:
  178. // None.
  179. //
  180. // Return Value:
  181. // TRUE Page successfully applied.
  182. // FALSE Error applying page.
  183. //
  184. //--
  185. /////////////////////////////////////////////////////////////////////////////
  186. BOOL CDebugParamsPage::BApplyChanges(void)
  187. {
  188. // If the debug prefix string is not empty but the resource is not being
  189. // run in a separate resource monitor, ask the user if we should change
  190. // that setting now. Only do this for resources.
  191. if ( (Cot() == CLUADMEX_OT_RESOURCE)
  192. && (m_strDebugPrefix.GetLength() > 0)
  193. && !m_bSeparateMonitor)
  194. {
  195. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  196. if (AfxMessageBox(IDS_NOT_IN_SEPARATE_MONITOR, MB_YESNO | MB_ICONEXCLAMATION) == IDYES)
  197. m_bSeparateMonitor = TRUE;
  198. } // if: debug prefix string specified for resource but not in separate monitor
  199. return CBasePropertyPage::BApplyChanges();
  200. } //*** CDebugParamsPage::BApplyChanges()