vbAccelerator - Contents of code file: frmEvents.frm
VERSION 5.00
Object = "{CA5A8E1E-C861-4345-8FF8-EF0A27CD4236}#1.0#0"; "vbalTreeView6.ocx"
Begin VB.Form frmEvents
Caption = "Events"
ClientHeight = 3735
ClientLeft = 7500
ClientTop = 2955
ClientWidth = 3525
LinkTopic = "Form1"
ScaleHeight = 3735
ScaleWidth = 3525
Begin vbalTreeViewLib6.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
|
|