home *** CD-ROM | disk | FTP | other *** search
/ BUG 6 / BUGCD1997_09.BIN / UTIL / ADDZIP / ADDZIP.EXE / VB / ZIPWIZ / FRMWIZ.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1997-06-01  |  20.1 KB  |  611 lines

  1. VERSION 4.00
  2. Begin VB.Form frmWizard 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "ZIP Wizard"
  5.    ClientHeight    =   5880
  6.    ClientLeft      =   1050
  7.    ClientTop       =   1785
  8.    ClientWidth     =   7455
  9.    Height          =   6285
  10.    Icon            =   "FRMWIZ.frx":0000
  11.    Left            =   990
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   5880
  16.    ScaleWidth      =   7455
  17.    ShowInTaskbar   =   0   'False
  18.    Top             =   1440
  19.    Width           =   7575
  20.    Begin VB.CommandButton cmdFinish 
  21.       Caption         =   "&Finish"
  22.       Enabled         =   0   'False
  23.       Height          =   375
  24.       Left            =   5760
  25.       TabIndex        =   17
  26.       Top             =   5280
  27.       Width           =   1455
  28.    End
  29.    Begin VB.CommandButton cmdCancel 
  30.       Cancel          =   -1  'True
  31.       Caption         =   "Cancel"
  32.       Height          =   375
  33.       Left            =   240
  34.       TabIndex        =   2
  35.       Top             =   5280
  36.       Width           =   1455
  37.    End
  38.    Begin VB.CommandButton cmdBack 
  39.       Caption         =   "<-- &Back"
  40.       Enabled         =   0   'False
  41.       Height          =   375
  42.       Left            =   2640
  43.       TabIndex        =   1
  44.       Top             =   5280
  45.       Width           =   1455
  46.    End
  47.    Begin VB.CommandButton cmdNext 
  48.       Caption         =   "&Next -->"
  49.       Enabled         =   0   'False
  50.       Height          =   375
  51.       Left            =   4200
  52.       TabIndex        =   0
  53.       Top             =   5280
  54.       Width           =   1455
  55.    End
  56.    Begin VB.PictureBox Picture1 
  57.       BackColor       =   &H00FFFFFF&
  58.       Height          =   4695
  59.       Left            =   240
  60.       Picture         =   "FRMWIZ.frx":030A
  61.       ScaleHeight     =   4635
  62.       ScaleWidth      =   2235
  63.       TabIndex        =   19
  64.       Top             =   240
  65.       Width           =   2295
  66.    End
  67.    Begin VB.Frame fraStep 
  68.       Caption         =   "Summary"
  69.       Height          =   4695
  70.       Index           =   4
  71.       Left            =   2760
  72.       TabIndex        =   14
  73.       Top             =   360
  74.       Width           =   4575
  75.       Begin VB.TextBox txtSummary 
  76.          Height          =   3855
  77.          Left            =   240
  78.          Locked          =   -1  'True
  79.          MultiLine       =   -1  'True
  80.          ScrollBars      =   2  'Vertical
  81.          TabIndex        =   44
  82.          Text            =   "FRMWIZ.frx":530A
  83.          Top             =   480
  84.          Width           =   4095
  85.       End
  86.    End
  87.    Begin VB.Frame fraStep 
  88.       Caption         =   "Advanced options"
  89.       Height          =   4695
  90.       Index           =   3
  91.       Left            =   2640
  92.       TabIndex        =   13
  93.       Top             =   120
  94.       Width           =   4575
  95.       Begin VB.Frame fraOption 
  96.          Caption         =   "Do you want to use long filenames?"
  97.          Height          =   855
  98.          Index           =   6
  99.          Left            =   240
  100.          TabIndex        =   29
  101.          Top             =   1440
  102.          Width           =   4095
  103.          Begin VB.OptionButton optLFN 
  104.             Caption         =   "Yes"
  105.             Height          =   255
  106.             Index           =   0
  107.             Left            =   360
  108.             TabIndex        =   40
  109.             Top             =   480
  110.             Width           =   855
  111.          End
  112.          Begin VB.OptionButton optLFN 
  113.             Caption         =   "No"
  114.             Height          =   255
  115.             Index           =   1
  116.             Left            =   360
  117.             TabIndex        =   41
  118.             Top             =   240
  119.             Value           =   -1  'True
  120.             Width           =   855
  121.          End
  122.       End
  123.       Begin VB.Frame fraOption 
  124.          Caption         =   "Do you want to add a comment to the archive?"
  125.          Height          =   1695
  126.          Index           =   5
  127.          Left            =   240
  128.          TabIndex        =   28
  129.          Top             =   2520
  130.          Width           =   4095
  131.          Begin VB.TextBox txtComment 
  132.             Enabled         =   0   'False
  133.             Height          =   855
  134.             Left            =   1080
  135.             MultiLine       =   -1  'True
  136.             ScrollBars      =   2  'Vertical
  137.             TabIndex        =   43
  138.             Top             =   720
  139.             Width           =   2655
  140.          End
  141.          Begin VB.OptionButton optComment 
  142.             Caption         =   "Yes"
  143.             Height          =   255
  144.             Index           =   0
  145.             Left            =   360
  146.             TabIndex        =   32
  147.             Top             =   480
  148.             Width           =   615
  149.          End
  150.          Begin VB.OptionButton optComment 
  151.             Caption         =   "No"
  152.             Height          =   255
  153.             Index           =   1
  154.             Left            =   360
  155.             TabIndex        =   33
  156.             Top             =   240
  157.             Value           =   -1  'True
  158.             Width           =   735
  159.          End
  160.          Begin VB.Label lblComment 
  161.             Caption         =   "Comment"
  162.             Enabled         =   0   'False
  163.             Height          =   255
  164.             Left            =   360
  165.             TabIndex        =   42
  166.             Top             =   765
  167.             Width           =   700
  168.          End
  169.       End
  170.       Begin VB.Frame fraOption 
  171.          Caption         =   "Do you want to create a multi-disk archive?"
  172.          Height          =   855
  173.          Index           =   4
  174.          Left            =   240
  175.          TabIndex        =   27
  176.          Top             =   360
  177.          Width           =   4095
  178.          Begin VB.OptionButton optSpan 
  179.             Caption         =   "Yes"
  180.             Height          =   255
  181.             Index           =   0
  182.             Left            =   360
  183.             TabIndex        =   30
  184.             Top             =   480
  185.             Width           =   975
  186.          End
  187.          Begin VB.OptionButton optSpan 
  188.             Caption         =   "No"
  189.             Height          =   255
  190.             Index           =   1
  191.             Left            =   360
  192.             TabIndex        =   31
  193.             Top             =   240
  194.             Value           =   -1  'True
  195.             Width           =   975
  196.          End
  197.       End
  198.    End
  199.    Begin VB.Frame fraStep 
  200.       Caption         =   "Options"
  201.       Height          =   4695
  202.       Index           =   2
  203.       Left            =   2640
  204.       TabIndex        =   12
  205.       Top             =   120
  206.       Width           =   4575
  207.       Begin VB.Frame fraOption 
  208.          Caption         =   "Set the compression level"
  209.          Height          =   1335
  210.          Index           =   2
  211.          Left            =   240
  212.          TabIndex        =   22
  213.          Top             =   2880
  214.          Width           =   4095
  215.          Begin VB.OptionButton optLevel 
  216.             Caption         =   "None - fastest"
  217.             Height          =   255
  218.             Index           =   0
  219.             Left            =   360
  220.             TabIndex        =   26
  221.             Top             =   240
  222.             Width           =   1335
  223.          End
  224.          Begin VB.OptionButton optLevel 
  225.             Caption         =   "Minimum"
  226.             Height          =   255
  227.             Index           =   1
  228.             Left            =   360
  229.             TabIndex        =   25
  230.             Top             =   480
  231.             Width           =   1335
  232.          End
  233.          Begin VB.OptionButton optLevel 
  234.             Caption         =   "Normal"
  235.             Height          =   255
  236.             Index           =   2
  237.             Left            =   360
  238.             TabIndex        =   24
  239.             Top             =   720
  240.             Value           =   -1  'True
  241.             Width           =   1335
  242.          End
  243.          Begin VB.OptionButton optLevel 
  244.             Caption         =   "Maximum - slowest"
  245.             Height          =   255
  246.             Index           =   3
  247.             Left            =   360
  248.             TabIndex        =   23
  249.             Top             =   960
  250.             Width           =   1935
  251.          End
  252.       End
  253.       Begin VB.Frame fraOption 
  254.          Caption         =   "Do you want to encrypt the files in this archive?"
  255.          Height          =   1215
  256.          Index           =   1
  257.          Left            =   240
  258.          TabIndex        =   21
  259.          Top             =   1440
  260.          Width           =   4095
  261.          Begin VB.TextBox txtPassword 
  262.             Enabled         =   0   'False
  263.             Height          =   285
  264.             Left            =   1120
  265.             TabIndex        =   39
  266.             Top             =   720
  267.             Width           =   2640
  268.          End
  269.          Begin VB.OptionButton optEncrypt 
  270.             Caption         =   "No"
  271.             Height          =   255
  272.             Index           =   1
  273.             Left            =   360
  274.             TabIndex        =   37
  275.             Top             =   240
  276.             Value           =   -1  'True
  277.             Width           =   855
  278.          End
  279.          Begin VB.OptionButton optEncrypt 
  280.             Caption         =   "Yes"
  281.             Height          =   255
  282.             Index           =   0
  283.             Left            =   360
  284.             TabIndex        =   36
  285.             Top             =   480
  286.             Width           =   615
  287.          End
  288.          Begin VB.Label lblPassword 
  289.             Caption         =   "Password"
  290.             Enabled         =   0   'False
  291.             Height          =   255
  292.             Left            =   360
  293.             TabIndex        =   38
  294.             Top             =   760
  295.             Width           =   740
  296.          End
  297.       End
  298.       Begin VB.Frame fraOption 
  299.          Caption         =   "Do you want to store the full path information ?"
  300.          Height          =   855
  301.          Index           =   0
  302.          Left            =   240
  303.          TabIndex        =   20
  304.          Top             =   360
  305.          Width           =   4095
  306.          Begin VB.OptionButton optFull 
  307.             Caption         =   "No"
  308.             Height          =   255
  309.             Index           =   1
  310.             Left            =   360
  311.             TabIndex        =   35
  312.             Top             =   240
  313.             Width           =   855
  314.          End
  315.          Begin VB.OptionButton optFull 
  316.             Caption         =   "Yes"
  317.             Height          =   255
  318.             Index           =   0
  319.             Left            =   360
  320.             TabIndex        =   34
  321.             Top             =   480
  322.             Value           =   -1  'True
  323.             Width           =   855
  324.          End
  325.       End
  326.    End
  327.    Begin VB.Frame fraStep 
  328.       Caption         =   "Archive name"
  329.       Height          =   4695
  330.       Index           =   0
  331.       Left            =   3000
  332.       TabIndex        =   3
  333.       Top             =   240
  334.       Width           =   4575
  335.       Begin VB.CommandButton cmdBrowse 
  336.          Caption         =   "Browse..."
  337.          Enabled         =   0   'False
  338.          Height          =   375
  339.          Left            =   2880
  340.          TabIndex        =   7
  341.          Top             =   1080
  342.          Width           =   1455
  343.       End
  344.       Begin VB.TextBox txtArchive 
  345.          Height          =   285
  346.          Left            =   240
  347.          TabIndex        =   6
  348.          Top             =   720
  349.          Width           =   4095
  350.       End
  351.       Begin VB.Label lblArchive 
  352.          Caption         =   "Please enter the name of an archive or press Browse..."
  353.          Height          =   375
  354.          Left            =   240
  355.          TabIndex        =   5
  356.          Top             =   360
  357.          Width           =   3975
  358.       End
  359.    End
  360.    Begin VB.Frame fraStep 
  361.       Caption         =   "Files to compress"
  362.       Height          =   4695
  363.       Index           =   1
  364.       Left            =   2640
  365.       TabIndex        =   4
  366.       Top             =   240
  367.       Width           =   4575
  368.       Begin VB.CommandButton cmdRemove 
  369.          Caption         =   "Remove"
  370.          Enabled         =   0   'False
  371.          Height          =   375
  372.          Left            =   1800
  373.          TabIndex        =   18
  374.          Top             =   2640
  375.          Width           =   1455
  376.       End
  377.       Begin VB.CommandButton cmdAdd 
  378.          Caption         =   "Add"
  379.          Enabled         =   0   'False
  380.          Height          =   375
  381.          Left            =   240
  382.          TabIndex        =   16
  383.          Top             =   2640
  384.          Width           =   1455
  385.       End
  386.       Begin VB.DriveListBox Drive1 
  387.          Height          =   315
  388.          Left            =   2400
  389.          TabIndex        =   11
  390.          Top             =   2230
  391.          Width           =   1935
  392.       End
  393.       Begin VB.DirListBox Dir1 
  394.          Height          =   1155
  395.          Left            =   2400
  396.          TabIndex        =   10
  397.          Top             =   960
  398.          Width           =   1935
  399.       End
  400.       Begin VB.FileListBox File1 
  401.          Height          =   1560
  402.          Left            =   240
  403.          TabIndex        =   9
  404.          Top             =   960
  405.          Width           =   2052
  406.       End
  407.       Begin VB.ListBox lstSelected 
  408.          Height          =   1368
  409.          Left            =   240
  410.          TabIndex        =   8
  411.          Top             =   3120
  412.          Width           =   4092
  413.       End
  414.       Begin VB.Label Label2 
  415.          Caption         =   "Browse for the files to be compressed to the archive, and add them to the list box"
  416.          Height          =   375
  417.          Left            =   240
  418.          TabIndex        =   15
  419.          Top             =   360
  420.          Width           =   4095
  421.       End
  422.    End
  423. Attribute VB_Name = "frmWizard"
  424. Attribute VB_Creatable = False
  425. Attribute VB_Exposed = False
  426. Option Explicit
  427. Private m_iStep As Integer
  428. Private Const m_cMaxSteps = 4
  429. Sub DisplaySummary()
  430.     Dim sSummary As String
  431.     Dim CRLF As String * 2
  432.     Dim I As Integer
  433.     CRLF = Chr$(13) & Chr$(10)
  434.     sSummary = "Compress the following " & Format$(lstSelected.ListCount) & " file"
  435.     If (lstSelected.ListCount > 1) Then
  436.         sSummary = sSummary & "s"
  437.     End If
  438.     sSummary = sSummary & " to the archive " & txtArchive.Text & "." & CRLF & CRLF
  439.     For I = 0 To lstSelected.ListCount - 1
  440.         sSummary = sSummary & Chr$(9) & lstSelected.List(I) & CRLF
  441.     Next I
  442.     sSummary = sSummary & CRLF
  443.     sSummary = sSummary & "Selected options " & CRLF
  444.     If (optFull(0).Value) Then
  445.         sSummary = sSummary & Chr(9) & "Full path information saved" & CRLF
  446.     Else
  447.         sSummary = sSummary & Chr(9) & "Only filenames saved" & CRLF
  448.     End If
  449.     If (optEncrypt(0).Value) Then
  450.         sSummary = sSummary & Chr(9) & "Files will be encrypted" & CRLF
  451.     Else
  452.         sSummary = sSummary & Chr(9) & "Files will not be encrypted" & CRLF
  453.     End If
  454.     If (optLevel(0).Value) Then
  455.         sSummary = sSummary & Chr(9) & "Files will be stored without compression" & CRLF
  456.     ElseIf (optLevel(1).Value) Then
  457.         sSummary = sSummary & Chr(9) & "Files will hame minimum compressed" & CRLF
  458.     ElseIf (optLevel(2).Value) Then
  459.         sSummary = sSummary & Chr(9) & "Files will have normal compression" & CRLF
  460.     Else
  461.         sSummary = sSummary & Chr(9) & "Files will have maximum compression" & CRLF
  462.     End If
  463.     If (optSpan(0).Value) Then
  464.         sSummary = sSummary & Chr(9) & "Archive may span multiple disks" & CRLF
  465.     Else
  466.         sSummary = sSummary & Chr(9) & "Archive will not span disks" & CRLF
  467.     End If
  468.     If (optLFN(0).Value) Then
  469.         sSummary = sSummary & Chr(9) & "Long filenames will be stored" & CRLF
  470.     Else
  471.         sSummary = sSummary & Chr(9) & "Short (8.3) filenames will be stored" & CRLF
  472.     End If
  473.     If (optComment(0).Value) Then
  474.         sSummary = sSummary & Chr(9) & "Archive will have a comment added" & CRLF
  475.     End If
  476.     txtSummary.Text = Trim$(sSummary)
  477. End Sub
  478. Private Sub cmdAdd_Click()
  479.     Dim sFilename As String
  480.     sFilename = File1.Path
  481.     If (Right$(sFilename, 1) <> "\") Then
  482.         sFilename = sFilename & "\"
  483.     End If
  484.     sFilename = sFilename & File1.filename
  485.     lstSelected.AddItem sFilename
  486.     If (lstSelected.ListCount = 1) Then
  487.         cmdNext.Enabled = True
  488.         cmdFinish.Enabled = True
  489.         cmdRemove.Enabled = True
  490.     End If
  491. End Sub
  492. Private Sub cmdBack_Click()
  493.     If (m_iStep > 0) Then
  494.         fraStep(m_iStep).Visible = False
  495.         If (m_iStep = m_cMaxSteps) Then
  496.             cmdNext.Enabled = True
  497.         End If
  498.         m_iStep = m_iStep - 1
  499.         If (m_iStep = 0) Then
  500.             cmdBack.Enabled = False
  501.         End If
  502.         fraStep(m_iStep).Visible = True
  503.     End If
  504. End Sub
  505. Private Sub cmdCancel_Click()
  506.     End
  507. End Sub
  508. Private Sub cmdFinish_Click()
  509.     If (fraStep(m_cMaxSteps).Visible = False) Then
  510.         DisplaySummary
  511.         fraStep(m_iStep).Visible = False
  512.         fraStep(m_cMaxSteps).Visible = True
  513.         m_iStep = m_cMaxSteps
  514.     End If
  515.     frmZIP.Show 1
  516.     End
  517. End Sub
  518. Private Sub cmdNext_Click()
  519.     Dim iDrive As Integer
  520.     If (m_iStep < m_cMaxSteps) Then
  521.         fraStep(m_iStep).Visible = False
  522.         If (m_iStep = 0) Then
  523.             cmdBack.Enabled = True
  524.             If (InStr(txtArchive.Text, ":")) Then
  525.                 iDrive = Asc(UCase$(Left(txtArchive.Text, 1))) - 65
  526.                 If (GetDriveType(iDrive) <> DRIVE_REMOVABLE) Then
  527.                     fraOption(4).Enabled = False
  528.                     optSpan(0).Enabled = False
  529.                     optSpan(1).Enabled = False
  530.                 Else
  531.                     fraOption(4).Enabled = True
  532.                     optSpan(0).Enabled = True
  533.                     optSpan(1).Enabled = True
  534.                 End If
  535.             Else
  536.                 fraOption(4).Enabled = False
  537.                 optSpan(0).Enabled = False
  538.                 optSpan(1).Enabled = False
  539.             End If
  540.         End If
  541.         m_iStep = m_iStep + 1
  542.         If (m_iStep = m_cMaxSteps) Then
  543.             cmdNext.Enabled = False
  544.             DisplaySummary
  545.         End If
  546.         fraStep(m_iStep).Visible = True
  547.     End If
  548. End Sub
  549. Private Sub cmdRemove_Click()
  550.     lstSelected.RemoveItem lstSelected.ListIndex
  551.     If (lstSelected.ListCount = 0) Then
  552.         cmdNext.Enabled = False
  553.         cmdFinish.Enabled = False
  554.         cmdRemove.Enabled = False
  555.     End If
  556. End Sub
  557. Private Sub Dir1_Change()
  558.     File1.Path = Dir1.Path
  559.     cmdAdd.Enabled = False
  560. End Sub
  561. Private Sub Drive1_Change()
  562.     Dir1.Path = Drive1.Drive
  563. End Sub
  564. Private Sub File1_Click()
  565.     cmdAdd.Enabled = True
  566. End Sub
  567. Private Sub File1_DblClick()
  568.     cmdAdd_Click
  569. End Sub
  570. Private Sub Form_Load()
  571.     Dim I As Integer
  572.     m_iStep = 0
  573.     fraStep(m_iStep).ZOrder
  574.     For I = 0 To m_cMaxSteps
  575.         fraStep(I).Move 2640, 240, 4575, 4695
  576.         If (I > 0) Then
  577.             fraStep(I).Visible = False
  578.         End If
  579.     Next I
  580.     txtSummary.BackColor = frmWizard.BackColor
  581.     Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
  582. End Sub
  583. Private Sub lstSelected_DblClick()
  584.     cmdRemove_Click
  585. End Sub
  586. Private Sub optComment_Click(Index As Integer)
  587.     If (Index = 0) Then
  588.         lblComment.Enabled = True
  589.         txtComment.Enabled = True
  590.     Else
  591.         lblComment.Enabled = False
  592.         txtComment.Enabled = False
  593.     End If
  594. End Sub
  595. Private Sub optEncrypt_Click(Index As Integer)
  596.     If (Index = 0) Then
  597.         txtPassword.Enabled = True
  598.         lblPassword.Enabled = True
  599.     Else
  600.         txtPassword.Enabled = False
  601.         lblPassword.Enabled = False
  602.     End If
  603. End Sub
  604. Private Sub txtArchive_Change()
  605.     If (Len(txtArchive.Text) = 0) Then
  606.         cmdNext.Enabled = False
  607.     Else
  608.         cmdNext.Enabled = True
  609.     End If
  610. End Sub
  611.