VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "Mscomctl.ocx"
Begin VB.Form frmTestResults 
   Caption         =   "View Test Results"
   ClientHeight    =   3480
   ClientLeft      =   4710
   ClientTop       =   2445
   ClientWidth     =   4590
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   HelpContextID   =   1000
   Icon            =   "frmTestResults.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MDIChild        =   -1  'True
   ScaleHeight     =   3480
   ScaleWidth      =   4590
   Begin VB.CheckBox chkDisplay 
      Caption         =   "IC Test Messages"
      Height          =   225
      HelpContextID   =   1000
      Index           =   0
      Left            =   120
      TabIndex        =   0
      Top             =   30
      Width           =   1620
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   3330
      Top             =   2820
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      UseMaskColor    =   0   'False
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   12
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmTestResults.frx":030A
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmTestResults.frx":075C
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmTestResults.frx":0BAE
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmTestResults.frx":1000
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmTestResults.frx":1452
            Key             =   ""
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmTestResults.frx":15AC
            Key             =   ""
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmTestResults.frx":1706
            Key             =   ""
         EndProperty
         BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmTestResults.frx":1B58
            Key             =   ""
         EndProperty
         BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmTestResults.frx":1FAA
            Key             =   ""
         EndProperty
         BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmTestResults.frx":23FC
            Key             =   ""
         EndProperty
         BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmTestResults.frx":284E
            Key             =   ""
         EndProperty
         BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmTestResults.frx":2CA0
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.ListView lvResults 
      Height          =   3105
      Left            =   45
      TabIndex        =   1
      Top             =   300
      Width           =   4440
      _ExtentX        =   7832
      _ExtentY        =   5477
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      FullRowSelect   =   -1  'True
      _Version        =   393217
      Icons           =   "ImageList1"
      SmallIcons      =   "ImageList1"
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Courier New"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      NumItems        =   0
   End
End
Attribute VB_Name = "frmTestResults"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Const Module_Name                       As String = "frmTestResults"
Public Sub ResultLogEvent(ByVal sDescription As String, ByVal nIcon As Integer, ByVal nSeq As Integer)

    Dim bInclude                        As Boolean
    Dim nCount                          As Integer
    Dim sSeq                            As String
    Dim sKey                            As String
    Dim itx                             As ListItem
    
    Const PROC_NAME                     As String = "LogEvent"
    
    On Error GoTo ErrorHandler
    
    bInclude = True
    If chkDisplay(0).Value = False Then
        If nSeq Or nIcon = 12 Then
            bInclude = False
        End If
    End If
            
    If bInclude = True Then
        nCount = lvResults.ListItems.Count
        If nSeq Then
            sSeq = Format$(nSeq, "0000")
        Else
            sSeq = ""
        End If
        
        sKey = "L" & Format$(nCount)
        Set itx = lvResults.ListItems.Add(, sKey, sSeq)
        
        itx.SubItems(1) = sDescription
        
        If nIcon Then
            itx.SmallIcon = nIcon
        End If
            
        Set itx = Nothing ' Tidy
                    
        lvResults.ListItems(sKey).EnsureVisible
    End If
    
    Exit Sub
    
ErrorHandler:
    ErrorRoutine Module_Name, PROC_NAME, Err
End Sub

Public Sub Reset()
' Resets the ListView control
    Const PROC_NAME                         As String = "Reset"

    On Error GoTo ErrorHandler


    With lvResults
        .ListItems.Clear
        .ColumnHeaders.Clear
        .ColumnHeaders.Add , "H0", "", 800
        .ColumnHeaders.Add , "H1", "Description", .Width - 1100
    End With
    
    Exit Sub
    
ErrorHandler:
    ErrorRoutine Module_Name, PROC_NAME, Err
End Sub














Private Sub chkDisplay_Click(Index As Integer)

    SaveSetting App.Title, "Defaults", "DisplayOptions" & Format$(Index), chkDisplay(Index).Value

End Sub

Private Sub Form_Load()
    
    Dim F                           As Integer
    Const PROC_NAME                 As String = "Form_Load"
    
    On Error GoTo ErrorHandler
    

    For F = 0 To chkDisplay.Count - 1
        chkDisplay(F).Value = GetSetting(App.Title, "Defaults", "DisplayOptions" & Format$(F), "1")
    Next F
    
    Call Reset
    
    RecoverFormLoadPosition Me, False
    
    Exit Sub
    
ErrorHandler:
    ErrorRoutine Module_Name, PROC_NAME, Err
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    
    ' Save the forms current position
    If Me.WindowState <> vbMinimized Then
        SaveSetting App.Title, "FormPositions", Me.Name, Format$(Me.Width) & "," & Format$(Me.Height) & "," & Format$(Me.Top) & "," & Format$(Me.Left)
    End If
    
    Me.Hide

End Sub


Private Sub Form_Resize()

    If Me.WindowState <> vbMinimized Then
        If Me.Width < 500 Then
            Me.Width = 500
        End If
        If Me.Height < 700 Then
            Me.Height = 700
        End If
        
        With lvResults
            .Width = Me.Width - 200
            .Height = Me.Height - 800
                                            
            .ColumnHeaders(2).Width = .Width - 1100
        End With
    End If
    
End Sub


