VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form frmConfig 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Configuration"
   ClientHeight    =   4020
   ClientLeft      =   1800
   ClientTop       =   1785
   ClientWidth     =   6525
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   HelpContextID   =   100
   Icon            =   "frmConfig.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4020
   ScaleWidth      =   6525
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton cmdDefault 
      Caption         =   "&Default"
      Enabled         =   0   'False
      Height          =   330
      Left            =   2580
      TabIndex        =   54
      Top             =   3600
      Width           =   1155
   End
   Begin TabDlg.SSTab SSTab1 
      Height          =   3420
      Left            =   90
      TabIndex        =   0
      Top             =   105
      Width           =   6345
      _ExtentX        =   11192
      _ExtentY        =   6033
      _Version        =   393216
      Style           =   1
      Tabs            =   5
      TabsPerRow      =   5
      TabHeight       =   520
      TabCaption(0)   =   "Communications"
      TabPicture(0)   =   "frmConfig.frx":000C
      Tab(0).ControlEnabled=   -1  'True
      Tab(0).Control(0)=   "Label12"
      Tab(0).Control(0).Enabled=   0   'False
      Tab(0).Control(1)=   "Frame1"
      Tab(0).Control(1).Enabled=   0   'False
      Tab(0).Control(2)=   "txtSetting(2)"
      Tab(0).Control(2).Enabled=   0   'False
      Tab(0).Control(3)=   "UpDown1"
      Tab(0).Control(3).Enabled=   0   'False
      Tab(0).ControlCount=   4
      TabCaption(1)   =   "Colours"
      TabPicture(1)   =   "frmConfig.frx":0028
      Tab(1).ControlEnabled=   0   'False
      Tab(1).Control(0)=   "Frame2"
      Tab(1).Control(1)=   "txtColor(8)"
      Tab(1).Control(2)=   "txtColor(7)"
      Tab(1).Control(3)=   "txtColor(6)"
      Tab(1).Control(4)=   "txtColor(5)"
      Tab(1).Control(5)=   "txtColor(4)"
      Tab(1).Control(6)=   "txtColor(3)"
      Tab(1).Control(7)=   "txtColor(2)"
      Tab(1).Control(8)=   "txtColor(1)"
      Tab(1).Control(9)=   "txtColor(0)"
      Tab(1).Control(10)=   "cdColour"
      Tab(1).ControlCount=   11
      TabCaption(2)   =   "Paths"
      TabPicture(2)   =   "frmConfig.frx":0044
      Tab(2).ControlEnabled=   0   'False
      Tab(2).Control(0)=   "cmdBrowse(0)"
      Tab(2).Control(1)=   "txtPath(0)"
      Tab(2).Control(2)=   "Label6"
      Tab(2).ControlCount=   3
      TabCaption(3)   =   "Settings"
      TabPicture(3)   =   "frmConfig.frx":0060
      Tab(3).ControlEnabled=   0   'False
      Tab(3).Control(0)=   "chkOptions(4)"
      Tab(3).Control(1)=   "chkOptions(3)"
      Tab(3).Control(2)=   "Frame3"
      Tab(3).Control(3)=   "chkOptions(2)"
      Tab(3).Control(4)=   "chkOptions(1)"
      Tab(3).Control(5)=   "txtSetting(0)"
      Tab(3).Control(6)=   "Label5"
      Tab(3).ControlCount=   7
      TabCaption(4)   =   "Logic Analyser"
      TabPicture(4)   =   "frmConfig.frx":007C
      Tab(4).ControlEnabled=   0   'False
      Tab(4).Control(0)=   "txtSetting(1)"
      Tab(4).Control(1)=   "Label11"
      Tab(4).ControlCount=   2
      Begin VB.CheckBox chkOptions 
         Caption         =   "Enabled Debug Mode"
         Height          =   195
         Index           =   4
         Left            =   -71055
         TabIndex        =   53
         Tag             =   "8"
         Top             =   840
         Width           =   2040
      End
      Begin MSComCtl2.UpDown UpDown1 
         Height          =   345
         HelpContextID   =   102
         Left            =   1815
         TabIndex        =   4
         Top             =   3015
         Width           =   240
         _ExtentX        =   423
         _ExtentY        =   609
         _Version        =   393216
         Value           =   1
         BuddyControl    =   "txtSetting(2)"
         BuddyDispid     =   196612
         BuddyIndex      =   2
         OrigLeft        =   1815
         OrigTop         =   3015
         OrigRight       =   2055
         OrigBottom      =   3360
         Max             =   9
         Min             =   1
         SyncBuddy       =   -1  'True
         BuddyProperty   =   65547
         Enabled         =   -1  'True
      End
      Begin VB.TextBox txtSetting 
         Height          =   285
         HelpContextID   =   102
         Index           =   2
         Left            =   1590
         MaxLength       =   1
         TabIndex        =   3
         Top             =   3045
         Width           =   225
      End
      Begin VB.TextBox txtSetting 
         Height          =   300
         HelpContextID   =   140
         Index           =   1
         Left            =   -73245
         MaxLength       =   4
         TabIndex        =   32
         Top             =   600
         Width           =   555
      End
      Begin VB.CheckBox chkOptions 
         Caption         =   "Allow Flashing Text"
         Height          =   195
         HelpContextID   =   130
         Index           =   3
         Left            =   -74835
         TabIndex        =   25
         Tag             =   "3"
         ToolTipText     =   "Prevents any text messages or warnings from flashing on the screen"
         Top             =   1095
         Width           =   1710
      End
      Begin VB.Frame Frame3 
         Caption         =   "Power Configuration Options"
         Height          =   1950
         Left            =   -74940
         TabIndex        =   44
         Top             =   1395
         Width           =   4305
         Begin VB.Frame Frame4 
            Caption         =   "DIP Switch Bank Size Fitted:"
            Height          =   810
            Left            =   75
            TabIndex        =   45
            Top             =   1050
            Width           =   4140
            Begin VB.CommandButton cmdPrintTemplate 
               Height          =   330
               HelpContextID   =   130
               Left            =   3660
               Picture         =   "frmConfig.frx":0098
               Style           =   1  'Graphical
               TabIndex        =   52
               ToolTipText     =   "Print a template containing the text for the Digital IC Tester"
               Top             =   330
               Width           =   330
            End
            Begin VB.OptionButton optOptions 
               Caption         =   "4 Way"
               Height          =   195
               HelpContextID   =   130
               Index           =   2
               Left            =   135
               TabIndex        =   29
               Tag             =   "6"
               Top             =   360
               Width           =   810
            End
            Begin VB.OptionButton optOptions 
               Caption         =   "8 Way"
               Height          =   195
               HelpContextID   =   130
               Index           =   3
               Left            =   1005
               TabIndex        =   30
               Tag             =   "7"
               Top             =   360
               Width           =   840
            End
            Begin VB.CommandButton cmdSetupDips 
               Caption         =   "Setup DIPS..."
               Enabled         =   0   'False
               Height          =   315
               HelpContextID   =   130
               Left            =   2025
               TabIndex        =   31
               Top             =   330
               Width           =   1440
            End
         End
         Begin VB.OptionButton optOptions 
            Caption         =   "Dip Type 2"
            Height          =   195
            HelpContextID   =   130
            Index           =   1
            Left            =   3120
            TabIndex        =   28
            Tag             =   "5"
            Top             =   690
            Width           =   1110
         End
         Begin VB.OptionButton optOptions 
            Caption         =   "Dip Type 1"
            Height          =   195
            HelpContextID   =   130
            Index           =   0
            Left            =   690
            TabIndex        =   27
            Tag             =   "4"
            Top             =   690
            Width           =   1110
         End
         Begin VB.CheckBox chkOptions 
            Caption         =   "Always warn about test IC power pin configuration"
            Height          =   195
            HelpContextID   =   130
            Index           =   0
            Left            =   120
            TabIndex        =   26
            Tag             =   "0"
            Top             =   255
            Width           =   4095
         End
         Begin VB.Image Image2 
            Height          =   330
            Left            =   2490
            Picture         =   "frmConfig.frx":019A
            Stretch         =   -1  'True
            Top             =   615
            Width           =   555
         End
         Begin VB.Image Image1 
            Height          =   330
            Left            =   75
            Picture         =   "frmConfig.frx":02E4
            Stretch         =   -1  'True
            Top             =   600
            Width           =   555
         End
      End
      Begin VB.CheckBox chkOptions 
         Caption         =   "Show Status Bar"
         Height          =   195
         HelpContextID   =   130
         Index           =   2
         Left            =   -72825
         TabIndex        =   24
         Tag             =   "2"
         Top             =   840
         Width           =   1515
      End
      Begin VB.CheckBox chkOptions 
         Caption         =   "Show Tool Bar"
         Height          =   195
         HelpContextID   =   130
         Index           =   1
         Left            =   -74835
         TabIndex        =   23
         Tag             =   "1"
         Top             =   840
         Width           =   1350
      End
      Begin VB.TextBox txtSetting 
         Height          =   285
         HelpContextID   =   130
         Index           =   0
         Left            =   -72825
         MaxLength       =   3
         TabIndex        =   22
         ToolTipText     =   "Maximum number of times an IC can be tested"
         Top             =   540
         Width           =   615
      End
      Begin VB.Frame Frame2 
         Caption         =   "Signal Trace"
         Height          =   2640
         Left            =   -71865
         TabIndex        =   41
         Top             =   360
         Width           =   3045
         Begin VB.TextBox txtColor 
            Alignment       =   2  'Center
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            HelpContextID   =   110
            Index           =   14
            Left            =   1575
            Locked          =   -1  'True
            TabIndex        =   19
            Text            =   "GND Reference"
            ToolTipText     =   "The Trace display foreground colour"
            Top             =   675
            Width           =   1395
         End
         Begin VB.TextBox txtColor 
            Alignment       =   2  'Center
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            HelpContextID   =   110
            Index           =   13
            Left            =   1575
            Locked          =   -1  'True
            TabIndex        =   18
            Text            =   "Expected"
            ToolTipText     =   "The Trace display foreground colour"
            Top             =   225
            Width           =   1395
         End
         Begin VB.TextBox txtColor 
            Alignment       =   2  'Center
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            HelpContextID   =   110
            Index           =   12
            Left            =   105
            Locked          =   -1  'True
            TabIndex        =   16
            Text            =   "Trace (Out Pin)"
            ToolTipText     =   "The Trace display foreground colour"
            Top             =   1125
            Width           =   1395
         End
         Begin VB.PictureBox picSampleGrid 
            AutoRedraw      =   -1  'True
            Height          =   525
            Left            =   90
            ScaleHeight     =   465
            ScaleWidth      =   1335
            TabIndex        =   42
            Top             =   2010
            Width           =   1395
         End
         Begin VB.TextBox txtColor 
            Alignment       =   2  'Center
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            HelpContextID   =   110
            Index           =   9
            Left            =   105
            Locked          =   -1  'True
            TabIndex        =   14
            Text            =   "Background"
            ToolTipText     =   "The Trace display background colour"
            Top             =   225
            Width           =   1395
         End
         Begin VB.TextBox txtColor 
            Alignment       =   2  'Center
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            HelpContextID   =   110
            Index           =   10
            Left            =   105
            Locked          =   -1  'True
            TabIndex        =   15
            Text            =   "Trace (In Pin)"
            ToolTipText     =   "The Trace display foreground colour"
            Top             =   675
            Width           =   1395
         End
         Begin VB.TextBox txtColor 
            Alignment       =   2  'Center
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            HelpContextID   =   110
            Index           =   11
            Left            =   105
            Locked          =   -1  'True
            TabIndex        =   17
            Text            =   "Grid"
            ToolTipText     =   "The Trace display foreground colour"
            Top             =   1590
            Width           =   1395
         End
      End
      Begin VB.CommandButton cmdBrowse 
         Caption         =   "..."
         Height          =   330
         HelpContextID   =   120
         Index           =   0
         Left            =   -69105
         TabIndex        =   21
         Top             =   660
         Width           =   330
      End
      Begin VB.TextBox txtPath 
         Height          =   285
         HelpContextID   =   120
         Index           =   0
         Left            =   -74880
         MaxLength       =   128
         TabIndex        =   20
         Top             =   675
         Width           =   5670
      End
      Begin VB.TextBox txtColor 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         HelpContextID   =   110
         Index           =   8
         Left            =   -73350
         Locked          =   -1  'True
         TabIndex        =   13
         Text            =   "No Operand"
         ToolTipText     =   "Designates that a test failed"
         Top             =   1950
         Width           =   1395
      End
      Begin VB.TextBox txtColor 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         HelpContextID   =   110
         Index           =   7
         Left            =   -73350
         Locked          =   -1  'True
         TabIndex        =   12
         Text            =   "Error"
         ToolTipText     =   "Designates that a test failed"
         Top             =   1485
         Width           =   1395
      End
      Begin VB.TextBox txtColor 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         HelpContextID   =   110
         Index           =   6
         Left            =   -73350
         Locked          =   -1  'True
         TabIndex        =   11
         Text            =   "OK"
         ToolTipText     =   "Designates that a test passed"
         Top             =   1035
         Width           =   1395
      End
      Begin VB.TextBox txtColor 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         HelpContextID   =   110
         Index           =   5
         Left            =   -73350
         Locked          =   -1  'True
         TabIndex        =   10
         Text            =   "Pin N/C"
         ToolTipText     =   "Indicates that a pin as no internal connection within the IC"
         Top             =   600
         Width           =   1395
      End
      Begin VB.TextBox txtColor 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         HelpContextID   =   110
         Index           =   4
         Left            =   -74820
         Locked          =   -1  'True
         TabIndex        =   9
         Text            =   "+V"
         ToolTipText     =   "Indicates the +V pin on the IC"
         Top             =   2400
         Width           =   1395
      End
      Begin VB.TextBox txtColor 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         HelpContextID   =   110
         Index           =   3
         Left            =   -74820
         Locked          =   -1  'True
         TabIndex        =   8
         Text            =   "GND"
         ToolTipText     =   "Indicates the GND power pin on the IC"
         Top             =   1950
         Width           =   1395
      End
      Begin VB.TextBox txtColor 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         HelpContextID   =   110
         Index           =   2
         Left            =   -74820
         Locked          =   -1  'True
         TabIndex        =   7
         Text            =   "In/Out Pin"
         ToolTipText     =   "Indicates a pin that can be either an Input or Output on the IC"
         Top             =   1485
         Width           =   1395
      End
      Begin VB.TextBox txtColor 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         HelpContextID   =   110
         Index           =   1
         Left            =   -74820
         Locked          =   -1  'True
         TabIndex        =   6
         Text            =   "Output Pin"
         ToolTipText     =   "Indicates the Output pin on the IC"
         Top             =   1035
         Width           =   1395
      End
      Begin VB.TextBox txtColor 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         HelpContextID   =   110
         Index           =   0
         Left            =   -74820
         Locked          =   -1  'True
         TabIndex        =   5
         Text            =   "Input Pin"
         ToolTipText     =   "Indicates an input pin on the IC"
         Top             =   600
         Width           =   1395
      End
      Begin MSComDlg.CommonDialog cdColour 
         Left            =   -72990
         Top             =   2835
         _ExtentX        =   847
         _ExtentY        =   847
         _Version        =   393216
      End
      Begin VB.Frame Frame1 
         Caption         =   "Serial Port"
         Height          =   2640
         Left            =   150
         TabIndex        =   35
         Top             =   360
         Width           =   6060
         Begin VB.ComboBox cboPort 
            Height          =   315
            HelpContextID   =   101
            Left            =   1395
            Style           =   2  'Dropdown List
            TabIndex        =   1
            Top             =   270
            Width           =   570
         End
         Begin VB.ComboBox cboSpeed 
            Height          =   315
            HelpContextID   =   101
            Left            =   1395
            Style           =   2  'Dropdown List
            TabIndex        =   2
            Top             =   705
            Width           =   1035
         End
         Begin VB.Label Label10 
            BackStyle       =   0  'Transparent
            Caption         =   "Run the tester at the slower speed until it's correct operation has been verified."
            ForeColor       =   &H80000002&
            Height          =   210
            Left            =   150
            TabIndex        =   49
            Top             =   2355
            Width           =   5790
         End
         Begin VB.Label Label9 
            BackStyle       =   0  'Transparent
            Caption         =   "57,600 Baud with JP1 inserted"
            ForeColor       =   &H80000002&
            Height          =   195
            Left            =   2670
            TabIndex        =   48
            Top             =   945
            Width           =   2460
         End
         Begin VB.Label Label8 
            BackStyle       =   0  'Transparent
            Caption         =   "19,200 Baud without JP1 inserted"
            ForeColor       =   &H80000002&
            Height          =   195
            Left            =   2655
            TabIndex        =   47
            Top             =   750
            Width           =   2460
         End
         Begin VB.Label Label7 
            BackStyle       =   0  'Transparent
            Caption         =   "Suggestion:"
            ForeColor       =   &H80000002&
            Height          =   240
            Left            =   2655
            TabIndex        =   46
            Top             =   510
            Width           =   2820
         End
         Begin VB.Label Label1 
            BackStyle       =   0  'Transparent
            Caption         =   "COM Port No:"
            Height          =   255
            Left            =   390
            TabIndex        =   39
            Top             =   315
            Width           =   1005
         End
         Begin VB.Label Label2 
            BackStyle       =   0  'Transparent
            Caption         =   "Interface Speed:"
            Height          =   285
            Left            =   150
            TabIndex        =   38
            Top             =   750
            Width           =   1260
         End
         Begin VB.Label Label3 
            BackStyle       =   0  'Transparent
            Caption         =   "Note:"
            ForeColor       =   &H80000002&
            Height          =   225
            Left            =   150
            TabIndex        =   37
            Top             =   1215
            Width           =   1890
         End
         Begin VB.Label Label4 
            BackStyle       =   0  'Transparent
            Caption         =   $"frmConfig.frx":0DC4
            ForeColor       =   &H80000002&
            Height          =   840
            Left            =   150
            TabIndex        =   36
            Top             =   1440
            Width           =   5715
         End
      End
      Begin VB.Label Label12 
         BackStyle       =   0  'Transparent
         Caption         =   "Timing Adjustment:"
         Height          =   270
         Left            =   165
         TabIndex        =   51
         Top             =   3075
         Width           =   1410
      End
      Begin VB.Label Label11 
         BackStyle       =   0  'Transparent
         Caption         =   "Receive Buffer Size:"
         Height          =   210
         Left            =   -74760
         TabIndex        =   50
         Top             =   615
         Width           =   1500
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Maximum Continuous Tests:"
         Height          =   195
         Left            =   -74835
         TabIndex        =   43
         Top             =   570
         Width           =   2010
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Data models storage path:"
         Height          =   195
         Left            =   -74865
         TabIndex        =   40
         Top             =   435
         Width           =   1920
      End
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "&Cancel"
      Height          =   330
      Left            =   5280
      TabIndex        =   34
      Top             =   3600
      Width           =   1155
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "&OK"
      Default         =   -1  'True
      Height          =   330
      Left            =   3960
      TabIndex        =   33
      Top             =   3600
      Width           =   1155
   End
