VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "TreeAdapter"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Private Tree As TreeView

Public Sub init(tr As TreeView)
  Set Tree = tr
  'Tree.LineStyle = tvwTreeLines
End Sub

Public Sub addText(sw As Swimmer)
  Dim scnt As String, tNode As Node, index As Integer
  Dim cNode As Node
  'Dodaj węzeł nadrzędny
  Set tNode = Tree.Nodes.Add(, tvwNext, "r" & _
  sw.getName, sw.getName)
  Tree.Nodes.Add "r" + sw.getName, tvwChild, , Str$(sw.getTime)
  'Set tNode = Tree.Nodes.Add()
  'tNode.Text = sw.getName
  tNode.Expanded = True
  index = tNode.index     'Pobierz jego indeks
  'Dodaj węzeł podrzędny
  'Set cNode = Tree.Nodes.Add(index, tvwChild)
  'cNode.Text = Str$(sw.getTime)
End Sub
