vbAccelerator - Contents of code file: frmEvents.frm

VERSION 5.00
Object = "{A3A35BDB-3B6A-46F3-B662-08B8F72ECD03}#5.0#0"; "vbalTreeViewLib.ocx"
Begin VB.Form frmEvents 
   Caption         =   "Events"
   ClientHeight    =   3735
   ClientLeft      =   7500
   ClientTop       =   2955
   ClientWidth     =   3525
   LinkTopic       =   "Form1"
   ScaleHeight     =   3735
   ScaleWidth      =   3525
   Begin vbalTreeViewLib.vbalTreeView tvwEvents 
      Height          =   3495
      Left            =   60
      TabIndex        =   0
      Top             =   60
      Width           =   2415
      _ExtentX        =   4260
      _ExtentY        =   6165
      FullRowSelect   =   -1  'True
      Style           =   1
   End
End
Attribute VB_Name = "frmEvents"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private m_lId As Long

Private Function NewLogKey() As String
   m_lId = m_lId + 1
   NewLogKey = "C" & m_lId
End Function

Private Function GetRootNode(ctl As Control) As cTreeViewNode
   If (tvwEvents.Nodes.Exists(ctl.Name)) Then
      Set GetRootNode = tvwEvents.Nodes(ctl.Name)
   Else
      Set GetRootNode = tvwEvents.Nodes.Add(, etvwChild, ctl.Name, ctl.Name)
   End If
End Function

Public Sub LogEvent(ctl As Control, ByVal sEventName As String, ByVal sParams
 As String)
Dim nodRoot As cTreeViewNode
   Set nodRoot = GetRootNode(ctl)
Dim nodLog As cTreeViewNode
   Set nodLog = nodRoot.children.Add(, etvwChild, NewLogKey(), sEventName &
    IIf(Len(sParams) > 0, " (" & sParams & ")", ""))
   nodLog.Selected = True
   nodLog.EnsureVisible
End Sub

Private Sub Form_Resize()
   On Error Resume Next
   tvwEvents.Move tvwEvents.left, tvwEvents.tOp, _
      Me.ScaleWidth - tvwEvents.left * 2, _
      Me.ScaleHeight - tvwEvents.tOp * 2
End Sub