home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
- Begin VB.UserControl DictTreeView
- ClientHeight = 3600
- ClientLeft = 0
- ClientTop = 0
- ClientWidth = 4800
- ScaleHeight = 3600
- ScaleWidth = 4800
- Begin ComctlLib.TreeView TV
- Height = 3015
- Left = 0
- TabIndex = 0
- Top = 0
- Width = 2145
- _ExtentX = 3784
- _ExtentY = 5318
- _Version = 327682
- HideSelection = 0 'False
- Indentation = 529
- LabelEdit = 1
- PathSeparator = "."
- Sorted = -1 'True
- Style = 7
- ImageList = "ImageList3"
- Appearance = 1
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 204
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin ComctlLib.ImageList ImageList3
- Left = 4080
- Top = 2820
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 16777215
- _Version = 327682
- BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
- NumListImages = 4
- BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "DictTreeView.ctx":0000
- Key = ""
- EndProperty
- BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "DictTreeView.ctx":031A
- Key = ""
- EndProperty
- BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "DictTreeView.ctx":0634
- Key = ""
- EndProperty
- BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "DictTreeView.ctx":072E
- Key = ""
- EndProperty
- EndProperty
- End
- End
- Attribute VB_Name = "DictTreeView"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = False
- Option Explicit
-
- Const iiGroup = 1
- Const iiGroupSelected = 1
- Const iiGroupExpanded = 2
-
- Dim mPath As String
-
- Public Event PathChanged(ByVal Path As String)
-
- Private Sub LoadLevel(Node As Node)
- Dim I As TIDICTIONARYLib.Item, N As Node
- For Each I In Dict
- If I.IsDictionary Then
- Set N = TV.Nodes.Add(Node, tvwChild, "@." & I.Path, I.Name, iiGroup, iiGroupSelected)
- I.Open
- LoadLevel N
- Dict.Close
- End If
- Next
- End Sub
-
- Public Sub RefreshView()
- Dim R As Node
- TV.Nodes.Clear: Set R = TV.Nodes.Add(, , "@", "@", iiGroup, iiGroupSelected)
- Dict.GoRoot
- LoadLevel R
- R.Expanded = True
- End Sub
-
- Private Sub TV_NodeClick(ByVal Node As ComctlLib.Node)
- RaiseEvent PathChanged(Node.FullPath)
- End Sub
-
- Private Sub UserControl_Resize()
- On Error Resume Next
- TV.Move ScaleLeft, ScaleTop, ScaleWidth, ScaleHeight
- End Sub
-
- Public Property Get Path() As String
- Path = mPath
- End Property
-
- Public Sub SelectItem(ByVal Path As String, ByVal ItemName As String)
- Dim Node As Node
- If ItemName = ".." Then
- Set Node = TV.Nodes.Item(Path).Parent
- Else
- Set Node = TV.Nodes.Item(Path & "." & ItemName)
- End If
- Node.EnsureVisible
- Node.Selected = True
- mPath = Node.FullPath
- End Sub
-