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.

572 lines
16 KiB

  1. VERSION 5.00
  2. Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll"
  3. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  4. Begin VB.Form frmParameters
  5. Caption = "Parameters"
  6. ClientHeight = 6975
  7. ClientLeft = 60
  8. ClientTop = 345
  9. ClientWidth = 7590
  10. LinkTopic = "Form1"
  11. ScaleHeight = 6975
  12. ScaleWidth = 7590
  13. StartUpPosition = 3 'Windows Default
  14. Begin VB.Frame fraSKU
  15. Height = 5535
  16. Left = 120
  17. TabIndex = 2
  18. Top = 480
  19. Width = 7335
  20. Begin TabDlg.SSTab SSTab
  21. Height = 3735
  22. Left = 120
  23. TabIndex = 11
  24. Top = 1680
  25. Width = 7095
  26. _ExtentX = 12515
  27. _ExtentY = 6588
  28. _Version = 393216
  29. Tabs = 4
  30. TabsPerRow = 4
  31. TabHeight = 520
  32. TabCaption(0) = "Pkg Desc Addition"
  33. TabPicture(0) = "frmParameters.frx":0000
  34. Tab(0).ControlEnabled= -1 'True
  35. Tab(0).Control(0)= "txtXML(0)"
  36. Tab(0).Control(0).Enabled= 0 'False
  37. Tab(0).ControlCount= 1
  38. TabCaption(1) = "Pkg Desc Preview"
  39. TabPicture(1) = "frmParameters.frx":001C
  40. Tab(1).ControlEnabled= 0 'False
  41. Tab(1).Control(0)= "WebBrowser(0)"
  42. Tab(1).ControlCount= 1
  43. TabCaption(2) = "HHT Addition"
  44. TabPicture(2) = "frmParameters.frx":0038
  45. Tab(2).ControlEnabled= 0 'False
  46. Tab(2).Control(0)= "txtXML(1)"
  47. Tab(2).ControlCount= 1
  48. TabCaption(3) = "HHT Preview"
  49. TabPicture(3) = "frmParameters.frx":0054
  50. Tab(3).ControlEnabled= 0 'False
  51. Tab(3).Control(0)= "WebBrowser(1)"
  52. Tab(3).Control(0).Enabled= 0 'False
  53. Tab(3).ControlCount= 1
  54. Begin SHDocVwCtl.WebBrowser WebBrowser
  55. Height = 3135
  56. Index = 1
  57. Left = -74880
  58. TabIndex = 15
  59. Top = 480
  60. Width = 6855
  61. ExtentX = 12091
  62. ExtentY = 5530
  63. ViewMode = 0
  64. Offline = 0
  65. Silent = 0
  66. RegisterAsBrowser= 0
  67. RegisterAsDropTarget= 1
  68. AutoArrange = 0 'False
  69. NoClientEdge = 0 'False
  70. AlignLeft = 0 'False
  71. NoWebView = 0 'False
  72. HideFileNames = 0 'False
  73. SingleClick = 0 'False
  74. SingleSelection = 0 'False
  75. NoFolders = 0 'False
  76. Transparent = 0 'False
  77. ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
  78. Location = ""
  79. End
  80. Begin VB.TextBox txtXML
  81. Height = 3135
  82. Index = 1
  83. Left = -74880
  84. MultiLine = -1 'True
  85. ScrollBars = 3 'Both
  86. TabIndex = 14
  87. Top = 480
  88. Width = 6855
  89. End
  90. Begin VB.TextBox txtXML
  91. Height = 3135
  92. Index = 0
  93. Left = 120
  94. MultiLine = -1 'True
  95. ScrollBars = 3 'Both
  96. TabIndex = 12
  97. Top = 480
  98. Width = 6855
  99. End
  100. Begin SHDocVwCtl.WebBrowser WebBrowser
  101. Height = 3135
  102. Index = 0
  103. Left = -74880
  104. TabIndex = 13
  105. Top = 480
  106. Width = 6855
  107. ExtentX = 12091
  108. ExtentY = 5530
  109. ViewMode = 0
  110. Offline = 0
  111. Silent = 0
  112. RegisterAsBrowser= 0
  113. RegisterAsDropTarget= 1
  114. AutoArrange = 0 'False
  115. NoClientEdge = 0 'False
  116. AlignLeft = 0 'False
  117. NoWebView = 0 'False
  118. HideFileNames = 0 'False
  119. SingleClick = 0 'False
  120. SingleSelection = 0 'False
  121. NoFolders = 0 'False
  122. Transparent = 0 'False
  123. ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
  124. Location = ""
  125. End
  126. End
  127. Begin VB.TextBox txtValue
  128. Height = 285
  129. Index = 3
  130. Left = 2400
  131. TabIndex = 8
  132. Top = 960
  133. Width = 4815
  134. End
  135. Begin VB.TextBox txtValue
  136. Height = 285
  137. Index = 2
  138. Left = 2400
  139. TabIndex = 6
  140. Top = 600
  141. Width = 4815
  142. End
  143. Begin VB.TextBox txtValue
  144. Height = 285
  145. Index = 1
  146. Left = 2400
  147. TabIndex = 4
  148. Top = 240
  149. Width = 4815
  150. End
  151. Begin VB.TextBox txtValue
  152. Height = 285
  153. Index = 4
  154. Left = 2400
  155. TabIndex = 10
  156. Top = 1320
  157. Width = 4815
  158. End
  159. Begin VB.Label lbl
  160. Caption = "Product Version:"
  161. Height = 255
  162. Index = 3
  163. Left = 120
  164. TabIndex = 7
  165. Top = 960
  166. Width = 2295
  167. End
  168. Begin VB.Label lbl
  169. Caption = "Product ID:"
  170. Height = 255
  171. Index = 2
  172. Left = 120
  173. TabIndex = 5
  174. Top = 600
  175. Width = 2295
  176. End
  177. Begin VB.Label lbl
  178. Caption = "Display Name:"
  179. Height = 255
  180. Index = 1
  181. Left = 120
  182. TabIndex = 3
  183. Top = 240
  184. Width = 2295
  185. End
  186. Begin VB.Label lbl
  187. Caption = "Broken Link Working Directory:"
  188. Height = 255
  189. Index = 4
  190. Left = 120
  191. TabIndex = 9
  192. Top = 1320
  193. Width = 2295
  194. End
  195. End
  196. Begin VB.ComboBox cboSKU
  197. Height = 315
  198. Left = 600
  199. Style = 2 'Dropdown List
  200. TabIndex = 1
  201. Top = 120
  202. Width = 6855
  203. End
  204. Begin VB.TextBox txtValue
  205. Height = 285
  206. Index = 5
  207. Left = 1200
  208. TabIndex = 17
  209. Top = 6120
  210. Width = 6255
  211. End
  212. Begin VB.CommandButton cmdSave
  213. Caption = "Save"
  214. Height = 375
  215. Left = 4920
  216. TabIndex = 18
  217. Top = 6480
  218. Width = 1215
  219. End
  220. Begin VB.CommandButton cmdClose
  221. Caption = "Close"
  222. Height = 375
  223. Left = 6240
  224. TabIndex = 19
  225. Top = 6480
  226. Width = 1215
  227. End
  228. Begin VB.Label lbl
  229. Caption = "SKU:"
  230. Height = 255
  231. Index = 0
  232. Left = 120
  233. TabIndex = 0
  234. Top = 120
  235. Width = 2295
  236. End
  237. Begin VB.Label lbl
  238. Caption = "Vendor String:"
  239. Height = 255
  240. Index = 5
  241. Left = 120
  242. TabIndex = 16
  243. Top = 6120
  244. Width = 2295
  245. End
  246. End
  247. Attribute VB_Name = "frmParameters"
  248. Attribute VB_GlobalNameSpace = False
  249. Attribute VB_Creatable = False
  250. Attribute VB_PredeclaredId = True
  251. Attribute VB_Exposed = False
  252. Option Explicit
  253. Private Enum TXTVALUE_INDEX_E
  254. VI_DISPLAY_NAME_E = 1
  255. VI_PRODUCT_ID_E = 2
  256. VI_PRODUCT_VERSION_E = 3
  257. VI_BL_DIRECTORY_E = 4
  258. VI_VENDOR_STRING_E = 5
  259. End Enum
  260. Private Enum XML_INDEX_E
  261. XI_PKG_DESC_E = 0
  262. XI_HHT_E = 1
  263. End Enum
  264. Private Enum SSTAB_INDEX_E
  265. SI_PKG_DESC_E = 0
  266. SI_PKG_DESC_PREVIEW_E = 1
  267. SI_HHT_E = 2
  268. SI_HHT_PREVIEW_E = 3
  269. End Enum
  270. Private p_clsSizer As Sizer
  271. Private p_clsParameters As AuthDatabase.Parameters
  272. Private p_blnDirty As Boolean
  273. Private p_blnUpdating As Boolean
  274. Private p_enumCurrentSKU As SKU_E
  275. Private p_strTempFile As String
  276. Private Sub cboSKU_Click()
  277. p_ChangeSKU
  278. End Sub
  279. Private Sub cboSKU_Change()
  280. p_ChangeSKU
  281. End Sub
  282. Private Sub Form_Load()
  283. On Error GoTo LErrorHandler
  284. Dim FSO As Scripting.FileSystemObject
  285. cmdClose.Cancel = True
  286. cmdSave.Default = True
  287. Set p_clsSizer = New Sizer
  288. Set p_clsParameters = g_AuthDatabase.Parameters
  289. PopulateCboWithSKUs cboSKU
  290. Set FSO = New Scripting.FileSystemObject
  291. p_strTempFile = Environ$("TEMP") & "\" & FSO.GetTempName & ".xml"
  292. LEnd:
  293. Exit Sub
  294. LErrorHandler:
  295. GoTo LEnd
  296. End Sub
  297. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  298. Dim Response As VbMsgBoxResult
  299. If (p_blnDirty) Then
  300. Response = MsgBox("You have usaved changes. " & _
  301. "Are you sure that you want to exit?", vbOKCancel + vbExclamation)
  302. If (Response <> vbOK) Then
  303. Cancel = True
  304. End If
  305. End If
  306. End Sub
  307. Private Sub Form_Unload(Cancel As Integer)
  308. On Error Resume Next
  309. Dim FSO As Scripting.FileSystemObject
  310. Set p_clsSizer = Nothing
  311. Set p_clsParameters = Nothing
  312. Set FSO = New Scripting.FileSystemObject
  313. FSO.DeleteFile p_strTempFile
  314. End Sub
  315. Private Sub Form_Activate()
  316. On Error GoTo LErrorHandler
  317. p_SetSizingInfo
  318. LEnd:
  319. Exit Sub
  320. LErrorHandler:
  321. GoTo LEnd
  322. End Sub
  323. Private Sub Form_Resize()
  324. On Error GoTo LErrorHandler
  325. p_clsSizer.Resize
  326. LEnd:
  327. Exit Sub
  328. LErrorHandler:
  329. GoTo LEnd
  330. End Sub
  331. Private Sub cmdSave_Click()
  332. On Error GoTo LErrorHandler
  333. p_Save
  334. LEnd:
  335. p_blnDirty = False
  336. Exit Sub
  337. LErrorHandler:
  338. g_ErrorInfo.SetInfoAndDump "cmdSave_Click"
  339. GoTo LEnd
  340. End Sub
  341. Private Sub cmdClose_Click()
  342. Unload Me
  343. End Sub
  344. Private Sub SSTab_Click(PreviousTab As Integer)
  345. Dim strXML As String
  346. Dim intIndex As Long
  347. If (SSTab.Tab = SI_HHT_PREVIEW_E) Then
  348. intIndex = XI_HHT_E
  349. ElseIf (SSTab.Tab = SI_PKG_DESC_PREVIEW_E) Then
  350. intIndex = XI_PKG_DESC_E
  351. Else
  352. Exit Sub
  353. End If
  354. strXML = "<X>" & txtXML(intIndex) & "</X>"
  355. FileWrite p_strTempFile, strXML, , True
  356. WebBrowser(intIndex).Navigate p_strTempFile
  357. End Sub
  358. Private Sub txtValue_Change(Index As Integer)
  359. If (p_blnUpdating) Then
  360. Exit Sub
  361. End If
  362. p_blnDirty = True
  363. End Sub
  364. Private Sub txtXML_Change(Index As Integer)
  365. If (p_blnUpdating) Then
  366. Exit Sub
  367. End If
  368. p_blnDirty = True
  369. End Sub
  370. Private Sub txtXML_GotFocus(Index As Integer)
  371. cmdSave.Default = False
  372. End Sub
  373. Private Sub txtXML_LostFocus(Index As Integer)
  374. cmdSave.Default = True
  375. End Sub
  376. Private Sub p_ChangeSKU()
  377. Dim enumNewSKU As SKU_E
  378. Dim Response As VbMsgBoxResult
  379. Dim intIndex As Long
  380. enumNewSKU = cboSKU.ItemData(cboSKU.ListIndex)
  381. If (enumNewSKU = p_enumCurrentSKU) Then
  382. Exit Sub
  383. End If
  384. If (p_blnDirty And (p_enumCurrentSKU <> 0)) Then
  385. Response = MsgBox("You have unsaved changes. " & _
  386. "Are you sure that you want to discard them?", vbOKCancel + vbExclamation)
  387. If (Response <> vbOK) Then
  388. For intIndex = 0 To cboSKU.ListCount - 1
  389. If (cboSKU.ItemData(intIndex) = p_enumCurrentSKU) Then
  390. cboSKU.ListIndex = intIndex
  391. Exit Sub
  392. End If
  393. Next
  394. End If
  395. End If
  396. p_enumCurrentSKU = enumNewSKU
  397. p_blnUpdating = True
  398. txtValue(VI_DISPLAY_NAME_E) = p_clsParameters.DisplayName(p_enumCurrentSKU)
  399. txtValue(VI_PRODUCT_ID_E) = p_clsParameters.ProductId(p_enumCurrentSKU)
  400. txtValue(VI_PRODUCT_VERSION_E) = p_clsParameters.ProductVersion(p_enumCurrentSKU)
  401. txtValue(VI_VENDOR_STRING_E) = p_clsParameters.Value(VENDOR_STRING_C) & ""
  402. txtValue(VI_BL_DIRECTORY_E) = p_clsParameters.Value( _
  403. BROKEN_LINK_WORKING_DIR_C & Hex(p_enumCurrentSKU)) & ""
  404. txtXML(XI_PKG_DESC_E) = p_clsParameters.DomFragmentPackageDesc(p_enumCurrentSKU)
  405. txtXML(XI_HHT_E) = p_clsParameters.DomFragmentHHT(p_enumCurrentSKU)
  406. p_blnUpdating = False
  407. fraSKU.Caption = cboSKU.List(cboSKU.ListIndex) & " Values"
  408. p_blnDirty = False
  409. End Sub
  410. Private Sub p_Save()
  411. p_clsParameters.DisplayName(p_enumCurrentSKU) = txtValue(VI_DISPLAY_NAME_E)
  412. p_clsParameters.ProductId(p_enumCurrentSKU) = txtValue(VI_PRODUCT_ID_E)
  413. p_clsParameters.ProductVersion(p_enumCurrentSKU) = txtValue(VI_PRODUCT_VERSION_E)
  414. p_clsParameters.Value(VENDOR_STRING_C) = txtValue(VI_VENDOR_STRING_E)
  415. p_clsParameters.Value(BROKEN_LINK_WORKING_DIR_C & Hex(p_enumCurrentSKU)) = _
  416. txtValue(VI_BL_DIRECTORY_E)
  417. p_clsParameters.DomFragmentPackageDesc(p_enumCurrentSKU) = txtXML(XI_PKG_DESC_E)
  418. p_clsParameters.DomFragmentHHT(p_enumCurrentSKU) = txtXML(XI_HHT_E)
  419. End Sub
  420. Private Sub p_SetSizingInfo()
  421. Static blnInfoSet As Boolean
  422. Dim intIndex As Long
  423. ' If (blnInfoSet) Then
  424. ' Exit Sub
  425. ' End If
  426. p_clsSizer.AddControl cboSKU
  427. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = Me
  428. p_clsSizer.AddControl fraSKU
  429. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = Me
  430. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = Me
  431. For intIndex = VI_DISPLAY_NAME_E To VI_BL_DIRECTORY_E
  432. p_clsSizer.AddControl txtValue(intIndex)
  433. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = fraSKU
  434. Next
  435. p_clsSizer.AddControl txtValue(VI_VENDOR_STRING_E)
  436. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = fraSKU
  437. p_clsSizer.ReferenceDimension(DIM_TOP_E) = DIM_BOTTOM_E
  438. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = Me
  439. p_clsSizer.AddControl lbl(VI_VENDOR_STRING_E)
  440. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = txtValue(VI_VENDOR_STRING_E)
  441. p_clsSizer.AddControl SSTab
  442. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = Me
  443. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = Me
  444. For intIndex = XI_PKG_DESC_E To XI_HHT_E
  445. p_clsSizer.AddControl txtXML(intIndex)
  446. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = SSTab
  447. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = SSTab
  448. p_clsSizer.AddControl WebBrowser(intIndex)
  449. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = SSTab
  450. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = SSTab
  451. Next
  452. p_clsSizer.AddControl cmdSave
  453. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = Me
  454. p_clsSizer.ReferenceDimension(DIM_TOP_E) = DIM_HEIGHT_E
  455. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = Me
  456. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_WIDTH_E
  457. p_clsSizer.AddControl cmdClose
  458. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = cmdSave
  459. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = cmdSave
  460. ' blnInfoSet = True
  461. End Sub