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.

736 lines
22 KiB

  1. '//+----------------------------------------------------------------------------
  2. '//
  3. '// File: loadreg.frm
  4. '//
  5. '// Module: pbadmin.exe
  6. '//
  7. '// Synopsis: The regions dialog.
  8. '//
  9. '// Copyright (c) 1997-1999 Microsoft Corporation
  10. '//
  11. '// Author: quintinb Created Header 09/02/99
  12. '//
  13. '//+----------------------------------------------------------------------------
  14. VERSION 5.00
  15. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  16. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
  17. Begin VB.Form frmLoadRegion
  18. BorderStyle = 3 'Fixed Dialog
  19. ClientHeight = 4665
  20. ClientLeft = 135
  21. ClientTop = 1545
  22. ClientWidth = 4485
  23. Icon = "LoadReg.frx":0000
  24. LinkTopic = "Form1"
  25. LockControls = -1 'True
  26. MaxButton = 0 'False
  27. MinButton = 0 'False
  28. PaletteMode = 1 'UseZOrder
  29. ScaleHeight = 4665
  30. ScaleWidth = 4485
  31. ShowInTaskbar = 0 'False
  32. WhatsThisButton = -1 'True
  33. WhatsThisHelp = -1 'True
  34. Begin VB.CommandButton cmbEdit
  35. Caption = "edit"
  36. Height = 345
  37. Left = 3120
  38. TabIndex = 2
  39. Top = 630
  40. WhatsThisHelpID = 90010
  41. Width = 1215
  42. End
  43. Begin VB.CommandButton cmbDelete
  44. Caption = "del"
  45. Height = 345
  46. Left = 3120
  47. TabIndex = 3
  48. Top = 1125
  49. WhatsThisHelpID = 90020
  50. Width = 1215
  51. End
  52. Begin VB.CommandButton cmbregsave
  53. Caption = "add"
  54. Height = 330
  55. Left = 3120
  56. TabIndex = 1
  57. Top = 120
  58. WhatsThisHelpID = 90000
  59. Width = 1215
  60. End
  61. Begin VB.Frame Frame1
  62. Height = 60
  63. Left = 3120
  64. TabIndex = 7
  65. Top = 1680
  66. Width = 1245
  67. End
  68. Begin VB.CommandButton cmbOK
  69. Caption = "ok"
  70. Height = 345
  71. Left = 3120
  72. TabIndex = 5
  73. Top = 3720
  74. WhatsThisHelpID = 10030
  75. Width = 1215
  76. End
  77. Begin VB.CommandButton cmbCancel
  78. Cancel = -1 'True
  79. Caption = "cancel"
  80. Height = 345
  81. Left = 3120
  82. TabIndex = 6
  83. Top = 4200
  84. WhatsThisHelpID = 10040
  85. Width = 1230
  86. End
  87. Begin VB.CommandButton loadReg
  88. Caption = "import"
  89. Height = 375
  90. Left = 3120
  91. TabIndex = 4
  92. Top = 1920
  93. WhatsThisHelpID = 90030
  94. Width = 1215
  95. End
  96. Begin ComctlLib.ListView RegionList
  97. Height = 4455
  98. Left = 120
  99. TabIndex = 0
  100. Top = 105
  101. WhatsThisHelpID = 90040
  102. Width = 2835
  103. _ExtentX = 5001
  104. _ExtentY = 7858
  105. View = 3
  106. LabelWrap = -1 'True
  107. HideSelection = 0 'False
  108. _Version = 327682
  109. ForeColor = -2147483640
  110. BackColor = -2147483643
  111. Appearance = 1
  112. BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
  113. Name = "MS Sans Serif"
  114. Size = 8.25
  115. Charset = 0
  116. Weight = 400
  117. Underline = 0 'False
  118. Italic = 0 'False
  119. Strikethrough = 0 'False
  120. EndProperty
  121. NumItems = 1
  122. BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
  123. Key = ""
  124. Object.Tag = ""
  125. Text = "region"
  126. Object.Width = 4022
  127. EndProperty
  128. End
  129. Begin MSComDlg.CommonDialog commonregion
  130. Left = 3480
  131. Top = 2640
  132. _ExtentX = 847
  133. _ExtentY = 847
  134. _Version = 393216
  135. DialogTitle = "Open Region File"
  136. Filter = "*.pbr Region file| *.pbr"
  137. End
  138. End
  139. Attribute VB_Name = "frmLoadRegion"
  140. Attribute VB_GlobalNameSpace = False
  141. Attribute VB_Creatable = False
  142. Attribute VB_PredeclaredId = True
  143. Attribute VB_Exposed = False
  144. Option Explicit
  145. Dim intMaxRegionID As Integer
  146. Dim EditList As EditLists
  147. Dim bEditMode As Boolean
  148. Dim nNewOne As Integer
  149. Dim FirstEntry As Boolean
  150. Dim dbDataRegion As Database
  151. Dim rsDataRegion As Recordset
  152. Function FillRegionList()
  153. On Error GoTo ErrTrap
  154. Dim strTemp As String
  155. Dim intRowID As Integer
  156. Dim itmX As ListItem
  157. RegionList.ListItems.Clear
  158. RegionList.Sorted = False
  159. intMaxRegionID = 0
  160. If rsDataRegion.BOF = False Then
  161. rsDataRegion.MoveFirst
  162. Do While Not rsDataRegion.EOF
  163. Set itmX = RegionList.ListItems.Add()
  164. intRowID = rsDataRegion!ID
  165. With itmX
  166. .Text = rsDataRegion!Region
  167. strTemp = "Key:" & intRowID
  168. .Key = strTemp
  169. End With
  170. If intMaxRegionID < intRowID Then
  171. intMaxRegionID = intRowID
  172. End If
  173. rsDataRegion.MoveNext
  174. If rsDataRegion.AbsolutePosition Mod 40 = 0 Then DoEvents
  175. Loop
  176. End If
  177. RegionList.Sorted = True
  178. Exit Function
  179. ErrTrap:
  180. Exit Function
  181. End Function
  182. Function LoadRegionRes()
  183. On Error GoTo LoadErr
  184. Me.Caption = LoadResString(2003) & " " & gsCurrentPB
  185. RegionList.ColumnHeaders(1).Text = LoadResString(2005)
  186. cmbregsave.Caption = LoadResString(1011)
  187. cmbEdit.Caption = LoadResString(1012)
  188. cmbDelete.Caption = LoadResString(1013)
  189. loadReg.Caption = LoadResString(2004)
  190. cmbOK.Caption = LoadResString(1002)
  191. cmbCancel.Caption = LoadResString(1003)
  192. ' set fonts
  193. SetFonts Me
  194. RegionList.Font.Charset = gfnt.Charset
  195. RegionList.Font.Name = gfnt.Name
  196. RegionList.Font.Size = gfnt.Size
  197. On Error GoTo 0
  198. Exit Function
  199. LoadErr:
  200. Exit Function
  201. End Function
  202. Function SaveEdit(ByVal Action As String, ByVal ID As Integer, ByVal NewRegion As String, Optional ByVal OldRegion As String) As Integer
  203. ' populate the array - for performance reasons
  204. Dim intX As Integer
  205. Dim bFound As Boolean
  206. On Error GoTo SaveErr
  207. bFound = False
  208. If Action = "U" Or Action = "D" Then
  209. intX = 1
  210. Do While intX <= EditList.Count
  211. If ID = EditList.ID(intX) Then
  212. ' this handles Adds that have been Updated before being
  213. ' written to the db.
  214. If Action = "U" And EditList.Action(intX) = "A" Then
  215. Action = "A"
  216. 'If EditList.Region(intX) = "" And _
  217. EditList.Action(intX) = "A" Then Action = "A"
  218. End If
  219. bFound = True
  220. Exit Do
  221. End If
  222. intX = intX + 1
  223. Loop
  224. End If
  225. If Not bFound Then
  226. intX = EditList.Count + 1
  227. EditList.Count = intX
  228. ReDim Preserve EditList.Action(intX)
  229. ReDim Preserve EditList.ID(intX)
  230. ReDim Preserve EditList.Region(intX)
  231. ReDim Preserve EditList.OldRegion(intX)
  232. End If
  233. EditList.Action(intX) = Action
  234. EditList.ID(intX) = ID
  235. EditList.Region(intX) = NewRegion
  236. If Action = "U" Then
  237. EditList.OldRegion(intX) = OldRegion
  238. End If
  239. On Error GoTo 0
  240. Exit Function
  241. SaveErr:
  242. Exit Function
  243. End Function
  244. Private Sub cmbCancel_Click()
  245. Unload Me
  246. End Sub
  247. Private Sub cmbDelete_Click()
  248. Dim intX As Integer
  249. On Error Resume Next
  250. intX = MsgBox(LoadResString(6024), vbQuestion + vbYesNo + vbDefaultButton2)
  251. If intX = 6 Then
  252. SaveEdit "D", _
  253. Right(RegionList.SelectedItem.Key, Len(RegionList.SelectedItem.Key) - 4), _
  254. RegionList.SelectedItem.Text
  255. RegionList.ListItems.Remove RegionList.SelectedItem.Key
  256. End If
  257. RegionList.SetFocus
  258. End Sub
  259. Private Sub cmbEdit_Click()
  260. On Error GoTo ErrTrap
  261. RegionList.SetFocus
  262. RegionList.StartLabelEdit
  263. Exit Sub
  264. ErrTrap:
  265. Exit Sub
  266. End Sub
  267. Private Sub cmbOK_Click()
  268. Dim rsTemp As Recordset
  269. Dim intX, intY As Integer
  270. Dim intRegionID As Integer
  271. Dim itemY As ListItem
  272. Dim bUpdates As Boolean
  273. Dim PerformedDelete As Boolean
  274. Dim rsTempPop As Recordset, rsTempDelta As Recordset
  275. Dim i As Integer, deltnum As Integer
  276. Dim deltasql As String, popsql As String
  277. PerformedDelete = False
  278. If bEditMode Then
  279. RegionList.SetFocus
  280. SendKeys "{ENTER}", True
  281. RegionList_AfterLabelEdit 1, RegionList.SelectedItem.Text
  282. 'bEditMode = False
  283. End If
  284. On Error GoTo SaveErr
  285. Me.MousePointer = 11
  286. frmLoadRegion.Enabled = False
  287. bUpdates = False
  288. Set rsTemp = gsyspb.OpenRecordset("Region", dbOpenDynaset)
  289. 'Debug.Print ("editlist.count = " & EditList.Count)
  290. For intX = 1 To EditList.Count
  291. Select Case EditList.Action(intX)
  292. Case "D" 'delete
  293. gsyspb.Execute "Delete from Region Where RegionID =" & EditList.ID(intX)
  294. popsql = "Select * from DialUpPort where RegionID = " & EditList.ID(intX)
  295. Set rsTempPop = gsyspb.OpenRecordset(popsql, dbOpenDynaset)
  296. If Not (rsTempPop.BOF And rsTempPop.EOF) Then
  297. rsTempPop.MoveFirst
  298. Do Until rsTempPop.EOF
  299. rsTempPop.Edit
  300. rsTempPop!RegionID = 0
  301. rsTempPop.Update
  302. If rsTempPop!status = 1 Then
  303. Set rsTempDelta = gsyspb.OpenRecordset("Select * from Delta order by DeltaNum", dbOpenDynaset)
  304. If rsTempDelta.RecordCount = 0 Then
  305. deltnum = 1
  306. Else
  307. rsTempDelta.MoveLast
  308. deltnum = rsTempDelta!deltanum
  309. If deltnum > 6 Then
  310. deltnum = deltnum - 1
  311. End If
  312. End If
  313. For i = 1 To deltnum
  314. deltasql = "Select * from delta where DeltaNum = " & i & _
  315. " AND AccessNumberId = '" & rsTempPop!AccessNumberId & "' " & _
  316. " order by DeltaNum"
  317. Set rsTempDelta = gsyspb.OpenRecordset(deltasql, dbOpenDynaset)
  318. If Not (rsTempDelta.BOF And rsTempDelta.EOF) Then
  319. rsTempDelta.Edit
  320. Else
  321. rsTempDelta.AddNew
  322. rsTempDelta!deltanum = i
  323. rsTempDelta!AccessNumberId = rsTempPop!AccessNumberId
  324. End If
  325. If rsTempPop!status = 1 Then
  326. rsTempDelta!CountryNumber = rsTempPop!CountryNumber
  327. rsTempDelta!AreaCode = rsTempPop!AreaCode
  328. rsTempDelta!AccessNumber = rsTempPop!AccessNumber
  329. rsTempDelta!MinimumSpeed = rsTempPop!MinimumSpeed
  330. rsTempDelta!MaximumSpeed = rsTempPop!MaximumSpeed
  331. rsTempDelta!RegionID = rsTempPop!RegionID
  332. rsTempDelta!CityName = rsTempPop!CityName
  333. rsTempDelta!ScriptId = rsTempPop!ScriptId
  334. rsTempDelta!Flags = rsTempPop!Flags
  335. rsTempDelta.Update
  336. End If
  337. Next i
  338. End If
  339. rsTempPop.MoveNext
  340. Loop
  341. End If
  342. LogRegionDelete EditList.Region(intX), EditList.Region(intX) & ";" & EditList.ID(intX)
  343. PerformedDelete = True
  344. bUpdates = True
  345. Case "U" 'update
  346. If EditList.Region(intX) <> "" Then
  347. gsyspb.Execute "Update Region set RegionDesc='" & EditList.Region(intX) & _
  348. "' Where RegionID =" & EditList.ID(intX)
  349. LogRegionEdit EditList.OldRegion(intX), EditList.Region(intX) & ";" & EditList.ID(intX)
  350. bUpdates = True
  351. End If
  352. Case "A" 'add
  353. If EditList.Region(intX) <> "" Then
  354. With rsTemp
  355. .AddNew
  356. !RegionID = EditList.ID(intX)
  357. !RegionDesc = EditList.Region(intX)
  358. .Update
  359. End With
  360. LogRegionAdd EditList.Region(intX), EditList.Region(intX) & ";" & EditList.ID(intX)
  361. End If
  362. End Select
  363. If intX Mod 5 = 0 Then DoEvents
  364. Next
  365. If PerformedDelete Then
  366. If Not ReIndexRegions(gsyspb) Then GoTo SaveErr
  367. End If
  368. rsTemp.Close
  369. If bUpdates Then frmMain.FillPOPList
  370. frmLoadRegion.Enabled = True
  371. Me.MousePointer = 0
  372. On Error GoTo 0
  373. Unload Me
  374. Exit Sub
  375. SaveErr:
  376. frmLoadRegion.Enabled = True
  377. Me.MousePointer = 0
  378. MsgBox LoadResString(6056) & Chr(13) & Chr(13) & Err.Description, vbExclamation
  379. Exit Sub
  380. 'GsysPb.Execute "Delete from Region", dbFailOnError
  381. 'Set rsTemp = GsysPb.OpenRecordset("Region", dbOpenDynaset)
  382. 'For intX = 1 To RegionList.ListItems.Count
  383. ' Set itemY = RegionList.ListItems(intX)
  384. ' With rsTemp
  385. ' .AddNew
  386. ' !regionID = Right(itemY.Key, Len(itemY.Key) - 4)
  387. ' !regiondesc = Left$(itemY.Text, 30)
  388. ' .Update
  389. ' End With
  390. ' If intX Mod 25 = 0 Then DoEvents
  391. 'Next
  392. 'rsTemp.Close
  393. 'Set rsTemp = Nothing
  394. 'check for deletes
  395. 'Set rsTemp = GsysPb.OpenRecordset("Region", dbOpenDynaset)
  396. 'If Not (rsTemp.BOF And rsTemp.EOF) Then
  397. ' rsTemp.MoveLast
  398. ' rsTemp.MoveFirst
  399. ' For intX = 1 To rsTemp.RecordCount
  400. ' intRegionID = rsTemp!regionID
  401. ' intY = 1
  402. ' Do While intY <= RegionList.ListItems.Count
  403. ' Set itemY = RegionList.ListItems(intY)
  404. ' If Val(Right(itemY.Key, Len(itemY.Key) - 4)) = intRegionID Then
  405. ' Exit Do
  406. ' End If
  407. ' intY = intY + 1
  408. ' Loop
  409. ' If intY > RegionList.ListItems.Count Then ' no find - didn't fall out of loop early
  410. 'clear region id
  411. ' GsysPb.Execute "Update DialUpPort set RegionID = 0 WHERE RegionID =" & intRegionID
  412. ' GsysPb.Execute "Update Delta set RegionID = 0 WHERE RegionID ='" & intRegionID & "'"
  413. ' End If
  414. ' rsTemp.MoveNext
  415. ' If intX Mod 25 = 0 Then DoEvents
  416. ' Next
  417. 'End If
  418. 'rsTemp.Close
  419. 'Set itemY = Nothing
  420. End Sub
  421. Private Sub cmbregsave_Click()
  422. Dim itmX As ListItem
  423. Dim strNewKey, strOldKey, strOldText, strNewRegion As String
  424. On Error GoTo ErrTrap
  425. If bEditMode Then
  426. RegionList.SetFocus
  427. SendKeys "{ENTER}", True
  428. bEditMode = False
  429. End If
  430. strNewRegion = LoadResString(2006)
  431. Set itmX = RegionList.FindItem(strNewRegion, lvwText)
  432. If Not itmX Is Nothing Then
  433. itmX.Selected = True
  434. Set RegionList.SelectedItem = RegionList.ListItems(itmX.Key)
  435. RegionList.SetFocus
  436. itmX.EnsureVisible
  437. Exit Sub
  438. Else
  439. strNewKey = "Key:" & intMaxRegionID + 1
  440. 'If RegionList.SelectedItem Is Nothing Then
  441. Set itmX = RegionList.ListItems.Add()
  442. With itmX
  443. .Text = strNewRegion
  444. .Key = strNewKey
  445. .Selected = True
  446. End With
  447. Set RegionList.SelectedItem = RegionList.ListItems(itmX.Key)
  448. RegionList.SetFocus
  449. itmX.EnsureVisible
  450. 'Else 'jump thru hoops to make listview work right.
  451. ' With RegionList.SelectedItem
  452. ' strOldText = .Text
  453. ' .Text = strNewRegion
  454. ' strOldKey = .Key
  455. ' .Key = strNewKey
  456. ' End With
  457. ' Set itmX = RegionList.ListItems.Add()
  458. ' With itmX
  459. ' .Text = strOldText
  460. ' .Key = strOldKey
  461. ' End With
  462. 'End If
  463. SaveEdit "A", intMaxRegionID + 1, "" ' save an empty region to key on later
  464. intMaxRegionID = intMaxRegionID + 1
  465. End If
  466. Set RegionList.SelectedItem = RegionList.ListItems(itmX.Key)
  467. RegionList.SetFocus
  468. RegionList.StartLabelEdit
  469. ' The second StartLabelEdit causes this to work ???
  470. RegionList.StartLabelEdit
  471. On Error GoTo 0
  472. Exit Sub
  473. ErrTrap:
  474. Me.MousePointer = 0
  475. Exit Sub
  476. End Sub
  477. Private Sub Form_Activate()
  478. Screen.MousePointer = 11
  479. Me.Enabled = False
  480. FillRegionList
  481. Me.Enabled = True
  482. Screen.MousePointer = 0
  483. If RegionList.ListItems.Count = 0 Then
  484. RegionList.TabStop = False
  485. End If
  486. End Sub
  487. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  488. Dim ShiftDown
  489. ShiftDown = (Shift And vbShiftMask) > 0
  490. If KeyCode = 222 And ShiftDown Then
  491. Beep
  492. KeyCode = 0
  493. End If
  494. End Sub
  495. Private Sub Form_KeyPress(KeyAscii As Integer)
  496. CheckChar KeyAscii
  497. End Sub
  498. Private Sub Form_Load()
  499. On Error GoTo LoadErr
  500. bEditMode = False
  501. CenterForm Me, Screen
  502. EditList.Count = 0
  503. Me.Enabled = False
  504. LoadRegionRes
  505. 'new
  506. Set dbDataRegion = OpenDatabase(gsCurrentPBPath)
  507. Set rsDataRegion = dbDataRegion.OpenRecordset("Select RegionDesc as Region, RegionID as ID from Region order by RegionDesc")
  508. Me.Enabled = True
  509. Screen.MousePointer = 0
  510. FirstEntry = True
  511. Exit Sub
  512. LoadErr:
  513. Me.Enabled = True
  514. Screen.MousePointer = 0
  515. Exit Sub
  516. End Sub
  517. Private Sub Form_Unload(Cancel As Integer)
  518. rsDataRegion.Close
  519. dbDataRegion.Close
  520. End Sub
  521. Private Sub loadReg_Click()
  522. Dim fileopen As String
  523. Dim maxindex As Integer
  524. Dim indexcount, intY As Integer
  525. Dim Count As Integer
  526. Dim itmX As ListItem
  527. Dim strTemp As String
  528. Dim bFlag As Boolean
  529. On Error GoTo ErrTrap
  530. maxindex = 200
  531. ReDim Region(maxindex) As String
  532. commonregion.Filter = LoadResString(2007)
  533. commonregion.FilterIndex = 1
  534. commonregion.Flags = cdlOFNHideReadOnly
  535. commonregion.ShowOpen
  536. fileopen = commonregion.FileName
  537. If fileopen = "" Then Exit Sub
  538. Open fileopen For Input Access Read As #1
  539. If EOF(1) Then
  540. Close #1
  541. Exit Sub
  542. End If
  543. Input #1, Count
  544. indexcount = 1
  545. Do While indexcount <= Count And Not EOF(1)
  546. Input #1, Region(indexcount)
  547. Region(indexcount) = Left(Trim(Region(indexcount)), 30)
  548. If Region(indexcount) <> "" Then
  549. indexcount = indexcount + 1
  550. End If
  551. Loop
  552. Close #1
  553. Count = indexcount - 1
  554. For indexcount = 1 To Count
  555. ' check for dups
  556. intY = 1
  557. bFlag = False
  558. Do While intY <= RegionList.ListItems.Count
  559. If LCase(RegionList.ListItems(intY)) = LCase(Region(indexcount)) Then
  560. bFlag = True
  561. Exit Do
  562. End If
  563. intY = intY + 1
  564. Loop
  565. ' add if not a dup
  566. If Not bFlag Then
  567. Set itmX = RegionList.ListItems.Add()
  568. With itmX
  569. .Text = Left(Region(indexcount), 30)
  570. strTemp = "Key:" & intMaxRegionID + 1
  571. .Key = strTemp
  572. End With
  573. SaveEdit "A", intMaxRegionID + 1, Left(Region(indexcount), 30)
  574. intMaxRegionID = intMaxRegionID + 1
  575. End If
  576. Next indexcount
  577. RegionList.Sorted = True
  578. Exit Sub
  579. ErrTrap:
  580. If Err.Number = 62 Or Err.Number = 3163 Then
  581. Exit Sub
  582. Else
  583. Exit Sub
  584. End If
  585. End Sub
  586. Private Sub RegionList_BeforeLabelEdit(Cancel As Integer)
  587. 'Debug.Print ("BeforeLabelEdit")
  588. bEditMode = True
  589. 'Debug.Print ("working on " & RegionList.SelectedItem.index)
  590. nNewOne = RegionList.SelectedItem.index
  591. End Sub
  592. ' This doesn't get called if no changes are made to the default text
  593. '
  594. Private Sub RegionList_AfterLabelEdit(Cancel As Integer, NewString As String)
  595. 'Debug.Print ("AfterLabelEdit")
  596. Dim itmX As ListItem
  597. bEditMode = False
  598. If Trim(NewString) = "" Then
  599. Cancel = True
  600. RegionList.StartLabelEdit
  601. Exit Sub
  602. End If
  603. ' null indicates the user canceled the edit
  604. If Not IsNull(NewString) Then
  605. NewString = Left(Trim(NewString), 30)
  606. ' check for dups
  607. Set itmX = RegionList.FindItem(NewString, lvwText)
  608. If Not itmX Is Nothing Then
  609. If itmX.index <> nNewOne Then
  610. MsgBox LoadResString(6025), vbExclamation
  611. Cancel = True
  612. RegionList.StartLabelEdit
  613. Exit Sub
  614. End If
  615. End If
  616. 'Debug.Print (NewString)
  617. Set itmX = RegionList.SelectedItem
  618. 'Debug.Print (itmX.Key)
  619. SaveEdit "U", Right(itmX.Key, Len(itmX.Key) - 4), NewString, itmX
  620. RegionList.SortKey = 0
  621. RegionList.Sorted = True
  622. End If
  623. End Sub
  624. Private Sub RegionList_ItemClick(ByVal Item As ComctlLib.ListItem)
  625. If bEditMode Then
  626. RegionList_AfterLabelEdit 1, RegionList.ListItems.Item(nNewOne).Text
  627. End If
  628. End Sub
  629. Private Sub RegionList_LostFocus()
  630. If RegionList.ListItems.Count > 0 Then
  631. RegionList.TabStop = True
  632. End If
  633. End Sub