home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmOptions
- BorderStyle = 1 'Fixed Single
- Caption = "Zip Manager Options"
- ClientHeight = 4470
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 4605
- ClipControls = 0 'False
- ControlBox = 0 'False
- Icon = "frmOptions.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4470
- ScaleWidth = 4605
- StartUpPosition = 1 'CenterOwner
- Begin VB.Frame fraExtraHeaders
- Caption = "Store extra information in the zip file"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 1335
- Left = 120
- TabIndex = 14
- Top = 2520
- Width = 4335
- Begin VB.CheckBox chkExtraSecurityDsc
- Caption = "Windows NT file security and permissions"
- Height = 255
- Left = 120
- TabIndex = 9
- Top = 960
- Width = 3615
- End
- Begin VB.CheckBox chkExtraUnicode
- Caption = "Unicode filenames"
- Height = 255
- Left = 120
- TabIndex = 8
- Top = 720
- Width = 2775
- End
- Begin VB.CheckBox chkExtraFileTimes
- Caption = "All time stamps (PKWare data format)"
- Height = 255
- Left = 120
- TabIndex = 7
- Top = 480
- Width = 3015
- End
- Begin VB.CheckBox chkExtraExtTimeStamp
- Caption = "All time stamps (Info-Zip data format)"
- Height = 255
- Left = 120
- TabIndex = 6
- Top = 240
- Width = 3495
- End
- End
- Begin VB.Frame fraTempFolder
- Caption = "Temporary files"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 1050
- Left = 120
- TabIndex = 13
- Top = 1350
- Width = 4335
- Begin VB.CheckBox chkUseTempFolder
- Caption = "Work with temporary zip files for maximum safety"
- Height = 255
- Left = 120
- TabIndex = 3
- Top = 240
- Width = 3975
- End
- Begin VB.TextBox txtTempFolder
- BackColor = &H80000004&
- Enabled = 0 'False
- Height = 285
- Left = 120
- TabIndex = 4
- ToolTipText = "If no path is specified, the default Windows temp directory will be used."
- Top = 600
- Width = 3135
- End
- Begin VB.CommandButton cmdBrowseTempFolder
- Caption = "&Browse"
- Enabled = 0 'False
- Height = 285
- Left = 3360
- TabIndex = 5
- Top = 600
- Width = 855
- End
- End
- Begin VB.Frame fraDiskSpanning
- Caption = "If the disk gets full, span disks..."
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 1095
- Left = 120
- TabIndex = 12
- Top = 120
- Width = 4335
- Begin VB.OptionButton optNever
- Caption = "Never"
- Height = 255
- Left = 120
- TabIndex = 2
- Top = 720
- Width = 1935
- End
- Begin VB.OptionButton optAlways
- Caption = "Always"
- Height = 255
- Left = 120
- TabIndex = 1
- Top = 480
- Width = 1935
- End
- Begin VB.OptionButton optRemovableDrives
- Caption = "Only when writing to removable media"
- Height = 255
- Left = 120
- TabIndex = 0
- Top = 240
- Width = 3255
- End
- End
- Begin VB.CommandButton cmdOk
- Caption = "&OK"
- Height = 375
- Left = 2160
- TabIndex = 10
- Top = 3990
- Width = 1095
- End
- Begin VB.CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "&Cancel"
- Height = 375
- Left = 3360
- TabIndex = 11
- Top = 3990
- Width = 1095
- End
- Attribute VB_Name = "frmOptions"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- '=============================================================================
- ' Description: The frmOptions form allows the user to set some of the
- ' more advanced Xceed Zip's settings:
- ' - Disk spanning options
- ' - Use of temp files
- ' - Which extra headers and file information is stored
- '=============================================================================
- '------------------------------------------------------------------------------------
- 'Calls data loading functions
- '------------------------------------------------------------------------------------
- Private Sub LoadDataToForm(xZip As XceedZip)
- Call LoadDiskSpanningSettings(xZip)
- Call LoadTempFolderSettings(xZip)
- Call LoadExtraHeadersSettings(xZip)
- End Sub
- '------------------------------------------------------------------------------------
- ' Loads the Option button corresponding to xZip's Span mode
- '------------------------------------------------------------------------------------
- Private Sub LoadDiskSpanningSettings(xZip As XceedZip)
- optAlways.Value = (xZip.SpanMultipleDisks = xdsAlways)
- optNever.Value = (xZip.SpanMultipleDisks = xdsNever)
- optRemovableDrives.Value = (xZip.SpanMultipleDisks = xdsRemovableDrivesOnly)
- End Sub
- '------------------------------------------------------------------------------------
- 'Loads the Extra Hearder Settings from the xZip object into the forms controls
- '------------------------------------------------------------------------------------
- Private Sub LoadExtraHeadersSettings(xZip As XceedZip)
- If (xZip.ExtraHeaders And xehExtTimeStamp) Then
- chkExtraExtTimeStamp.Value = Checked
- Else
- chkExtraExtTimeStamp.Value = Unchecked
- End If
- If (xZip.ExtraHeaders And xehFileTimes) Then
- chkExtraFileTimes.Value = Checked
- Else
- chkExtraFileTimes.Value = Unchecked
- End If
- If (xZip.ExtraHeaders And xehSecurityDescriptor) Then
- chkExtraSecurityDsc.Value = Checked
- Else
- chkExtraSecurityDsc.Value = Unchecked
- End If
- If (xZip.ExtraHeaders And xehUnicode) Then
- chkExtraUnicode.Value = Checked
- Else
- chkExtraUnicode.Value = Unchecked
- End If
- End Sub
- '------------------------------------------------------------------------------------
- ' Grays the temp folder textbox if the "work with temp files" checkbox is unchecked
- '------------------------------------------------------------------------------------
- Private Sub LoadTempFolderColor()
- If txtTempFolder.Enabled Then
- txtTempFolder.BackColor = &H80000005
- Else
- txtTempFolder.BackColor = &H8000000F
- End If
- End Sub
- '------------------------------------------------------------------------------------
- ' Loads the temp folder settings. The default windows temporary folder is used if
- ' no particular folder is specified.
- '------------------------------------------------------------------------------------
- Private Sub LoadTempFolderSettings(xZip As XceedZip)
- chkUseTempFolder.Value = IIf(xZip.UseTempFile, vbChecked, vbUnchecked)
- cmdBrowseTempFolder.Enabled = IIf(xZip.UseTempFile, vbChecked, vbUnchecked)
- txtTempFolder.Text = xZip.TempFolder
- Call LoadTempFolderColor
- End Sub
- '------------------------------------------------------------------------------------
- ' Shows the Options window
- '------------------------------------------------------------------------------------
- Public Function ShowForm(xZip As XceedZip) As Boolean
- frmOptions.Tag = "0"
- 'Load xZip's properties into the form's controls.
- Call LoadDataToForm(xZip)
- 'Shows the Options form
- frmOptions.Show vbModal
- ' If tag = "1" then the user clicked on Ok and the form's controls
- ' values are copied in the xZip properties
- If frmOptions.Tag = "1" Then
- Call UpdatexZipSettings(xZip)
- End If
- ShowForm = (frmOptions.Tag = "1")
- End Function
- '------------------------------------------------------------------------------------
- ' Updates xZip's Disk Spanning mode according to the user's
- ' choice.
- '------------------------------------------------------------------------------------
- Private Sub UpdateDiskSpanningSettings(xZip As XceedZip)
- If optAlways Then xZip.SpanMultipleDisks = xdsAlways
- If optNever Then xZip.SpanMultipleDisks = xdsNever
- If optRemovableDrives Then xZip.SpanMultipleDisks = xdsRemovableDrivesOnly
- End Sub
- '------------------------------------------------------------------------------------
- 'Updates xZip's Extra Headers properties based on the data in the
- 'form's controls / checkboxes
- '------------------------------------------------------------------------------------
- Private Sub UpdateExtraHeadersSettings(xZip As XceedZip)
- xZip.ExtraHeaders = 0
- If chkExtraExtTimeStamp.Value = Checked Then
- xZip.ExtraHeaders = xZip.ExtraHeaders + xehExtTimeStamp
- End If
- If chkExtraFileTimes.Value = Checked Then
- xZip.ExtraHeaders = xZip.ExtraHeaders + xehFileTimes
- End If
- If chkExtraSecurityDsc.Value = Checked Then
- xZip.ExtraHeaders = xZip.ExtraHeaders + xehSecurityDescriptor
- End If
- If chkExtraUnicode.Value = Checked Then
- xZip.ExtraHeaders = xZip.ExtraHeaders + xehUnicode
- End If
- End Sub
- '------------------------------------------------------------------------------------
- ' Updates xZip's Temp file / folder settings based on the settings
- ' indicated by the form's controls.
- '------------------------------------------------------------------------------------
- Private Sub UpdateTempFolderSettings(xZip As XceedZip)
- xZip.UseTempFile = (chkUseTempFolder.Value = vbChecked)
- xZip.TempFolder = txtTempFolder.Text
- End Sub
- '------------------------------------------------------------------------------------
- ' Calls updating functions
- '------------------------------------------------------------------------------------
- Private Sub UpdatexZipSettings(xZip As XceedZip)
- Call UpdateDiskSpanningSettings(xZip)
- Call UpdateTempFolderSettings(xZip)
- Call UpdateExtraHeadersSettings(xZip)
- End Sub
- '------------------------------------------------------------------------------------
- ' If the browse button is clicked, the default directory window is shown.
- '------------------------------------------------------------------------------------
- Private Sub cmdBrowseTempFolder_Click()
- Dim PathName As String
- If BrowseForFolder(PathName, "Please select the temp directory") Then
- txtTempFolder.Text = PathName
- End If
- End Sub
- '------------------------------------------------------------------------------------
- 'Enables or disables the tempfolder textbox.
- '------------------------------------------------------------------------------------
- Private Sub chkUseTempFolder_Click()
- txtTempFolder.Enabled = Not txtTempFolder.Enabled
- 'Enables or disables the browse button
- cmdBrowseTempFolder.Enabled = Not cmdBrowseTempFolder.Enabled
- Call LoadTempFolderColor
- End Sub
- '------------------------------------------------------------------------------------
- ' If Cancel is pressed, tag stays at "0" and the window is hidden
- '------------------------------------------------------------------------------------
- Private Sub cmdCancel_Click()
- Me.Hide
- End Sub
- '------------------------------------------------------------------------------------
- ' If OK is pressed, the window is hidden and Tag receives the "1" value
- '------------------------------------------------------------------------------------
- Private Sub cmdOk_Click()
- Tag = "1"
- Me.Hide
- End Sub
-