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.

214 lines
5.1 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ModNodes.cpp
  7. //
  8. // Abstract:
  9. // Implementation of the CModifyNodesDlg dialog.
  10. //
  11. // Author:
  12. // David Potter (davidp) July 16, 1996
  13. //
  14. // Revision History:
  15. //
  16. // Notes:
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #include "stdafx.h"
  20. #include "ModNodes.h"
  21. #ifdef _DEBUG
  22. #define new DEBUG_NEW
  23. #undef THIS_FILE
  24. static char THIS_FILE[] = __FILE__;
  25. #endif
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CModifyNodesDlg
  28. /////////////////////////////////////////////////////////////////////////////
  29. IMPLEMENT_DYNCREATE(CModifyNodesDlg, CListCtrlPairDlg)
  30. /////////////////////////////////////////////////////////////////////////////
  31. // Message Maps
  32. BEGIN_MESSAGE_MAP(CModifyNodesDlg, CListCtrlPairDlg)
  33. //{{AFX_MSG_MAP(CModifyNodesDlg)
  34. //}}AFX_MSG_MAP
  35. END_MESSAGE_MAP()
  36. /////////////////////////////////////////////////////////////////////////////
  37. //++
  38. //
  39. // CModifyNodesDlg::CModifyNodesDlg
  40. //
  41. // Routine Description:
  42. // Default constructor.
  43. //
  44. // Arguments:
  45. // None.
  46. //
  47. // Return Value:
  48. // None.
  49. //
  50. //--
  51. /////////////////////////////////////////////////////////////////////////////
  52. CModifyNodesDlg::CModifyNodesDlg(void)
  53. {
  54. } //*** CModifyNodesDlg::CModifyNodesDlg()
  55. /////////////////////////////////////////////////////////////////////////////
  56. //++
  57. //
  58. // CModifyNodesDlg::CModifyNodesDlg
  59. //
  60. // Routine Description:
  61. // Constructor.
  62. //
  63. // Arguments:
  64. // idd [IN] Dialog ID.
  65. // pdwHelpMap [IN] Control-to-Help ID mapping array.
  66. // rlpciRight [IN OUT] List for the right list control.
  67. // rlpciLeft [IN] List for the left list control.
  68. // dwStyle [IN] Style:
  69. // LCPS_SHOW_IMAGES Show images to left of items.
  70. // LCPS_ALLOW_EMPTY Allow right list to be empty.
  71. // LCPS_ORDERED Ordered right list.
  72. // pParent [IN OUT] Parent window.
  73. //
  74. // Return Value:
  75. // None.
  76. //
  77. //--
  78. /////////////////////////////////////////////////////////////////////////////
  79. CModifyNodesDlg::CModifyNodesDlg(
  80. IN UINT idd,
  81. IN const DWORD * pdwHelpMap,
  82. IN OUT CNodeList & rlpciRight,
  83. IN const CNodeList & rlpciLeft,
  84. IN DWORD dwStyle,
  85. IN OUT CWnd * pParent /*=NULL*/
  86. ) : CListCtrlPairDlg(
  87. idd,
  88. pdwHelpMap,
  89. &rlpciRight,
  90. &rlpciLeft,
  91. dwStyle | LCPS_PROPERTIES_BUTTON | (dwStyle & LCPS_ORDERED ? LCPS_CAN_BE_ORDERED : 0),
  92. GetColumn,
  93. BDisplayProperties,
  94. pParent
  95. )
  96. {
  97. //{{AFX_DATA_INIT(CModifyNodesDlg)
  98. //}}AFX_DATA_INIT
  99. } //*** CModifyNodesDlg::CModifyNodesDlg()
  100. /////////////////////////////////////////////////////////////////////////////
  101. //++
  102. //
  103. // CModifyNodesDlg::OnInitDialog
  104. //
  105. // Routine Description:
  106. // Handler for the WM_INITDIALOG message.
  107. //
  108. // Arguments:
  109. // None.
  110. //
  111. // Return Value:
  112. // TRUE Focus needs to be set.
  113. // FALSE Focus already set.
  114. //
  115. //--
  116. /////////////////////////////////////////////////////////////////////////////
  117. BOOL CModifyNodesDlg::OnInitDialog(void)
  118. {
  119. // Add columns.
  120. try
  121. {
  122. NAddColumn(IDS_COLTEXT_NAME, COLI_WIDTH_NAME);
  123. } // try
  124. catch (CException * pe)
  125. {
  126. pe->ReportError();
  127. pe->Delete();
  128. } // catch: CException
  129. // Call the base class method.
  130. CListCtrlPairDlg::OnInitDialog();
  131. return TRUE; // return TRUE unless you set the focus to a control
  132. // EXCEPTION: OCX Property Pages should return FALSE
  133. } //*** CModifyNodesDlg::OnInitDialog()
  134. /////////////////////////////////////////////////////////////////////////////
  135. //++
  136. //
  137. // CModifyNodesDlg::GetColumn [static]
  138. //
  139. // Routine Description:
  140. // Returns a column for an item.
  141. //
  142. // Arguments:
  143. // pobj [IN OUT] Object for which the column is to be displayed.
  144. // iItem [IN] Index of the item in the list.
  145. // icol [IN] Column number whose text is to be retrieved.
  146. // pdlg [IN OUT] Dialog to which object belongs.
  147. // rstr [OUT] String in which to return column text.
  148. // piimg [OUT] Image index for the object.
  149. //
  150. // Return Value:
  151. // None.
  152. //
  153. //--
  154. /////////////////////////////////////////////////////////////////////////////
  155. void CALLBACK CModifyNodesDlg::GetColumn(
  156. IN OUT CObject * pobj,
  157. IN int iItem,
  158. IN int icol,
  159. IN OUT CDialog * pdlg,
  160. OUT CString & rstr,
  161. OUT int * piimg
  162. )
  163. {
  164. CClusterNode * pciNode = (CClusterNode *) pobj;
  165. ASSERT_VALID(pciNode);
  166. ASSERT(icol == 0);
  167. pciNode->BGetColumnData(IDS_COLTEXT_NAME, rstr);
  168. if (piimg != NULL)
  169. *piimg = pciNode->IimgObjectType();
  170. } //*** CModifyNodesDlg::GetColumn()
  171. /////////////////////////////////////////////////////////////////////////////
  172. //++
  173. //
  174. // CModifyNodesDlg::BDisplayProperties [static]
  175. //
  176. // Routine Description:
  177. // Display the properties of the specified object.
  178. //
  179. // Arguments:
  180. // pobj [IN OUT] Cluster item whose properties are to be displayed.
  181. //
  182. // Return Value:
  183. // TRUE Properties where accepted.
  184. // FALSE Properties where cancelled.
  185. //
  186. //--
  187. /////////////////////////////////////////////////////////////////////////////
  188. BOOL CALLBACK CModifyNodesDlg::BDisplayProperties(IN OUT CObject * pobj)
  189. {
  190. CClusterItem * pci = (CClusterItem *) pobj;
  191. ASSERT_KINDOF(CClusterItem, pobj);
  192. return pci->BDisplayProperties();
  193. } //*** CModifyNodesDlg::BDisplayProperties();