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.

220 lines
5.4 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1998 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // BaseDlg.cpp
  7. //
  8. // Abstract:
  9. // Implementation of the CBaseDialog class.
  10. //
  11. // Author:
  12. // David Potter (davidp) February 5, 1997
  13. //
  14. // Revision History:
  15. //
  16. // Notes:
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #include "stdafx.h"
  20. #include "BaseDlg.h"
  21. #include "TraceTag.h"
  22. #include "resource.h"
  23. #ifdef _DEBUG
  24. #define new DEBUG_NEW
  25. #undef THIS_FILE
  26. static char THIS_FILE[] = __FILE__;
  27. #endif
  28. /////////////////////////////////////////////////////////////////////////////
  29. // Global Variables
  30. /////////////////////////////////////////////////////////////////////////////
  31. #ifdef _DEBUG
  32. CTraceTag g_tagBaseDlg(_T("UI"), _T("BASE DIALOG"), 0);
  33. #endif
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CBaseDialog class
  36. /////////////////////////////////////////////////////////////////////////////
  37. IMPLEMENT_DYNCREATE(CBaseDialog, CDialog)
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CBaseDialog Message Map
  40. BEGIN_MESSAGE_MAP(CBaseDialog, CDialog)
  41. //{{AFX_MSG_MAP(CBaseDialog)
  42. ON_WM_HELPINFO()
  43. ON_WM_CONTEXTMENU()
  44. ON_MESSAGE(WM_COMMANDHELP, OnCommandHelp)
  45. //}}AFX_MSG_MAP
  46. END_MESSAGE_MAP()
  47. /////////////////////////////////////////////////////////////////////////////
  48. //++
  49. //
  50. // CBaseDialog::CBaseDialog
  51. //
  52. // Routine Description:
  53. // Constructor.
  54. //
  55. // Arguments:
  56. // pdwHelpMap [IN] Control to help ID map.
  57. // lpszTemplateName [IN] Dialog template name.
  58. // pParentWnd [IN OUT] Parent window for the dialog.
  59. //
  60. // Return Value:
  61. // None.
  62. //
  63. //--
  64. /////////////////////////////////////////////////////////////////////////////
  65. CBaseDialog::CBaseDialog(
  66. IN LPCTSTR lpszTemplateName,
  67. IN const DWORD * pdwHelpMap,
  68. IN OUT CWnd * pParentWnd
  69. )
  70. : CDialog(lpszTemplateName, pParentWnd)
  71. , m_dlghelp(pdwHelpMap, 0) // no help mask in this case
  72. {
  73. } //*** CBaseDialog::CBaseDialog(LPCTSTR, CWnd*)
  74. /////////////////////////////////////////////////////////////////////////////
  75. //++
  76. //
  77. // CBaseDialog::CBaseDialog
  78. //
  79. // Routine Description:
  80. // Constructor.
  81. //
  82. // Arguments:
  83. // idd [IN] Dialog template resource ID.
  84. // pdwHelpMap [IN] Control to help ID map.
  85. // pParentWnd [IN OUT] Parent window for the dialog.
  86. //
  87. // Return Value:
  88. // None.
  89. //
  90. //--
  91. /////////////////////////////////////////////////////////////////////////////
  92. CBaseDialog::CBaseDialog(
  93. IN UINT idd,
  94. IN const DWORD * pdwHelpMap,
  95. IN OUT CWnd * pParentWnd
  96. )
  97. : CDialog(idd, pParentWnd)
  98. , m_dlghelp(pdwHelpMap, idd)
  99. {
  100. //{{AFX_DATA_INIT(CBaseDialog)
  101. //}}AFX_DATA_INIT
  102. } //*** CBaseDialog::CBaseDialog(UINT, CWnd*)
  103. /////////////////////////////////////////////////////////////////////////////
  104. //++
  105. //
  106. // CBaseDialog::DoDataExchange
  107. //
  108. // Routine Description:
  109. // Do data exchange between the dialog and the class.
  110. //
  111. // Arguments:
  112. // pDX [IN OUT] Data exchange object
  113. //
  114. // Return Value:
  115. // None.
  116. //
  117. //--
  118. /////////////////////////////////////////////////////////////////////////////
  119. void CBaseDialog::DoDataExchange(CDataExchange * pDX)
  120. {
  121. CDialog::DoDataExchange(pDX);
  122. //{{AFX_DATA_MAP(CBaseDialog)
  123. //}}AFX_DATA_MAP
  124. } //*** CBaseDialog::DoDataExchange()
  125. /////////////////////////////////////////////////////////////////////////////
  126. //++
  127. //
  128. // CBaseDialog::OnContextMenu
  129. //
  130. // Routine Description:
  131. // Handler for the WM_CONTEXTMENU message.
  132. //
  133. // Arguments:
  134. // pWnd Window in which user clicked the right mouse button.
  135. // point Position of the cursor, in screen coordinates.
  136. //
  137. // Return Value:
  138. // TRUE Help processed.
  139. // FALSE Help not processed.
  140. //
  141. //--
  142. /////////////////////////////////////////////////////////////////////////////
  143. void CBaseDialog::OnContextMenu(CWnd * pWnd, CPoint point)
  144. {
  145. m_dlghelp.OnContextMenu(pWnd, point);
  146. } //*** CBaseDialog::OnContextMenu()
  147. /////////////////////////////////////////////////////////////////////////////
  148. //++
  149. //
  150. // CBaseDialog::OnHelpInfo
  151. //
  152. // Routine Description:
  153. // Handler for the WM_HELPINFO message.
  154. //
  155. // Arguments:
  156. // pHelpInfo Structure containing info about displaying help.
  157. //
  158. // Return Value:
  159. // TRUE Help processed.
  160. // FALSE Help not processed.
  161. //
  162. //--
  163. /////////////////////////////////////////////////////////////////////////////
  164. BOOL CBaseDialog::OnHelpInfo(HELPINFO * pHelpInfo)
  165. {
  166. BOOL bProcessed;
  167. bProcessed = m_dlghelp.OnHelpInfo(pHelpInfo);
  168. if (!bProcessed)
  169. bProcessed = CDialog::OnHelpInfo(pHelpInfo);
  170. return bProcessed;
  171. } //*** CBaseDialog::OnHelpInfo()
  172. /////////////////////////////////////////////////////////////////////////////
  173. //++
  174. //
  175. // CBaseDialog::OnCommandHelp
  176. //
  177. // Routine Description:
  178. // Handler for the WM_COMMANDHELP message.
  179. //
  180. // Arguments:
  181. // wParam [IN] WPARAM.
  182. // lParam [IN] LPARAM.
  183. //
  184. // Return Value:
  185. // TRUE Help processed.
  186. // FALSE Help not processed.
  187. //
  188. //--
  189. /////////////////////////////////////////////////////////////////////////////
  190. LRESULT CBaseDialog::OnCommandHelp(WPARAM wParam, LPARAM lParam)
  191. {
  192. LRESULT lProcessed;
  193. lProcessed = m_dlghelp.OnCommandHelp(wParam, lParam);
  194. if (!lProcessed)
  195. lProcessed = CDialog::OnCommandHelp(wParam, lParam);
  196. return lProcessed;
  197. } //*** CBaseDialog::OnCommandHelp()