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.

968 lines
27 KiB

  1. VERSION 5.00
  2. Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "SHDOCVW.dll"
  3. Begin VB.Form frmAddRemoveKeywords
  4. Caption = "Add/Remove Keywords"
  5. ClientHeight = 8655
  6. ClientLeft = 105
  7. ClientTop = 390
  8. ClientWidth = 11535
  9. LinkTopic = "Form1"
  10. ScaleHeight = 8655
  11. ScaleWidth = 11535
  12. Begin SHDocVwCtl.WebBrowser WebBrowser
  13. Height = 3735
  14. Left = 120
  15. TabIndex = 23
  16. Top = 4800
  17. Width = 11295
  18. ExtentX = 19923
  19. ExtentY = 6588
  20. ViewMode = 0
  21. Offline = 0
  22. Silent = 0
  23. RegisterAsBrowser= 0
  24. RegisterAsDropTarget= 1
  25. AutoArrange = 0 'False
  26. NoClientEdge = 0 'False
  27. AlignLeft = 0 'False
  28. NoWebView = 0 'False
  29. HideFileNames = 0 'False
  30. SingleClick = 0 'False
  31. SingleSelection = 0 'False
  32. NoFolders = 0 'False
  33. Transparent = 0 'False
  34. ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
  35. Location = ""
  36. End
  37. Begin VB.ComboBox cboNavigateLink
  38. Height = 315
  39. Left = 1080
  40. Style = 2 'Dropdown List
  41. TabIndex = 19
  42. Top = 4320
  43. Width = 2295
  44. End
  45. Begin VB.TextBox txtAllKeywords
  46. Height = 285
  47. Left = 120
  48. TabIndex = 3
  49. Tag = "1"
  50. Top = 1200
  51. Width = 2415
  52. End
  53. Begin VB.ListBox lstAllKeywords
  54. Height = 2595
  55. Left = 120
  56. Sorted = -1 'True
  57. TabIndex = 4
  58. Tag = "1"
  59. Top = 1560
  60. Width = 2415
  61. End
  62. Begin VB.CommandButton cmdNavigateLink
  63. Caption = "&Go"
  64. Height = 375
  65. Left = 3480
  66. TabIndex = 20
  67. Top = 4320
  68. Width = 375
  69. End
  70. Begin VB.ListBox lstSynonymSets
  71. Height = 2985
  72. Left = 9000
  73. Sorted = -1 'True
  74. TabIndex = 17
  75. Tag = "1"
  76. Top = 1200
  77. Width = 2415
  78. End
  79. Begin VB.ListBox lstKeywordsWithTitle
  80. Height = 2985
  81. Left = 3240
  82. MultiSelect = 2 'Extended
  83. Sorted = -1 'True
  84. TabIndex = 8
  85. Tag = "1"
  86. Top = 1200
  87. Width = 2415
  88. End
  89. Begin VB.CommandButton cmdClose
  90. Caption = "Close"
  91. Height = 375
  92. Left = 10200
  93. TabIndex = 22
  94. Top = 4320
  95. Width = 1215
  96. End
  97. Begin VB.CommandButton cmdSave
  98. Caption = "Save"
  99. Height = 375
  100. Left = 8880
  101. TabIndex = 21
  102. Top = 4320
  103. Width = 1215
  104. End
  105. Begin VB.CommandButton cmdAdd1
  106. Caption = "&>>"
  107. Height = 375
  108. Left = 2640
  109. TabIndex = 5
  110. Top = 2160
  111. Width = 495
  112. End
  113. Begin VB.CommandButton cmdRemove
  114. Caption = "&<<"
  115. Height = 375
  116. Left = 2640
  117. TabIndex = 6
  118. Top = 2640
  119. Width = 495
  120. End
  121. Begin VB.CommandButton cmdAdd2
  122. Caption = "<<"
  123. Height = 375
  124. Left = 5760
  125. TabIndex = 9
  126. Top = 2400
  127. Width = 495
  128. End
  129. Begin VB.ListBox lstKeywordsInSynonymSet
  130. Height = 2985
  131. Left = 6360
  132. MultiSelect = 2 'Extended
  133. Sorted = -1 'True
  134. TabIndex = 13
  135. Tag = "1"
  136. Top = 1200
  137. Width = 2415
  138. End
  139. Begin VB.Label lblNavigateLink
  140. Caption = "&View Topic:"
  141. Height = 255
  142. Left = 120
  143. TabIndex = 18
  144. Top = 4320
  145. Width = 1095
  146. End
  147. Begin VB.Label lblSynonymSets1
  148. Caption = "The &Keyword"
  149. Height = 255
  150. Left = 9000
  151. TabIndex = 14
  152. Top = 480
  153. Width = 2415
  154. End
  155. Begin VB.Label lblSynonymSets3
  156. Caption = "belongs to these Synonym Sets:"
  157. Height = 255
  158. Left = 9000
  159. TabIndex = 16
  160. Top = 960
  161. Width = 2415
  162. End
  163. Begin VB.Label lblSynonymSets2
  164. Caption = "Keyword"
  165. BeginProperty Font
  166. Name = "MS Sans Serif"
  167. Size = 8.25
  168. Charset = 0
  169. Weight = 700
  170. Underline = 0 'False
  171. Italic = 0 'False
  172. Strikethrough = 0 'False
  173. EndProperty
  174. Height = 255
  175. Left = 9000
  176. TabIndex = 15
  177. Tag = "1"
  178. Top = 720
  179. Width = 2415
  180. End
  181. Begin VB.Label lblAllKeywords
  182. Caption = "&All Keywords:"
  183. Height = 255
  184. Left = 120
  185. TabIndex = 2
  186. Top = 960
  187. Width = 2415
  188. End
  189. Begin VB.Label lblKeywordsWithTitle
  190. Caption = "A&ssociated Keywords:"
  191. Height = 255
  192. Left = 3240
  193. TabIndex = 7
  194. Top = 960
  195. Width = 2415
  196. End
  197. Begin VB.Label lblTitle2
  198. Caption = "<Title>"
  199. BeginProperty Font
  200. Name = "MS Sans Serif"
  201. Size = 8.25
  202. Charset = 0
  203. Weight = 700
  204. Underline = 0 'False
  205. Italic = 0 'False
  206. Strikethrough = 0 'False
  207. EndProperty
  208. Height = 255
  209. Left = 1320
  210. TabIndex = 1
  211. Tag = "1"
  212. Top = 120
  213. Width = 10095
  214. End
  215. Begin VB.Label lblKeywordsInSynonymSet2
  216. Caption = "Synonym Set"
  217. BeginProperty Font
  218. Name = "MS Sans Serif"
  219. Size = 8.25
  220. Charset = 0
  221. Weight = 700
  222. Underline = 0 'False
  223. Italic = 0 'False
  224. Strikethrough = 0 'False
  225. EndProperty
  226. Height = 255
  227. Left = 6360
  228. TabIndex = 11
  229. Tag = "1"
  230. Top = 720
  231. Width = 2295
  232. End
  233. Begin VB.Label lblKeywordsInSynonymSet1
  234. Caption = "The Synonym Se&t"
  235. Height = 255
  236. Left = 6360
  237. TabIndex = 10
  238. Top = 480
  239. Width = 2295
  240. End
  241. Begin VB.Label lblKeywordsInSynonymSet3
  242. Caption = "also contains the following:"
  243. Height = 255
  244. Left = 6360
  245. TabIndex = 12
  246. Top = 960
  247. Width = 2295
  248. End
  249. Begin VB.Label lblTitle1
  250. Caption = "Title:"
  251. Height = 255
  252. Left = 120
  253. TabIndex = 0
  254. Top = 120
  255. Width = 1095
  256. End
  257. End
  258. Attribute VB_Name = "frmAddRemoveKeywords"
  259. Attribute VB_GlobalNameSpace = False
  260. Attribute VB_Creatable = False
  261. Attribute VB_PredeclaredId = True
  262. Attribute VB_Exposed = False
  263. Option Explicit
  264. Private p_clsKeywords As AuthDatabase.Keywords
  265. Private p_clsSynonymSets As AuthDatabase.SynonymSets
  266. Private p_dictKeywordsWithTitle As Scripting.Dictionary
  267. Private p_clsSizer As Sizer
  268. Private p_intKIDForSynonymSets As Long
  269. Private p_intEIDForKeywordsInSynonymSet As Long
  270. Private p_strTempFile As String
  271. Private Const STR_LEAF_TITLE_C As String = "Topic Title:"
  272. Private Const STR_GROUP_TITLE_C As String = "Node Title:"
  273. Private Const STR_DEFAULT_KEYWORD_C As String = "<Keyword>"
  274. Private Const STR_DEFAULT_SYNONYM_SET_NAME_C As String = "<Synonym Set>"
  275. Private Sub Form_Load()
  276. On Error GoTo LErrorHandler
  277. cmdClose.Cancel = True
  278. cmdAdd1.Default = True
  279. Set p_clsKeywords = g_AuthDatabase.Keywords
  280. Set p_clsSynonymSets = g_AuthDatabase.SynonymSets
  281. Set p_clsSizer = New Sizer
  282. PopulateCboWithSKUs cboNavigateLink
  283. p_SetToolTips
  284. p_CreateTempFile
  285. p_PointToTempFile
  286. p_SetAllKeywords
  287. SetFontInternal Me
  288. LEnd:
  289. Exit Sub
  290. LErrorHandler:
  291. p_DisplayErrorMessage "Form_Load"
  292. GoTo LEnd
  293. End Sub
  294. Private Sub Form_Unload(Cancel As Integer)
  295. Set p_clsKeywords = Nothing
  296. Set p_clsSynonymSets = Nothing
  297. Set p_dictKeywordsWithTitle = Nothing
  298. Set p_clsSizer = Nothing
  299. p_DeleteTempFile
  300. frmMain.AddRemoveKeywordsFormGoingAway
  301. Set frmAddRemoveKeywords = Nothing
  302. End Sub
  303. Private Sub Form_Activate()
  304. On Error GoTo LErrorHandler
  305. ' I had cmdNavigateLink_Click in SetKeywords; however it caused
  306. ' problems with the context menu on the main taxonomy sceen.
  307. cmdNavigateLink_Click
  308. p_SetSizingInfo
  309. DoEvents
  310. Exit Sub
  311. LErrorHandler:
  312. g_ErrorInfo.SetInfoAndDump "Form_Activate"
  313. End Sub
  314. Private Sub Form_Resize()
  315. On Error GoTo LErrorHandler
  316. p_clsSizer.Resize
  317. Exit Sub
  318. LErrorHandler:
  319. g_ErrorInfo.SetInfoAndDump "Form_Resize"
  320. End Sub
  321. Private Sub txtAllKeywords_GotFocus()
  322. cmdAdd1.Default = False
  323. End Sub
  324. Private Sub txtAllKeywords_LostFocus()
  325. cmdAdd1.Default = True
  326. End Sub
  327. Private Sub txtAllKeywords_Change()
  328. Dim intIndex As Integer
  329. Dim txtToFind As String
  330. txtToFind = txtAllKeywords.Text
  331. intIndex = SendMessage(lstAllKeywords.hwnd, LB_SELECTSTRING, 0, txtToFind)
  332. End Sub
  333. Private Sub txtAllKeywords_KeyPress(KeyAscii As Integer)
  334. On Error GoTo LErrorHandler
  335. Dim strKeyword As String
  336. Dim intIndex As Long
  337. Dim intKID As Long
  338. Dim Response As VbMsgBoxResult
  339. Dim blnAddToAllKeywords As Boolean
  340. If (KeyAscii <> Asc(vbCr)) Then
  341. Exit Sub
  342. End If
  343. ' To prevent an annoying beep:
  344. KeyAscii = 0
  345. strKeyword = RemoveExtraSpaces(txtAllKeywords.Text)
  346. txtAllKeywords.Text = ""
  347. If (strKeyword = "") Then
  348. Exit Sub
  349. End If
  350. For intIndex = 0 To lstKeywordsWithTitle.ListCount - 1
  351. If (LCase$(strKeyword) = LCase$(lstKeywordsWithTitle.List(intIndex))) Then
  352. Exit Sub
  353. End If
  354. Next
  355. intKID = p_clsKeywords.GetKIDOfKeyword(strKeyword)
  356. If (intKID = INVALID_ID_C) Then
  357. Response = MsgBox( _
  358. "The keyword """ & strKeyword & """ doesn't exist. Do you want to create it?", _
  359. vbOKCancel + vbDefaultButton1)
  360. If (Response = vbCancel) Then
  361. Exit Sub
  362. End If
  363. blnAddToAllKeywords = True
  364. End If
  365. intKID = p_clsKeywords.Create(strKeyword)
  366. If (blnAddToAllKeywords) Then
  367. lstAllKeywords.AddItem strKeyword
  368. lstAllKeywords.ItemData(lstAllKeywords.NewIndex) = intKID
  369. End If
  370. p_dictKeywordsWithTitle.Add intKID, strKeyword
  371. p_SetKeywordsWithTitle
  372. intIndex = SendMessage(lstAllKeywords.hwnd, LB_SELECTSTRING, 0, strKeyword)
  373. Exit Sub
  374. LErrorHandler:
  375. Select Case Err.Number
  376. Case errContainsGarbageChar
  377. MsgBox "The Keyword " & strKeyword & " contains garbage characters.", _
  378. vbExclamation + vbOKOnly
  379. Case errContainsStopSign
  380. MsgBox "The Keyword " & strKeyword & " contains a Stop Sign.", _
  381. vbExclamation + vbOKOnly
  382. Case errContainsStopWord
  383. MsgBox "The Keyword " & strKeyword & " contains a Stop Word.", _
  384. vbExclamation + vbOKOnly
  385. Case errContainsOperatorShortcut
  386. MsgBox "The Keyword " & strKeyword & " contains an operator shortcut.", _
  387. vbExclamation + vbOKOnly
  388. Case errContainsVerbalOperator
  389. MsgBox "The Keyword " & strKeyword & " contains a verbal operator.", _
  390. vbExclamation + vbOKOnly
  391. Case errTooLong
  392. MsgBox "The Keyword " & strKeyword & " is too long", _
  393. vbExclamation + vbOKOnly
  394. Case E_FAIL
  395. DisplayDatabaseLockedError
  396. Case errDatabaseVersionIncompatible
  397. DisplayDatabaseVersionError
  398. Case Else
  399. g_ErrorInfo.SetInfoAndDump "txtAllKeywords_KeyPress"
  400. End Select
  401. End Sub
  402. Private Sub lstAllKeywords_DblClick()
  403. cmdAdd1_Click
  404. End Sub
  405. Private Sub lstKeywordsInSynonymSet_DblClick()
  406. cmdAdd2_Click
  407. End Sub
  408. Private Sub lstKeywordsWithTitle_Click()
  409. On Error GoTo LErrorHandler
  410. lblSynonymSets2.Caption = lstKeywordsWithTitle.Text
  411. p_SetSynonymSets lstKeywordsWithTitle.ItemData(lstKeywordsWithTitle.ListIndex)
  412. LEnd:
  413. Exit Sub
  414. LErrorHandler:
  415. p_DisplayErrorMessage "lstKeywordsWithTitle_Click"
  416. GoTo LEnd
  417. End Sub
  418. Private Sub lstSynonymSets_Click()
  419. On Error GoTo LErrorHandler
  420. lblKeywordsInSynonymSet2.Caption = lstSynonymSets.Text
  421. p_SetKeywordsInSynonymSet lstSynonymSets.ItemData(lstSynonymSets.ListIndex)
  422. LEnd:
  423. Exit Sub
  424. LErrorHandler:
  425. p_DisplayErrorMessage "lstSynonymSets_Click"
  426. GoTo LEnd
  427. End Sub
  428. Private Sub cmdAdd1_Click()
  429. On Error GoTo LErrorHandler
  430. Dim intIndex As Long
  431. Dim intKID As Long
  432. Dim strKeyword As String
  433. For intIndex = 0 To lstAllKeywords.ListCount - 1
  434. If (lstAllKeywords.Selected(intIndex)) Then
  435. strKeyword = lstAllKeywords.List(intIndex)
  436. lstAllKeywords.Selected(intIndex) = False
  437. intKID = lstAllKeywords.ItemData(intIndex)
  438. If (Not p_dictKeywordsWithTitle.Exists(intKID)) Then
  439. p_dictKeywordsWithTitle.Add intKID, strKeyword
  440. End If
  441. End If
  442. Next
  443. p_SetKeywordsWithTitle
  444. LEnd:
  445. Exit Sub
  446. LErrorHandler:
  447. p_DisplayErrorMessage "cmdAdd1_Click"
  448. GoTo LEnd
  449. End Sub
  450. Private Sub cmdAdd2_Click()
  451. On Error GoTo LErrorHandler
  452. Dim intIndex As Long
  453. Dim intKID As Long
  454. Dim strKeyword As String
  455. For intIndex = lstKeywordsInSynonymSet.ListCount - 1 To 0 Step -1
  456. If (lstKeywordsInSynonymSet.Selected(intIndex)) Then
  457. intKID = lstKeywordsInSynonymSet.ItemData(intIndex)
  458. strKeyword = lstKeywordsInSynonymSet.List(intIndex)
  459. If (Not p_dictKeywordsWithTitle.Exists(intKID)) Then
  460. p_dictKeywordsWithTitle.Add intKID, strKeyword
  461. End If
  462. lstKeywordsInSynonymSet.RemoveItem intIndex
  463. End If
  464. Next
  465. p_SetKeywordsWithTitle
  466. LEnd:
  467. Exit Sub
  468. LErrorHandler:
  469. p_DisplayErrorMessage "cmdAdd2_Click"
  470. GoTo LEnd
  471. End Sub
  472. Private Sub cmdRemove_Click()
  473. On Error GoTo LErrorHandler
  474. Dim intIndex As Long
  475. For intIndex = 0 To lstKeywordsWithTitle.ListCount - 1
  476. If (lstKeywordsWithTitle.Selected(intIndex)) Then
  477. p_dictKeywordsWithTitle.Remove lstKeywordsWithTitle.ItemData(intIndex)
  478. End If
  479. Next
  480. p_SetKeywordsWithTitle
  481. LEnd:
  482. Exit Sub
  483. LErrorHandler:
  484. p_DisplayErrorMessage "cmdRemove_Click"
  485. GoTo LEnd
  486. End Sub
  487. Private Sub cmdNavigateLink_Click()
  488. On Error Resume Next
  489. Dim strURI As String
  490. strURI = frmMain.GetNavigateLinkURI(cboNavigateLink.ListIndex)
  491. If (strURI <> "") Then
  492. WebBrowser.Navigate strURI
  493. Else
  494. p_PointToTempFile
  495. End If
  496. End Sub
  497. Private Sub cmdSave_Click()
  498. On Error GoTo LErrorHandler
  499. frmMain.SetKeywords p_dictKeywordsWithTitle
  500. LEnd:
  501. Exit Sub
  502. LErrorHandler:
  503. p_DisplayErrorMessage "cmdSave_Click"
  504. GoTo LEnd
  505. End Sub
  506. Private Sub cmdClose_Click()
  507. Unload Me
  508. End Sub
  509. Public Sub SetTitle(ByVal i_strTitle As String, ByVal i_blnLeaf As Boolean)
  510. If (i_blnLeaf) Then
  511. lblTitle1.Caption = STR_LEAF_TITLE_C
  512. Else
  513. lblTitle1.Caption = STR_GROUP_TITLE_C
  514. End If
  515. lblTitle2 = i_strTitle
  516. End Sub
  517. Public Sub SetKeywords(ByVal i_dictKeywordsWithTitle As Scripting.Dictionary)
  518. Dim intKID As Variant
  519. Set p_dictKeywordsWithTitle = New Scripting.Dictionary
  520. For Each intKID In i_dictKeywordsWithTitle.Keys
  521. p_dictKeywordsWithTitle.Add intKID, i_dictKeywordsWithTitle(intKID)
  522. Next
  523. txtAllKeywords = ""
  524. p_intKIDForSynonymSets = INVALID_ID_C
  525. p_intEIDForKeywordsInSynonymSet = INVALID_ID_C
  526. p_SetKeywordsWithTitle
  527. End Sub
  528. Public Sub LinkNavigable(ByVal i_bln As Boolean)
  529. If (i_bln) Then
  530. lblNavigateLink.Enabled = True
  531. cboNavigateLink.Enabled = True
  532. cmdNavigateLink.Enabled = True
  533. Else
  534. lblNavigateLink.Enabled = False
  535. cboNavigateLink.Enabled = False
  536. cmdNavigateLink.Enabled = False
  537. End If
  538. End Sub
  539. Private Sub p_SetAllKeywords()
  540. Dim rs As ADODB.Recordset
  541. Dim intCount As Long
  542. Set rs = New ADODB.Recordset
  543. lstAllKeywords.Clear
  544. p_clsKeywords.GetAllKeywordsRs rs
  545. Do While (Not rs.EOF)
  546. lstAllKeywords.AddItem rs("Keyword")
  547. lstAllKeywords.ItemData(lstAllKeywords.NewIndex) = rs("KID").Value
  548. intCount = intCount + 1
  549. If (intCount = 1000) Then
  550. DoEvents
  551. intCount = 0
  552. End If
  553. rs.MoveNext
  554. Loop
  555. End Sub
  556. Private Sub p_SetKeywordsWithTitle()
  557. Dim intKID As Variant
  558. lstKeywordsWithTitle.Clear
  559. For Each intKID In p_dictKeywordsWithTitle.Keys
  560. lstKeywordsWithTitle.AddItem p_dictKeywordsWithTitle(intKID)
  561. lstKeywordsWithTitle.ItemData(lstKeywordsWithTitle.NewIndex) = intKID
  562. Next
  563. If (lstKeywordsWithTitle.ListCount <> 0) Then
  564. lstKeywordsWithTitle.Selected(0) = True
  565. Else
  566. p_ClearSynonymSets
  567. End If
  568. End Sub
  569. Private Sub p_SetSynonymSets(i_intKID As Long)
  570. Dim rs As ADODB.Recordset
  571. Set rs = New ADODB.Recordset
  572. If (i_intKID = p_intKIDForSynonymSets) Then
  573. Exit Sub
  574. Else
  575. p_intKIDForSynonymSets = i_intKID
  576. End If
  577. lstSynonymSets.Clear
  578. p_clsSynonymSets.GetSynonymSetsForKeyword i_intKID, rs
  579. Do While (Not rs.EOF)
  580. lstSynonymSets.AddItem rs("Name")
  581. lstSynonymSets.ItemData(lstSynonymSets.NewIndex) = rs("EID").Value
  582. rs.MoveNext
  583. Loop
  584. If (lstSynonymSets.ListCount <> 0) Then
  585. lstSynonymSets.Selected(0) = True
  586. Else
  587. p_ClearKeywordsInSynonymSet
  588. End If
  589. End Sub
  590. Private Sub p_SetKeywordsInSynonymSet(i_intEID As Long)
  591. Dim rs As ADODB.Recordset
  592. Dim intKID As Long
  593. Dim intIndex As Long
  594. Set rs = New ADODB.Recordset
  595. If (i_intEID = p_intEIDForKeywordsInSynonymSet) Then
  596. Exit Sub
  597. Else
  598. p_intEIDForKeywordsInSynonymSet = i_intEID
  599. End If
  600. lstKeywordsInSynonymSet.Clear
  601. p_clsKeywords.GetKeywordsInSynonymSet i_intEID, rs
  602. Do While (Not rs.EOF)
  603. lstKeywordsInSynonymSet.AddItem rs("Keyword")
  604. lstKeywordsInSynonymSet.ItemData(lstKeywordsInSynonymSet.NewIndex) = rs("KID").Value
  605. rs.MoveNext
  606. Loop
  607. ' Remove all keywords already associated with the title
  608. For intIndex = lstKeywordsInSynonymSet.ListCount - 1 To 0 Step -1
  609. intKID = lstKeywordsInSynonymSet.ItemData(intIndex)
  610. If (p_dictKeywordsWithTitle.Exists(intKID)) Then
  611. lstKeywordsInSynonymSet.RemoveItem intIndex
  612. End If
  613. Next
  614. End Sub
  615. Private Sub p_ClearSynonymSets()
  616. lstSynonymSets.Clear
  617. lblSynonymSets2.Caption = STR_DEFAULT_KEYWORD_C
  618. p_SetSynonymSets INVALID_ID_C
  619. End Sub
  620. Private Sub p_ClearKeywordsInSynonymSet()
  621. lstKeywordsInSynonymSet.Clear
  622. lblKeywordsInSynonymSet2.Caption = STR_DEFAULT_SYNONYM_SET_NAME_C
  623. p_SetKeywordsInSynonymSet INVALID_ID_C
  624. End Sub
  625. Private Sub p_DisplayErrorMessage( _
  626. ByVal i_strFunction As String _
  627. )
  628. Select Case Err.Number
  629. Case E_FAIL
  630. DisplayDatabaseLockedError
  631. Case errDatabaseVersionIncompatible
  632. DisplayDatabaseVersionError
  633. Case Else
  634. g_ErrorInfo.SetInfoAndDump i_strFunction
  635. End Select
  636. End Sub
  637. Private Sub p_PointToTempFile()
  638. WebBrowser.Navigate p_strTempFile
  639. End Sub
  640. Private Sub p_CreateTempFile()
  641. p_strTempFile = TempFile
  642. FileWrite p_strTempFile, "<HTML><BODY>Select a SKU and then click Go to display topic. " & _
  643. "If the Go button is greyed out, it means that there is no URI associated with the " & _
  644. "Node/Topic. </BODY></HTML>"
  645. End Sub
  646. Private Sub p_DeleteTempFile()
  647. Dim FSO As New FileSystemObject
  648. FSO.DeleteFile p_strTempFile
  649. End Sub
  650. Private Sub p_SetSizingInfo()
  651. p_clsSizer.AddControl cmdAdd1
  652. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = Me
  653. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_WIDTH_E
  654. p_clsSizer.Operation(DIM_LEFT_E) = OP_MULTIPLY_E
  655. p_clsSizer.AddControl cmdRemove
  656. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = cmdAdd1
  657. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = cmdAdd1
  658. p_clsSizer.AddControl cmdAdd2
  659. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = Me
  660. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_WIDTH_E
  661. p_clsSizer.Operation(DIM_LEFT_E) = OP_MULTIPLY_E
  662. p_clsSizer.AddControl lblAllKeywords
  663. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = cmdAdd1
  664. p_clsSizer.AddControl lstAllKeywords
  665. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = lblAllKeywords
  666. p_clsSizer.AddControl txtAllKeywords
  667. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = lblAllKeywords
  668. p_clsSizer.AddControl lblKeywordsWithTitle
  669. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = cmdAdd1
  670. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = cmdAdd2
  671. p_clsSizer.AddControl lstKeywordsWithTitle
  672. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = lblKeywordsWithTitle
  673. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = lblKeywordsWithTitle
  674. p_clsSizer.AddControl lblKeywordsInSynonymSet1
  675. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = cmdAdd2
  676. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = Me
  677. p_clsSizer.Operation(DIM_WIDTH_E) = OP_MULTIPLY_E
  678. p_clsSizer.AddControl lblKeywordsInSynonymSet2
  679. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = lblKeywordsInSynonymSet1
  680. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = lblKeywordsInSynonymSet1
  681. p_clsSizer.AddControl lblKeywordsInSynonymSet3
  682. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = lblKeywordsInSynonymSet1
  683. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = lblKeywordsInSynonymSet1
  684. p_clsSizer.AddControl lstKeywordsInSynonymSet
  685. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = lblKeywordsInSynonymSet1
  686. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = lblKeywordsInSynonymSet1
  687. p_clsSizer.AddControl lblSynonymSets1
  688. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = lblKeywordsInSynonymSet1
  689. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_RIGHT_E
  690. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = Me
  691. p_clsSizer.ReferenceDimension(DIM_RIGHT_E) = DIM_WIDTH_E
  692. p_clsSizer.AddControl lblSynonymSets2
  693. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = lblSynonymSets1
  694. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = lblSynonymSets1
  695. p_clsSizer.AddControl lblSynonymSets3
  696. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = lblSynonymSets1
  697. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = lblSynonymSets1
  698. p_clsSizer.AddControl lstSynonymSets
  699. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = lblSynonymSets1
  700. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = lblSynonymSets1
  701. p_clsSizer.AddControl cmdSave
  702. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = lstSynonymSets
  703. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = Me
  704. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_WIDTH_E
  705. p_clsSizer.AddControl cmdClose
  706. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = cmdSave
  707. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = cmdSave
  708. p_clsSizer.AddControl WebBrowser
  709. Set p_clsSizer.ReferenceControl(DIM_RIGHT_E) = Me
  710. p_clsSizer.ReferenceDimension(DIM_RIGHT_E) = DIM_WIDTH_E
  711. Set p_clsSizer.ReferenceControl(DIM_BOTTOM_E) = Me
  712. p_clsSizer.ReferenceDimension(DIM_BOTTOM_E) = DIM_HEIGHT_E
  713. End Sub
  714. Private Sub p_SetToolTips()
  715. txtAllKeywords.ToolTipText = "Type a keyword for the selected topic."
  716. lblAllKeywords.ToolTipText = "This is a list of all keywords that have been created " & _
  717. "for this database."
  718. lstAllKeywords.ToolTipText = lblAllKeywords.ToolTipText
  719. lblKeywordsWithTitle.ToolTipText = "This is a list of all keywords that have been " & _
  720. "associated with a selected node or topic."
  721. lstKeywordsWithTitle.ToolTipText = lblKeywordsWithTitle.ToolTipText
  722. lblSynonymSets1.ToolTipText = "This is a list of all the synonym sets that the " & _
  723. "selected associated keyword belongs to."
  724. lblSynonymSets2.ToolTipText = lblSynonymSets1.ToolTipText
  725. lblSynonymSets3.ToolTipText = lblSynonymSets1.ToolTipText
  726. lstSynonymSets.ToolTipText = lblSynonymSets1.ToolTipText
  727. lblKeywordsInSynonymSet1.ToolTipText = "This is a list of all the other keywords " & _
  728. "that the selected synonym set contains."
  729. lblKeywordsInSynonymSet2.ToolTipText = lblKeywordsInSynonymSet1.ToolTipText
  730. lblKeywordsInSynonymSet3.ToolTipText = lblKeywordsInSynonymSet1.ToolTipText
  731. lstKeywordsInSynonymSet.ToolTipText = lblKeywordsInSynonymSet1.ToolTipText
  732. lblNavigateLink.ToolTipText = "Select a valid SKU to view the content of the selected topic."
  733. cboNavigateLink.ToolTipText = lblNavigateLink.ToolTipText
  734. WebBrowser.ToolTipText = "Displays the content of the selected topic."
  735. End Sub