home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmWizard
- BorderStyle = 3 'Fixed Dialog
- Caption = "ZIP Wizard"
- ClientHeight = 5880
- ClientLeft = 1050
- ClientTop = 1785
- ClientWidth = 7455
- Height = 6285
- Icon = "FRMWIZ.frx":0000
- Left = 990
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5880
- ScaleWidth = 7455
- ShowInTaskbar = 0 'False
- Top = 1440
- Width = 7575
- Begin VB.CommandButton cmdFinish
- Caption = "&Finish"
- Enabled = 0 'False
- Height = 375
- Left = 5760
- TabIndex = 17
- Top = 5280
- Width = 1455
- End
- Begin VB.CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "Cancel"
- Height = 375
- Left = 240
- TabIndex = 2
- Top = 5280
- Width = 1455
- End
- Begin VB.CommandButton cmdBack
- Caption = "<-- &Back"
- Enabled = 0 'False
- Height = 375
- Left = 2640
- TabIndex = 1
- Top = 5280
- Width = 1455
- End
- Begin VB.CommandButton cmdNext
- Caption = "&Next -->"
- Enabled = 0 'False
- Height = 375
- Left = 4200
- TabIndex = 0
- Top = 5280
- Width = 1455
- End
- Begin VB.PictureBox Picture1
- BackColor = &H00FFFFFF&
- Height = 4695
- Left = 240
- Picture = "FRMWIZ.frx":030A
- ScaleHeight = 4635
- ScaleWidth = 2235
- TabIndex = 19
- Top = 240
- Width = 2295
- End
- Begin VB.Frame fraStep
- Caption = "Summary"
- Height = 4695
- Index = 4
- Left = 2760
- TabIndex = 14
- Top = 360
- Width = 4575
- Begin VB.TextBox txtSummary
- Height = 3855
- Left = 240
- Locked = -1 'True
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 44
- Text = "FRMWIZ.frx":530A
- Top = 480
- Width = 4095
- End
- End
- Begin VB.Frame fraStep
- Caption = "Advanced options"
- Height = 4695
- Index = 3
- Left = 2640
- TabIndex = 13
- Top = 120
- Width = 4575
- Begin VB.Frame fraOption
- Caption = "Do you want to use long filenames?"
- Height = 855
- Index = 6
- Left = 240
- TabIndex = 29
- Top = 1440
- Width = 4095
- Begin VB.OptionButton optLFN
- Caption = "Yes"
- Height = 255
- Index = 0
- Left = 360
- TabIndex = 40
- Top = 480
- Width = 855
- End
- Begin VB.OptionButton optLFN
- Caption = "No"
- Height = 255
- Index = 1
- Left = 360
- TabIndex = 41
- Top = 240
- Value = -1 'True
- Width = 855
- End
- End
- Begin VB.Frame fraOption
- Caption = "Do you want to add a comment to the archive?"
- Height = 1695
- Index = 5
- Left = 240
- TabIndex = 28
- Top = 2520
- Width = 4095
- Begin VB.TextBox txtComment
- Enabled = 0 'False
- Height = 855
- Left = 1080
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 43
- Top = 720
- Width = 2655
- End
- Begin VB.OptionButton optComment
- Caption = "Yes"
- Height = 255
- Index = 0
- Left = 360
- TabIndex = 32
- Top = 480
- Width = 615
- End
- Begin VB.OptionButton optComment
- Caption = "No"
- Height = 255
- Index = 1
- Left = 360
- TabIndex = 33
- Top = 240
- Value = -1 'True
- Width = 735
- End
- Begin VB.Label lblComment
- Caption = "Comment"
- Enabled = 0 'False
- Height = 255
- Left = 360
- TabIndex = 42
- Top = 765
- Width = 700
- End
- End
- Begin VB.Frame fraOption
- Caption = "Do you want to create a multi-disk archive?"
- Height = 855
- Index = 4
- Left = 240
- TabIndex = 27
- Top = 360
- Width = 4095
- Begin VB.OptionButton optSpan
- Caption = "Yes"
- Height = 255
- Index = 0
- Left = 360
- TabIndex = 30
- Top = 480
- Width = 975
- End
- Begin VB.OptionButton optSpan
- Caption = "No"
- Height = 255
- Index = 1
- Left = 360
- TabIndex = 31
- Top = 240
- Value = -1 'True
- Width = 975
- End
- End
- End
- Begin VB.Frame fraStep
- Caption = "Options"
- Height = 4695
- Index = 2
- Left = 2640
- TabIndex = 12
- Top = 120
- Width = 4575
- Begin VB.Frame fraOption
- Caption = "Set the compression level"
- Height = 1335
- Index = 2
- Left = 240
- TabIndex = 22
- Top = 2880
- Width = 4095
- Begin VB.OptionButton optLevel
- Caption = "None - fastest"
- Height = 255
- Index = 0
- Left = 360
- TabIndex = 26
- Top = 240
- Width = 1335
- End
- Begin VB.OptionButton optLevel
- Caption = "Minimum"
- Height = 255
- Index = 1
- Left = 360
- TabIndex = 25
- Top = 480
- Width = 1335
- End
- Begin VB.OptionButton optLevel
- Caption = "Normal"
- Height = 255
- Index = 2
- Left = 360
- TabIndex = 24
- Top = 720
- Value = -1 'True
- Width = 1335
- End
- Begin VB.OptionButton optLevel
- Caption = "Maximum - slowest"
- Height = 255
- Index = 3
- Left = 360
- TabIndex = 23
- Top = 960
- Width = 1935
- End
- End
- Begin VB.Frame fraOption
- Caption = "Do you want to encrypt the files in this archive?"
- Height = 1215
- Index = 1
- Left = 240
- TabIndex = 21
- Top = 1440
- Width = 4095
- Begin VB.TextBox txtPassword
- Enabled = 0 'False
- Height = 285
- Left = 1120
- TabIndex = 39
- Top = 720
- Width = 2640
- End
- Begin VB.OptionButton optEncrypt
- Caption = "No"
- Height = 255
- Index = 1
- Left = 360
- TabIndex = 37
- Top = 240
- Value = -1 'True
- Width = 855
- End
- Begin VB.OptionButton optEncrypt
- Caption = "Yes"
- Height = 255
- Index = 0
- Left = 360
- TabIndex = 36
- Top = 480
- Width = 615
- End
- Begin VB.Label lblPassword
- Caption = "Password"
- Enabled = 0 'False
- Height = 255
- Left = 360
- TabIndex = 38
- Top = 760
- Width = 740
- End
- End
- Begin VB.Frame fraOption
- Caption = "Do you want to store the full path information ?"
- Height = 855
- Index = 0
- Left = 240
- TabIndex = 20
- Top = 360
- Width = 4095
- Begin VB.OptionButton optFull
- Caption = "No"
- Height = 255
- Index = 1
- Left = 360
- TabIndex = 35
- Top = 240
- Width = 855
- End
- Begin VB.OptionButton optFull
- Caption = "Yes"
- Height = 255
- Index = 0
- Left = 360
- TabIndex = 34
- Top = 480
- Value = -1 'True
- Width = 855
- End
- End
- End
- Begin VB.Frame fraStep
- Caption = "Archive name"
- Height = 4695
- Index = 0
- Left = 3000
- TabIndex = 3
- Top = 240
- Width = 4575
- Begin VB.CommandButton cmdBrowse
- Caption = "Browse..."
- Enabled = 0 'False
- Height = 375
- Left = 2880
- TabIndex = 7
- Top = 1080
- Width = 1455
- End
- Begin VB.TextBox txtArchive
- Height = 285
- Left = 240
- TabIndex = 6
- Top = 720
- Width = 4095
- End
- Begin VB.Label lblArchive
- Caption = "Please enter the name of an archive or press Browse..."
- Height = 375
- Left = 240
- TabIndex = 5
- Top = 360
- Width = 3975
- End
- End
- Begin VB.Frame fraStep
- Caption = "Files to compress"
- Height = 4695
- Index = 1
- Left = 2640
- TabIndex = 4
- Top = 240
- Width = 4575
- Begin VB.CommandButton cmdRemove
- Caption = "Remove"
- Enabled = 0 'False
- Height = 375
- Left = 1800
- TabIndex = 18
- Top = 2640
- Width = 1455
- End
- Begin VB.CommandButton cmdAdd
- Caption = "Add"
- Enabled = 0 'False
- Height = 375
- Left = 240
- TabIndex = 16
- Top = 2640
- Width = 1455
- End
- Begin VB.DriveListBox Drive1
- Height = 315
- Left = 2400
- TabIndex = 11
- Top = 2230
- Width = 1935
- End
- Begin VB.DirListBox Dir1
- Height = 1155
- Left = 2400
- TabIndex = 10
- Top = 960
- Width = 1935
- End
- Begin VB.FileListBox File1
- Height = 1560
- Left = 240
- TabIndex = 9
- Top = 960
- Width = 2052
- End
- Begin VB.ListBox lstSelected
- Height = 1368
- Left = 240
- TabIndex = 8
- Top = 3120
- Width = 4092
- End
- Begin VB.Label Label2
- Caption = "Browse for the files to be compressed to the archive, and add them to the list box"
- Height = 375
- Left = 240
- TabIndex = 15
- Top = 360
- Width = 4095
- End
- End
- Attribute VB_Name = "frmWizard"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private m_iStep As Integer
- Private Const m_cMaxSteps = 4
- Sub DisplaySummary()
- Dim sSummary As String
- Dim CRLF As String * 2
- Dim I As Integer
- CRLF = Chr$(13) & Chr$(10)
- sSummary = "Compress the following " & Format$(lstSelected.ListCount) & " file"
- If (lstSelected.ListCount > 1) Then
- sSummary = sSummary & "s"
- End If
- sSummary = sSummary & " to the archive " & txtArchive.Text & "." & CRLF & CRLF
- For I = 0 To lstSelected.ListCount - 1
- sSummary = sSummary & Chr$(9) & lstSelected.List(I) & CRLF
- Next I
- sSummary = sSummary & CRLF
- sSummary = sSummary & "Selected options " & CRLF
- If (optFull(0).Value) Then
- sSummary = sSummary & Chr(9) & "Full path information saved" & CRLF
- Else
- sSummary = sSummary & Chr(9) & "Only filenames saved" & CRLF
- End If
- If (optEncrypt(0).Value) Then
- sSummary = sSummary & Chr(9) & "Files will be encrypted" & CRLF
- Else
- sSummary = sSummary & Chr(9) & "Files will not be encrypted" & CRLF
- End If
- If (optLevel(0).Value) Then
- sSummary = sSummary & Chr(9) & "Files will be stored without compression" & CRLF
- ElseIf (optLevel(1).Value) Then
- sSummary = sSummary & Chr(9) & "Files will hame minimum compressed" & CRLF
- ElseIf (optLevel(2).Value) Then
- sSummary = sSummary & Chr(9) & "Files will have normal compression" & CRLF
- Else
- sSummary = sSummary & Chr(9) & "Files will have maximum compression" & CRLF
- End If
- If (optSpan(0).Value) Then
- sSummary = sSummary & Chr(9) & "Archive may span multiple disks" & CRLF
- Else
- sSummary = sSummary & Chr(9) & "Archive will not span disks" & CRLF
- End If
- If (optLFN(0).Value) Then
- sSummary = sSummary & Chr(9) & "Long filenames will be stored" & CRLF
- Else
- sSummary = sSummary & Chr(9) & "Short (8.3) filenames will be stored" & CRLF
- End If
- If (optComment(0).Value) Then
- sSummary = sSummary & Chr(9) & "Archive will have a comment added" & CRLF
- End If
- txtSummary.Text = Trim$(sSummary)
- End Sub
- Private Sub cmdAdd_Click()
- Dim sFilename As String
- sFilename = File1.Path
- If (Right$(sFilename, 1) <> "\") Then
- sFilename = sFilename & "\"
- End If
- sFilename = sFilename & File1.filename
- lstSelected.AddItem sFilename
- If (lstSelected.ListCount = 1) Then
- cmdNext.Enabled = True
- cmdFinish.Enabled = True
- cmdRemove.Enabled = True
- End If
- End Sub
- Private Sub cmdBack_Click()
- If (m_iStep > 0) Then
- fraStep(m_iStep).Visible = False
- If (m_iStep = m_cMaxSteps) Then
- cmdNext.Enabled = True
- End If
- m_iStep = m_iStep - 1
- If (m_iStep = 0) Then
- cmdBack.Enabled = False
- End If
- fraStep(m_iStep).Visible = True
- End If
- End Sub
- Private Sub cmdCancel_Click()
- End
- End Sub
- Private Sub cmdFinish_Click()
- If (fraStep(m_cMaxSteps).Visible = False) Then
- DisplaySummary
- fraStep(m_iStep).Visible = False
- fraStep(m_cMaxSteps).Visible = True
- m_iStep = m_cMaxSteps
- End If
- frmZIP.Show 1
- End
- End Sub
- Private Sub cmdNext_Click()
- Dim iDrive As Integer
- If (m_iStep < m_cMaxSteps) Then
- fraStep(m_iStep).Visible = False
- If (m_iStep = 0) Then
- cmdBack.Enabled = True
- If (InStr(txtArchive.Text, ":")) Then
- iDrive = Asc(UCase$(Left(txtArchive.Text, 1))) - 65
- If (GetDriveType(iDrive) <> DRIVE_REMOVABLE) Then
- fraOption(4).Enabled = False
- optSpan(0).Enabled = False
- optSpan(1).Enabled = False
- Else
- fraOption(4).Enabled = True
- optSpan(0).Enabled = True
- optSpan(1).Enabled = True
- End If
- Else
- fraOption(4).Enabled = False
- optSpan(0).Enabled = False
- optSpan(1).Enabled = False
- End If
- End If
- m_iStep = m_iStep + 1
- If (m_iStep = m_cMaxSteps) Then
- cmdNext.Enabled = False
- DisplaySummary
- End If
- fraStep(m_iStep).Visible = True
- End If
- End Sub
- Private Sub cmdRemove_Click()
- lstSelected.RemoveItem lstSelected.ListIndex
- If (lstSelected.ListCount = 0) Then
- cmdNext.Enabled = False
- cmdFinish.Enabled = False
- cmdRemove.Enabled = False
- End If
- End Sub
- Private Sub Dir1_Change()
- File1.Path = Dir1.Path
- cmdAdd.Enabled = False
- End Sub
- Private Sub Drive1_Change()
- Dir1.Path = Drive1.Drive
- End Sub
- Private Sub File1_Click()
- cmdAdd.Enabled = True
- End Sub
- Private Sub File1_DblClick()
- cmdAdd_Click
- End Sub
- Private Sub Form_Load()
- Dim I As Integer
- m_iStep = 0
- fraStep(m_iStep).ZOrder
- For I = 0 To m_cMaxSteps
- fraStep(I).Move 2640, 240, 4575, 4695
- If (I > 0) Then
- fraStep(I).Visible = False
- End If
- Next I
- txtSummary.BackColor = frmWizard.BackColor
- Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
- End Sub
- Private Sub lstSelected_DblClick()
- cmdRemove_Click
- End Sub
- Private Sub optComment_Click(Index As Integer)
- If (Index = 0) Then
- lblComment.Enabled = True
- txtComment.Enabled = True
- Else
- lblComment.Enabled = False
- txtComment.Enabled = False
- End If
- End Sub
- Private Sub optEncrypt_Click(Index As Integer)
- If (Index = 0) Then
- txtPassword.Enabled = True
- lblPassword.Enabled = True
- Else
- txtPassword.Enabled = False
- lblPassword.Enabled = False
- End If
- End Sub
- Private Sub txtArchive_Change()
- If (Len(txtArchive.Text) = 0) Then
- cmdNext.Enabled = False
- Else
- cmdNext.Enabled = True
- End If
- End Sub
-