End
Attribute VB_Name = "frmConfig"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Const Module_Name                       As String = "frmConfig"
Private Sub RedrawSampleGrid()

    Dim X                       As Long
    Dim Y                       As Long
    Dim z                       As Long
    
    
    With picSampleGrid
        .Cls
        .BackColor = txtColor(9).BackColor
        .FillColor = txtColor(10).BackColor
        
        For X = 1 To .Width Step 150
            picSampleGrid.Line (X, 0)-(X, .Height), txtColor(11).BackColor
        Next X
        
        For Y = 1 To .Height Step 150
            picSampleGrid.Line (0, Y)-(.Width, Y), txtColor(11).BackColor
        Next Y
        
        For Y = 0 To 2 Step 2
            picSampleGrid.Line (0, 350 + z)-(500, 350 + z), txtColor(10 + Y).BackColor
            picSampleGrid.Line (500, 350 + z)-(500, 250 + z), txtColor(10 + Y).BackColor
            picSampleGrid.Line (500, 250 + z)-(600, 250 + z), txtColor(10 + Y).BackColor
            picSampleGrid.Line (600, 250 + z)-(600, 350 + z), txtColor(10 + Y).BackColor
            picSampleGrid.Line (600, 350 + z)-(.Width, 350 + z), txtColor(10 + Y).BackColor
            z = z - 200
        Next Y
        
    End With
        
