home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form CDEntry
- BackColor = &H00C0C0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "Compact Disc Database"
- ClientHeight = 6510
- ClientLeft = 2940
- ClientTop = 2475
- ClientWidth = 6135
- ClipControls = 0 'False
- Height = 6915
- Left = 2880
- LinkTopic = "Form2"
- MaxButton = 0 'False
- ScaleHeight = 6510
- ScaleWidth = 6135
- Top = 2130
- Width = 6255
- Begin SSPanel Panel3D1
- BackColor = &H00C0C0C0&
- BevelInner = 1 'Inset
- BevelOuter = 1 'Inset
- Font3D = 0 'None
- Height = 6255
- Left = 120
- TabIndex = 10
- Top = 120
- Width = 5895
- Begin PictureBox PicLogo
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 615
- Left = 1680
- ScaleHeight = 615
- ScaleWidth = 2535
- TabIndex = 11
- Top = 120
- Width = 2535
- Begin Label lblLogo
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "CD Player"
- FontBold = -1 'True
- FontItalic = -1 'True
- FontName = "MS Serif"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00C00000&
- Height = 525
- Index = 0
- Left = 0
- TabIndex = 12
- Top = 0
- Width = 2415
- End
- Begin Label lblLogo
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "CD Player"
- FontBold = -1 'True
- FontItalic = -1 'True
- FontName = "MS Serif"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFFFF&
- Height = 525
- Index = 1
- Left = 0
- TabIndex = 13
- Top = 30
- Width = 2415
- End
- End
- Begin CommandButton Command1
- Cancel = -1 'True
- Caption = "&Cancel"
- Height = 495
- Index = 2
- Left = 240
- TabIndex = 9
- Top = 5520
- Width = 5415
- End
- Begin CommandButton Command1
- Caption = "&Reset Tracks"
- Height = 495
- Index = 1
- Left = 240
- TabIndex = 8
- Top = 4920
- Width = 5415
- End
- Begin TextBox Text3
- Alignment = 2 'Center
- Height = 375
- Left = 240
- MultiLine = -1 'True
- TabIndex = 3
- Top = 1440
- Width = 5415
- End
- Begin CommandButton Command1
- Caption = "&Save"
- Height = 495
- Index = 0
- Left = 240
- TabIndex = 7
- Top = 4320
- Width = 5415
- End
- Begin TextBox Text2
- Alignment = 2 'Center
- Height = 375
- Left = 240
- MultiLine = -1 'True
- TabIndex = 1
- Top = 840
- Width = 5415
- End
- Begin TextBox Text1
- Alignment = 2 'Center
- Height = 375
- Left = 240
- MultiLine = -1 'True
- TabIndex = 5
- TabStop = 0 'False
- Top = 2160
- Width = 5415
- End
- Begin ListBox List1
- Height = 1395
- Left = 240
- TabIndex = 6
- Top = 2640
- Width = 5415
- End
- Begin Label Label3
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "&Artist:"
- Height = 195
- Left = 240
- TabIndex = 2
- Top = 1200
- Width = 510
- End
- Begin Label Label2
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "C&D Title:"
- Height = 195
- Left = 240
- TabIndex = 0
- Top = 600
- Width = 765
- End
- Begin Label Label1
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "&Track Title:"
- Height = 195
- Left = 240
- TabIndex = 4
- Top = 1920
- Width = 5415
- End
- End
- Option Explicit
- Dim SelIndex As Integer
- Dim Text1Dirty As Integer
- Dim List1Dirty As Integer
- Sub Command1_Click (Index As Integer)
- Dim Answer As Integer
- Static Dirty As Integer
- Select Case Index
- Case 0 ' Save
- If Text1Dirty = True Then
- Answer = MsgBox("Edit In Progress, Abort?", 4, "OOPS!")
- If Answer = 6 Then
- Answer = MsgBox("Save Changes?", 4, "Save")
- If Answer = 6 Then
- Call UpdateTracks(List1, True)
- CommitChanges
- CDInfo.CDTitle = Text2
- CDInfo.CDAuthor = Text3
- Unload Me
- ElseIf Answer = 7 Then
- Unload Me
- End If
- ElseIf Answer = 7 Then
- Text1.SetFocus
- Exit Sub
- End If
- Else
- Answer = MsgBox("Save Changes?", 4, "Save")
- If Answer = 6 Then
- Call UpdateTracks(List1, True)
- CDInfo.CDTitle = Text2
- CDInfo.CDAuthor = Text3
- CommitChanges
- Unload Me
- ElseIf Answer = 7 Then
- Unload Me
- End If
- End If
- Case 1 ' Reset Titles
- Call UpdateTracks(List1, False)
- Call LoadListBox(List1)
- Dirty = True
- Case 2 ' Cancel
- If Dirty = True Then GetCDInfo
- Unload Me
- End Select
- End Sub
- Sub Form_Activate ()
- Text2.SetFocus
- End Sub
- Sub Form_Load ()
- CenterForm CDEntry, False
- CenterLogo Me, Panel3D1
- Text2 = CDInfo.CDTitle
- Text3 = CDInfo.CDAuthor
- Call LoadListBox(List1)
- If CDForm.mnuOptionsItem(2).Checked Then OnTop CDForm
- End Sub
- Sub Form_Unload (Cancel As Integer)
- If CDForm.mnuOptionsItem(2).Checked Then OnTop CDForm
- End Sub
- Sub List1_Click ()
- Dim Title As String
- Title = Mid$(List1.Text, (InStr(List1.Text, Chr$(9)) + 1), (Len(List1.Text) - (InStr(List1.Text, Chr$(9)))))
- Title = (Left$(Title, (InStr(Title, Chr$(9)) - 1)))
- Text1 = Title
- End Sub
- Sub List1_DblClick ()
- Dim Title As String
- Title = Mid$(List1.Text, (InStr(List1.Text, Chr$(9)) + 1), (Len(List1.Text) - (InStr(List1.Text, Chr$(9)))))
- Title = (Left$(Title, (InStr(Title, Chr$(9)) - 1)))
- Text1 = Title
- Text1.SetFocus
- Text1.SelStart = 0
- Text1.SelLength = Len(Text1)
- SelIndex = List1.ListIndex
- List1Dirty = True
- End Sub
- Sub List1_GotFocus ()
- Dim Ans As Integer
- If Text1Dirty = True Then
- Ans = MsgBox("Abandon Edit?", 4, "Edit In Progress!")
- If Ans = 6 Then
- List1.Selected(SelIndex) = True
- List1.SetFocus
- Text1Dirty = False
- List1Dirty = False
- Exit Sub
- ElseIf Ans = 7 Then
- List1.Selected(SelIndex) = True
- Text1.SetFocus
- Text1.SelStart = 0
- Text1.SelLength = (Len(Text1))
- List1Dirty = True
- End If
- End If
- End Sub
- Sub List1_KeyPress (KeyAscii As Integer)
- Dim Title As String
- If KeyAscii = 13 Then
- If List1.Text = "" Then Exit Sub
- Title = Mid$(List1.Text, (InStr(List1.Text, Chr$(9)) + 1), (Len(List1.Text) - (InStr(List1.Text, Chr$(9)))))
- Title = (Left$(Title, (InStr(Title, Chr$(9)) - 1)))
- Text1 = Title
- Text1.SetFocus
- Text1.SelStart = 0
- Text1.SelLength = Len(Text1)
- SelIndex = List1.ListIndex
- List1Dirty = True
- End If
- End Sub
- Sub Text1_Change ()
- Text1Dirty = True
- End Sub
- Sub Text1_GotFocus ()
- If List1Dirty = False Then
- MsgBox "You must Select and item from the List Box" & CRLF & "Hit Enter or Select With Mouse", 0, "Please Select An Item To Edit"
- List1.SetFocus
- List1.Selected(SelIndex) = True
- Else
- Text1.SelStart = 0
- Text1.SelLength = (Len(Text1))
- End If
- End Sub
- Sub Text1_KeyPress (KeyAscii As Integer)
- If KeyAscii = 13 Then
- List1.RemoveItem SelIndex
- List1.AddItem (SelIndex + 1) & ":" & Chr$(9) & (Left$(Text1, 30)) & Chr$(9) & CDTime(SelIndex + 1), SelIndex
- Text1 = ""
- List1.SetFocus
- If List1.ListCount > (SelIndex + 1) Then
- List1.Selected(SelIndex + 1) = True
- Else
- List1.Selected(SelIndex) = True
- End If
- KeyAscii = 0
- Text1Dirty = False
- List1Dirty = False
- End If
- End Sub
- Sub Text2_GotFocus ()
- Text2.SelStart = 0
- Text2.SelLength = Len(Text2)
- End Sub
- Sub Text2_KeyPress (KeyAscii As Integer)
- If KeyAscii = 13 Then
- Text3.SetFocus
- KeyAscii = 0
- End If
- End Sub
- Sub Text3_GotFocus ()
- Text3.SelStart = 0
- Text3.SelLength = Len(Text3)
- End Sub
- Sub Text3_KeyPress (KeyAscii As Integer)
- If KeyAscii = 13 Then
- List1.SetFocus
- Text1Dirty = False
- KeyAscii = 0
- End If
- End Sub
-