VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmSetupDIPS 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "DIP Switch Power Configuration"
   ClientHeight    =   3015
   ClientLeft      =   4725
   ClientTop       =   5100
   ClientWidth     =   4440
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   HelpContextID   =   700
   Icon            =   "frmSetupDIPS.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3015
   ScaleWidth      =   4440
   StartUpPosition =   1  'CenterOwner
   Begin VB.TextBox txtDesc 
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      HelpContextID   =   700
      Index           =   3
      Left            =   2970
      Locked          =   -1  'True
      TabIndex        =   15
      Text            =   "GND"
      Top             =   1005
      Width           =   1365
   End
   Begin VB.TextBox txtDesc 
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      HelpContextID   =   700
      Index           =   2
      Left            =   2970
      Locked          =   -1  'True
      TabIndex        =   11
      Text            =   "14 Pin (+5V)"
      Top             =   720
      Width           =   1365
   End
   Begin VB.TextBox txtDesc 
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      HelpContextID   =   700
      Index           =   1
      Left            =   2970
      Locked          =   -1  'True
      TabIndex        =   7
      Text            =   "16 Pin (+5V)"
      Top             =   435
      Width           =   1365
   End
   Begin VB.TextBox txtDesc 
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      HelpContextID   =   700
      Index           =   0
      Left            =   2970
      Locked          =   -1  'True
      TabIndex        =   3
      Text            =   "20 Pin (+5V)"
      Top             =   135
      Width           =   1365
   End
   Begin VB.ComboBox cboPin 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      HelpContextID   =   700
      Index           =   7
      Left            =   1155
      TabIndex        =   28
      Top             =   2145
      Width           =   510
   End
   Begin VB.ComboBox cboPin 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      HelpContextID   =   700
      Index           =   6
      Left            =   1155
      TabIndex        =   24
      Top             =   1860
      Width           =   510
   End
   Begin VB.ComboBox cboPin 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      HelpContextID   =   700
      Index           =   5
      Left            =   1155
      TabIndex        =   20
      Top             =   1560
      Width           =   510
   End
   Begin VB.ComboBox cboPin 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      HelpContextID   =   700
      Index           =   4
      Left            =   1155
      TabIndex        =   16
      Top             =   1275
      Width           =   510
   End
   Begin VB.ComboBox cboPin 
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      HelpContextID   =   700
      Index           =   3
      Left            =   1155
      TabIndex        =   12
      Text            =   "12"
      Top             =   990
      Width           =   510
   End
   Begin VB.ComboBox cboPin 
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      HelpContextID   =   700
      Index           =   2
      Left            =   1155
      TabIndex        =   8
      Text            =   "19"
      Top             =   705
      Width           =   510
   End
   Begin VB.ComboBox cboPin 
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      HelpContextID   =   700
      Index           =   1
      Left            =   1155
      TabIndex        =   4
      Text            =   "20"
      Top             =   405
      Width           =   510
   End
   Begin VB.ComboBox cboPin 
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      HelpContextID   =   700
      Index           =   0
      Left            =   1155
      TabIndex        =   0
      Text            =   "22"
      Top             =   120
      Width           =   510
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      Height          =   330
      Left            =   2445
      TabIndex        =   33
      Top             =   2580
      Width           =   1155
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "OK"
      Default         =   -1  'True
      Height          =   330
      Left            =   960
      TabIndex        =   32
      Top             =   2595
      Width           =   1155
   End
   Begin VB.TextBox txtDesc 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      HelpContextID   =   700
      Index           =   7
      Left            =   2970
      TabIndex        =   31
      Top             =   2160
      Width           =   1365
   End
   Begin VB.TextBox txtDesc 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      HelpContextID   =   700
      Index           =   6
      Left            =   2970
      TabIndex        =   27
      Top             =   1875
      Width           =   1365
   End
   Begin VB.TextBox txtDesc 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      HelpContextID   =   700
      Index           =   5
      Left            =   2970
      TabIndex        =   23
      Top             =   1590
      Width           =   1365
   End
   Begin VB.CheckBox chkGnd 
      BackColor       =   &H0000FF00&
      Caption         =   "GND"
      Height          =   195
      HelpContextID   =   700
      Index           =   7
      Left            =   2265
      TabIndex        =   30
      Top             =   2175
      Width           =   615
   End
   Begin VB.CheckBox chkGnd 
      BackColor       =   &H0000FF00&
      Caption         =   "GND"
      Height          =   195
      HelpContextID   =   700
      Index           =   6
      Left            =   2265
      TabIndex        =   26
      Top             =   1890
      Width           =   615
   End
   Begin VB.CheckBox chkGnd 
      BackColor       =   &H0000FF00&
      Caption         =   "GND"
      Height          =   195
      HelpContextID   =   700
      Index           =   5
      Left            =   2265
      TabIndex        =   22
      Top             =   1605
      Width           =   615
   End
   Begin VB.CheckBox chkPos 
      BackColor       =   &H000000FF&
      Caption         =   "+V"
      Height          =   195
      HelpContextID   =   700
      Index           =   7
      Left            =   1695
      TabIndex        =   29
      Top             =   2175
      Width           =   510
   End
   Begin VB.CheckBox chkPos 
      BackColor       =   &H000000FF&
      Caption         =   "+V"
      Height          =   195
      HelpContextID   =   700
      Index           =   6
      Left            =   1695
      TabIndex        =   25
      Top             =   1890
      Width           =   510
   End
   Begin VB.CheckBox chkPos 
      BackColor       =   &H000000FF&
      Caption         =   "+V"
      Height          =   195
      HelpContextID   =   700
      Index           =   5
      Left            =   1695
      TabIndex        =   21
      Top             =   1605
      Width           =   510
   End
   Begin VB.CheckBox chkGnd 
      BackColor       =   &H0000FF00&
      Caption         =   "GND"
      Height          =   195
      HelpContextID   =   700
      Index           =   4
      Left            =   2265
      TabIndex        =   18
      Top             =   1305
      Width           =   615
   End
   Begin VB.CheckBox chkPos 
      BackColor       =   &H000000FF&
      Caption         =   "+V"
      Height          =   195
      HelpContextID   =   700
      Index           =   4
      Left            =   1695
      TabIndex        =   17
      Top             =   1305
      Width           =   510
   End
   Begin VB.TextBox txtDesc 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   240
      HelpContextID   =   700
      Index           =   4
      Left            =   2970
      TabIndex        =   19
      Top             =   1305
      Width           =   1365
   End
   Begin VB.CheckBox chkGnd 
      BackColor       =   &H0000FF00&
      Caption         =   "GND"
      Enabled         =   0   'False
      Height          =   195
      HelpContextID   =   700
      Index           =   3
      Left            =   2265
      TabIndex        =   14
      Top             =   1020
      Value           =   2  'Grayed
      Width           =   615
   End
   Begin VB.CheckBox chkGnd 
      BackColor       =   &H0000FF00&
      Caption         =   "GND"
      Enabled         =   0   'False
      Height          =   195
      HelpContextID   =   700
      Index           =   2
      Left            =   2265
      TabIndex        =   10
      Top             =   735
      Width           =   615
   End
   Begin VB.CheckBox chkGnd 
      BackColor       =   &H0000FF00&
      Caption         =   "GND"
      Enabled         =   0   'False
      Height          =   195
      HelpContextID   =   700
      Index           =   1
      Left            =   2265
      TabIndex        =   6
      Top             =   450
      Width           =   615
   End
   Begin VB.CheckBox chkPos 
      BackColor       =   &H000000FF&
      Caption         =   "+V"
      Enabled         =   0   'False
      Height          =   195
      HelpContextID   =   700
      Index           =   3
      Left            =   1695
      TabIndex        =   13
      Top             =   1020
      Width           =   510
   End
   Begin VB.CheckBox chkPos 
      BackColor       =   &H000000FF&
      Caption         =   "+V"
      Enabled         =   0   'False
      Height          =   195
      HelpContextID   =   700
      Index           =   2
      Left            =   1695
      TabIndex        =   9
      Top             =   735
      Value           =   2  'Grayed
      Width           =   510
   End
   Begin VB.CheckBox chkPos 
      BackColor       =   &H000000FF&
      Caption         =   "+V"
      Enabled         =   0   'False
      Height          =   195
      HelpContextID   =   700
      Index           =   1
      Left            =   1695
      TabIndex        =   5
      Top             =   450
      Value           =   2  'Grayed
      Width           =   510
   End
   Begin VB.CheckBox chkGnd 
      BackColor       =   &H0000FF00&
      Caption         =   "GND"
      Enabled         =   0   'False
      Height          =   195
      HelpContextID   =   700
      Index           =   0
      Left            =   2265
      TabIndex        =   2
      Top             =   150
      Width           =   615
   End
   Begin VB.CheckBox chkPos 
      BackColor       =   &H000000FF&
      Caption         =   "+V"
      Enabled         =   0   'False
      Height          =   195
      HelpContextID   =   700
      Index           =   0
      Left            =   1695
      TabIndex        =   1
      Top             =   150
      Value           =   2  'Grayed
      Width           =   510
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   390
      Top             =   2475
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   180
      ImageHeight     =   67
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   1
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmSetupDIPS.frx":014A
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin VB.Image imgDip 
      Height          =   2310
      Index           =   1
      Left            =   135
      Picture         =   "frmSetupDIPS.frx":159F
      Stretch         =   -1  'True
      Top             =   105
      Width           =   945
   End
   Begin VB.Image imgDip 
      Height          =   2310
      Index           =   0
      Left            =   105
      Picture         =   "frmSetupDIPS.frx":2DB0
      Stretch         =   -1  'True
      Top             =   105
      Width           =   1005
   End