End Sub

Private Sub cmdBrowse_Click(Index As Integer)

    Load frmModelDir
    frmModelDir.Mode = 1 ' Locate Directory
    
    frmModelDir.Show vbModal
    
    If frmModelDir.pbCancel = False Then
        txtPath(Index).Text = frmModelDir.Dir1.Path
    End If
        
    Unload frmModelDir
    
End Sub

Private Sub cmdCancel_Click()

    Unload Me
    
End Sub

Private Sub cmdDefault_Click()

    Dim F                           As Integer
    Dim vSplit                      As Variant
    

    Select Case SSTab1.Tab
    Case 1 ' Colours
        vSplit = Split(DEFAULT_COLOURS, ",")
        For F = 0 To UBound(glColors)
            glColors(F) = Val(vSplit(F))
            ' Save default colours
            SaveSetting App.Title, "Defaults", "Colours" & Format$(F), glColors(F)
        Next F
    
    End Select
    
    '
    ' Force redraw of new changes
    Call Form_Load
End Sub

Private Sub cmdOK_Click()
    Dim F                       As Integer
    Dim con                     As Control
    
    '
    ' Communications
    
    ' Save colour settings
    For F = 0 To txtColor.Count - 1
        SaveSetting App.Title, "Defaults", "Colours" & Format$(F), txtColor(F).BackColor
    Next F
    
    '
    ' Save paths
    For F = 0 To txtPath.Count - 1
        SaveSetting App.Title, "Defaults", "Paths" & Format$(F), txtPath(F)
    Next F
    
    SaveSetting App.Title, "Defaults", "ComPort", cboPort.Text
    SaveSetting App.Title, "Defaults", "ComSpeed", cboSpeed.Text
    
    '
    ' Save additional settings
    For F = 0 To txtSetting.Count - 1
        SaveSetting App.Title, "Defaults", "Settings" & Format$(F), txtSetting(F).Text
    Next F
    
    For Each con In Me.Controls
        If Len(con.Tag) Then
            F = Val(con.Tag)
            If TypeOf con Is OptionButton Then
                SaveSetting App.Title, "Defaults", "Options" & Format$(F), Format$(con.Value, "0")
            ElseIf TypeOf con Is CheckBox Then
                SaveSetting App.Title, "Defaults", "Options" & Format$(F), con.Value
            End If
        End If
    Next
    
    ReadDefaultSettings ' Read default settings from the registry
    
    Unload Me
    
