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.

377 lines
10 KiB

  1. VERSION 5.00
  2. Begin VB.Form frmFind
  3. Caption = "Find"
  4. ClientHeight = 8265
  5. ClientLeft = 360
  6. ClientTop = 540
  7. ClientWidth = 6015
  8. LinkTopic = "Form1"
  9. ScaleHeight = 8265
  10. ScaleWidth = 6015
  11. Begin VB.ListBox lstConditions
  12. Height = 960
  13. Left = 120
  14. Style = 1 'Checkbox
  15. TabIndex = 5
  16. Top = 2400
  17. Width = 5775
  18. End
  19. Begin VB.CommandButton cmdClose
  20. Caption = "Close"
  21. Height = 375
  22. Left = 4680
  23. TabIndex = 7
  24. Top = 3480
  25. Width = 1215
  26. End
  27. Begin VB.CommandButton cmdFind
  28. Caption = "Find"
  29. Height = 375
  30. Left = 3360
  31. TabIndex = 6
  32. Top = 3480
  33. Width = 1215
  34. End
  35. Begin VB.ListBox lstEntries
  36. Height = 4155
  37. ItemData = "frmFind.frx":0000
  38. Left = 120
  39. List = "frmFind.frx":0007
  40. TabIndex = 9
  41. Tag = "1"
  42. Top = 3960
  43. Width = 5775
  44. End
  45. Begin VB.Frame fraString
  46. Caption = "String"
  47. Height = 1935
  48. Left = 120
  49. TabIndex = 0
  50. Top = 120
  51. Width = 5775
  52. Begin VB.ListBox lstFields
  53. Height = 960
  54. Left = 120
  55. Style = 1 'Checkbox
  56. TabIndex = 3
  57. Top = 840
  58. Width = 5535
  59. End
  60. Begin VB.ComboBox cboString
  61. Height = 315
  62. Left = 120
  63. TabIndex = 1
  64. Tag = "1"
  65. Top = 240
  66. Width = 5535
  67. End
  68. Begin VB.Label lblFields
  69. Caption = "Find in:"
  70. Height = 255
  71. Left = 120
  72. TabIndex = 2
  73. Top = 600
  74. Width = 4095
  75. End
  76. End
  77. Begin VB.Label lblConditions
  78. Caption = "Which conditions do you want to check?"
  79. Height = 255
  80. Left = 120
  81. TabIndex = 4
  82. Top = 2160
  83. Width = 4935
  84. End
  85. Begin VB.Label lblEntries
  86. Caption = "Click on an entry:"
  87. Height = 255
  88. Left = 120
  89. TabIndex = 8
  90. Top = 3720
  91. Width = 2775
  92. End
  93. End
  94. Attribute VB_Name = "frmFind"
  95. Attribute VB_GlobalNameSpace = False
  96. Attribute VB_Creatable = False
  97. Attribute VB_PredeclaredId = True
  98. Attribute VB_Exposed = False
  99. Option Explicit
  100. Private p_clsSizer As Sizer
  101. Private Sub Form_Load()
  102. On Error GoTo LErrorHandler
  103. cmdClose.Cancel = True
  104. cmdFind.Default = True
  105. lstEntries.Clear
  106. p_InitializeFields
  107. p_InitializeConditions
  108. p_SetToolTips
  109. Set p_clsSizer = New Sizer
  110. SetFontInternal Me
  111. LEnd:
  112. Exit Sub
  113. LErrorHandler:
  114. GoTo LEnd
  115. End Sub
  116. Private Sub Form_Unload(Cancel As Integer)
  117. Set p_clsSizer = Nothing
  118. End Sub
  119. Private Sub Form_Activate()
  120. On Error GoTo LErrorHandler
  121. p_SetSizingInfo
  122. LEnd:
  123. Exit Sub
  124. LErrorHandler:
  125. GoTo LEnd
  126. End Sub
  127. Private Sub Form_Resize()
  128. On Error GoTo LErrorHandler
  129. p_clsSizer.Resize
  130. LEnd:
  131. Exit Sub
  132. LErrorHandler:
  133. GoTo LEnd
  134. End Sub
  135. Private Sub cmdFind_Click()
  136. On Error GoTo LErrorHandler
  137. Dim DOMNodeList As MSXML2.IXMLDOMNodeList
  138. Dim DOMNode As MSXML2.IXMLDOMNode
  139. Dim enumSearchTargets As SEARCH_TARGET_E
  140. Dim intIndex As Long
  141. Dim strText As String
  142. enumSearchTargets = p_GetSearchTargets
  143. If (enumSearchTargets = 0) Then
  144. MsgBox "Please select some search options", vbOKOnly
  145. Exit Sub
  146. End If
  147. lstEntries.Clear
  148. strText = cboString.Text
  149. p_AddStringIfRequired strText
  150. Set DOMNodeList = frmMain.Find(strText, enumSearchTargets)
  151. If (DOMNodeList.length = 0) Then
  152. MsgBox "No matching entry found", vbOKOnly
  153. Exit Sub
  154. End If
  155. For intIndex = 0 To DOMNodeList.length - 1
  156. Set DOMNode = DOMNodeList(intIndex)
  157. lstEntries.AddItem "[" & (intIndex + 1) & "] " & _
  158. XMLGetAttribute(DOMNode, HHT_TITLE_C)
  159. lstEntries.ItemData(lstEntries.NewIndex) = XMLGetAttribute(DOMNode, HHT_tid_C)
  160. Next
  161. LEnd:
  162. Exit Sub
  163. LErrorHandler:
  164. GoTo LEnd
  165. End Sub
  166. Private Sub cmdClose_Click()
  167. lstEntries.Clear
  168. Hide
  169. End Sub
  170. Private Sub lstEntries_DblClick()
  171. lstEntries_Click
  172. End Sub
  173. Private Sub lstEntries_Click()
  174. frmMain.Highlight lstEntries.ItemData(lstEntries.ListIndex)
  175. End Sub
  176. Private Sub p_AddStringIfRequired(i_str As String)
  177. Dim intIndex As Long
  178. Dim str As String
  179. str = LCase$(i_str)
  180. For intIndex = 0 To cboString.ListCount - 1
  181. If (str = LCase$(cboString.List(intIndex))) Then
  182. Exit Sub
  183. End If
  184. Next
  185. cboString.AddItem i_str, 0
  186. End Sub
  187. Private Function p_GetSearchTargets() As SEARCH_TARGET_E
  188. Dim enumSearchTargets As SEARCH_TARGET_E
  189. Dim intIndex As Long
  190. For intIndex = 0 To lstFields.ListCount - 1
  191. If (lstFields.Selected(intIndex)) Then
  192. enumSearchTargets = enumSearchTargets Or lstFields.ItemData(intIndex)
  193. End If
  194. Next
  195. For intIndex = 0 To lstConditions.ListCount - 1
  196. If (lstConditions.Selected(intIndex)) Then
  197. enumSearchTargets = enumSearchTargets Or lstConditions.ItemData(intIndex)
  198. End If
  199. Next
  200. p_GetSearchTargets = enumSearchTargets
  201. End Function
  202. Private Sub p_InitializeFields()
  203. lstFields.AddItem "Title"
  204. lstFields.ItemData(lstFields.NewIndex) = ST_TITLE_E
  205. lstFields.AddItem "URI"
  206. lstFields.ItemData(lstFields.NewIndex) = ST_URI_E
  207. lstFields.AddItem "Description"
  208. lstFields.ItemData(lstFields.NewIndex) = ST_DESCRIPTION_E
  209. lstFields.AddItem "Comments"
  210. lstFields.ItemData(lstFields.NewIndex) = ST_COMMENTS_E
  211. lstFields.AddItem "Imported File"
  212. lstFields.ItemData(lstFields.NewIndex) = ST_BASE_FILE_E
  213. End Sub
  214. Private Sub p_InitializeConditions()
  215. lstConditions.AddItem "Topics without associated keywords"
  216. lstConditions.ItemData(lstConditions.NewIndex) = ST_TOPICS_WITHOUT_KEYWORDS_E
  217. lstConditions.AddItem "Nodes without associated keywords"
  218. lstConditions.ItemData(lstConditions.NewIndex) = ST_NODES_WITHOUT_KEYWORDS_E
  219. lstConditions.AddItem "In my Authoring Group"
  220. lstConditions.ItemData(lstConditions.NewIndex) = ST_SELF_AUTHORING_GROUP_E
  221. lstConditions.AddItem "Windows Me broken links"
  222. lstConditions.ItemData(lstConditions.NewIndex) = ST_BROKEN_LINK_WINME_E
  223. lstConditions.AddItem "Windows XP Personal broken links"
  224. lstConditions.ItemData(lstConditions.NewIndex) = ST_BROKEN_LINK_STD_E
  225. lstConditions.AddItem "Windows XP Professional broken links"
  226. lstConditions.ItemData(lstConditions.NewIndex) = ST_BROKEN_LINK_PRO_E
  227. lstConditions.AddItem "Windows XP 64-bit Professional broken links"
  228. lstConditions.ItemData(lstConditions.NewIndex) = ST_BROKEN_LINK_PRO64_E
  229. lstConditions.AddItem "Windows XP Server broken links"
  230. lstConditions.ItemData(lstConditions.NewIndex) = ST_BROKEN_LINK_SRV_E
  231. lstConditions.AddItem "Windows XP Advanced Server broken links"
  232. lstConditions.ItemData(lstConditions.NewIndex) = ST_BROKEN_LINK_ADV_E
  233. lstConditions.AddItem "Windows XP 64-bit Advanced Server broken links"
  234. lstConditions.ItemData(lstConditions.NewIndex) = ST_BROKEN_LINK_ADV64_E
  235. lstConditions.AddItem "Windows XP Datacenter Server broken links"
  236. lstConditions.ItemData(lstConditions.NewIndex) = ST_BROKEN_LINK_DAT_E
  237. lstConditions.AddItem "Windows XP 64-bit Datacenter Server broken links"
  238. lstConditions.ItemData(lstConditions.NewIndex) = ST_BROKEN_LINK_DAT64_E
  239. ' lstConditions.AddItem "Marked for Indexer"
  240. ' lstConditions.ItemData(lstConditions.NewIndex) = ST_MARK1_E
  241. End Sub
  242. Private Sub p_SetSizingInfo()
  243. Static blnInfoSet As Boolean
  244. ' If (blnInfoSet) Then
  245. ' Exit Sub
  246. ' End If
  247. p_clsSizer.AddControl fraString
  248. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = Me
  249. p_clsSizer.AddControl cboString
  250. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = fraString
  251. p_clsSizer.AddControl lstFields
  252. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = fraString
  253. p_clsSizer.AddControl lstConditions
  254. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = Me
  255. p_clsSizer.AddControl cmdFind
  256. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = Me
  257. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_WIDTH_E
  258. p_clsSizer.AddControl cmdClose
  259. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = Me
  260. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_WIDTH_E
  261. p_clsSizer.AddControl lstEntries
  262. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = Me
  263. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = Me
  264. ' blnInfoSet = True
  265. End Sub
  266. Private Sub p_SetToolTips()
  267. cboString.ToolTipText = "Type the word or words you want to search for."
  268. lblFields.ToolTipText = "Select which fields you want to search within."
  269. lstFields.ToolTipText = lblFields.ToolTipText
  270. lblConditions.ToolTipText = "Select other conditions that the search must meet."
  271. lstConditions.ToolTipText = lblConditions.ToolTipText
  272. lblEntries.ToolTipText = "Click on an entry to display it in the taxonomy."
  273. lstEntries.ToolTipText = lblEntries.ToolTipText
  274. End Sub