End
Attribute VB_Name = "frmSetupDIPS"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Const Module_Name                       As String = "frmSetupDIPS"
Private Sub cboPin_GotFocus(Index As Integer)

    Dim bFlag                           As Boolean
    Dim F                               As Integer
    Dim G                               As Integer
    
    Const PROC_NAME                     As String = "cboPin_GotFocus"
    
    On Error GoTo ErrorHandler
    
    With cboPin(Index)
        .Clear
        
        For F = 1 To 24
            bFlag = True
            For G = 0 To 7
                If G <> Index Then
                    If cboPin(G).Text = Format$(F) Then
                        bFlag = False
                        Exit For
                    End If
                End If
            Next G
            If bFlag = True Then
                cboPin(Index).AddItem Format$(F)
            End If
        Next F
    End With
    
    Exit Sub
        
ErrorHandler:
    ErrorRoutine Module_Name, PROC_NAME, Err, "Index:" & Format$(Index)
End Sub


Private Sub chkGnd_Click(Index As Integer)

    If chkGnd(Index).Value Then
        chkPos(Index).Value = False
    End If
    
End Sub

Private Sub chkPos_Click(Index As Integer)

    If chkPos(Index).Value Then
        chkGnd(Index).Value = False
    End If
    
End Sub


Private Sub cmdCancel_Click()

    Unload Me
    