End Sub

Private Sub cmdPrintTemplate_Click()
    Dim F                           As Integer
    
    
    If MsgBox("Do you wish to print a new ledgend on the default printer ?", vbYesNo + vbQuestion, "Print New Legend") = vbYes Then
        Screen.MousePointer = 11
        DoEvents
        
        Load frmPrintTemplate
        Load frmSetupDIPS
        
        With frmSetupDIPS
            For F = 0 To .txtDesc.Count - 1
                frmPrintTemplate.lblDesc(F).Caption = .txtDesc(F).Text
            Next F
        End With
        
        frmPrintTemplate.PrintForm
        
        Unload frmPrintTemplate
        Unload frmSetupDIPS
        
        Screen.MousePointer = 0
    End If
    
End Sub

Private Sub cmdSetupDips_Click()

    Load frmSetupDIPS
    frmSetupDIPS.imgDip(0).ZOrder Abs(Not optOptions(0).Value)
    
    frmSetupDIPS.Show vbModal
    
    
End Sub

Private Sub Form_Load()

    Dim F                               As Integer
    Dim con                             As Control
    
    Const PROC_NAME                     As String = "Form_Load"
    
    On Error GoTo ErrorHandler
    
    With cboPort
        .AddItem "1"
        .AddItem "2"
        .AddItem "3"
        .AddItem "4"
        For F = 0 To .ListCount - 1
            If Val(.List(F)) = gnPort Then
                .ListIndex = F
                Exit For
            End If
        Next F
    End With
    
    With cboSpeed
        .AddItem "300"
        .AddItem "600"
        .AddItem "1200"
        .AddItem "2400"
        .AddItem "4800"
        .AddItem "9600"
        .AddItem "19200"
        .AddItem "57600"
        For F = 0 To .ListCount - 1
            If Val(.List(F)) = glPortSpeed Then
                .ListIndex = F
                Exit For
            End If
        Next F
    End With
    
    For F = 0 To txtColor.Count - 1
        txtColor(F).BackColor = GetSetting(App.Title, "Defaults", "Colours" & Format$(F), 65535)
    Next F
    
    For F = 0 To txtPath.Count - 1
        txtPath(F).Text = GetSetting(App.Title, "Defaults", "Paths" & Format$(F), "C:\")
    Next F
    
    For Each con In Me.Controls
        If Len(con.Tag) Then
            F = Val(con.Tag)
            If TypeOf con Is OptionButton Then
                con.Value = gbOptions(F)
                'SaveSetting App.Title, "Defaults", "Options" & Format$(F), Format$(con.Value, "0")
            ElseIf TypeOf con Is CheckBox Then
                con.Value = Abs(gbOptions(F))
                'SaveSetting App.Title, "Defaults", "Options" & Format$(F), con.Value
            End If
        End If
    Next

    cboPort.Text = Format$(gnPort)
    cboSpeed = glPortSpeed
        
    For F = 0 To txtSetting.Count - 1
        txtSetting(F).Text = gsSettings(F)
    Next F
    
    Call RedrawSampleGrid
    
    Exit Sub

ErrorHandler:
    ErrorRoutine Module_Name, PROC_NAME, Err
End Sub


Private Sub optOptions_Click(Index As Integer)
    
    Select Case Index
    Case 2
        cmdSetupDips.Enabled = False
        
    Case 3
        cmdSetupDips.Enabled = True
        
    End Select
    
End Sub


Private Sub SSTab1_Click(PreviousTab As Integer)

    Select Case SSTab1.Tab
    Case 1 ' Colours
        cmdDefault.Enabled = True
        
    Case Else
        cmdDefault.Enabled = False
        
    End Select
    
End Sub

Private Sub txtColor_Click(Index As Integer)

    On Error GoTo ErrorHandler
    
    With cdColour
        .CancelError = True
        .ShowColor
        
        txtColor(Index).BackColor = .Color
    
    End With
    
    Select Case Index
    Case 9, 10, 11, 12 ' Changed Grid Colours
        Call RedrawSampleGrid
        
    End Select
        
    Exit Sub
    
ErrorHandler:
    ' Cancel key pressed
End Sub


Private Sub txtSetting_KeyPress(Index As Integer, KeyAscii As Integer)

    KeyAscii = ValidateKeyPress(KeyAscii, VALIDATE_NUMERIC)
    
End Sub