End Sub

Private Sub cmdOK_Click()

    Dim F                           As Integer
    
    
    ' Save the settings
    For F = 4 To 7
        SaveSetting App.Title, "PowerDIPS", "Pin" & Format$(F), cboPin(F).Text
        SaveSetting App.Title, "PowerDIPS", "Pos" & Format$(F), Abs(chkPos(F).Value)
        SaveSetting App.Title, "PowerDIPS", "Neg" & Format$(F), Abs(chkGnd(F).Value)
        SaveSetting App.Title, "PowerDIPS", "Description" & Format$(F), txtDesc(F).Text
    Next F
    
    Unload Me
    
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 7
        chkPos(F).BackColor = glColors(4)
        chkGnd(F).BackColor = glColors(3)
        
        If F > 3 Then
            cboPin(F).Text = GetSetting(App.Title, "PowerDIPS", "Pin" & Format$(F), "")
            chkPos(F).Value = GetSetting(App.Title, "PowerDIPS", "Pos" & Format$(F), "0")
            chkGnd(F).Value = GetSetting(App.Title, "PowerDIPS", "Neg" & Format$(F), "0")
            txtDesc(F).Text = GetSetting(App.Title, "PowerDIPS", "Description" & Format$(F), "")
            If chkPos(F).Value = False And chkGnd(F).Value = False Then
                chkPos(F).Value = 1
            End If
        End If
        
    Next F
    
    Exit Sub
    
ErrorHandler:
    ErrorRoutine Module_Name, PROC_NAME, Err
End Sub


