home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
- Begin VB.Form frmSfx
- BorderStyle = 1 'Fixed Single
- Caption = "Self-extracting zip file options"
- ClientHeight = 5205
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 8280
- ControlBox = 0 'False
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5205
- ScaleWidth = 8280
- StartUpPosition = 2 'CenterScreen
- Begin VB.ComboBox cmbSelfBinModule
- Enabled = 0 'False
- Height = 315
- ItemData = "frmSfx.frx":0000
- Left = 2400
- List = "frmSfx.frx":0002
- Style = 2 'Dropdown List
- TabIndex = 1
- Top = 690
- Width = 1935
- End
- Begin VB.CommandButton cmdIcon
- Caption = "Browse"
- Height = 285
- Left = 6000
- TabIndex = 8
- Top = 4440
- Width = 735
- End
- Begin VB.TextBox txtIcon
- Height = 285
- Left = 2280
- TabIndex = 9
- Top = 4800
- Width = 3615
- End
- Begin VB.CommandButton cmbReadme
- Caption = "Browse"
- Height = 285
- Left = 6000
- TabIndex = 6
- Top = 4050
- Width = 735
- End
- Begin VB.TextBox txtReadme
- Height = 285
- Left = 2280
- TabIndex = 7
- Top = 4440
- Width = 3615
- End
- Begin VB.TextBox txtDefaultFolder
- Height = 285
- Left = 2280
- TabIndex = 5
- Top = 4050
- Width = 3615
- End
- Begin VB.Frame fraStrings
- Caption = "Strings and Messages"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 2695
- Left = 120
- TabIndex = 11
- Top = 1200
- Width = 6615
- Begin VB.TextBox txtIntro
- Height = 885
- Left = 2160
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 3
- Top = 720
- Width = 4335
- End
- Begin VB.TextBox txtSuccess
- Height = 885
- Left = 2160
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 4
- Top = 1680
- Width = 4335
- End
- Begin VB.TextBox txtSWindowTitle
- Height = 285
- Left = 2160
- TabIndex = 2
- Top = 360
- Width = 4335
- End
- Begin VB.Label lbIntro
- Caption = "Introduction message:"
- Height = 255
- Left = 120
- TabIndex = 19
- Top = 720
- Width = 1815
- End
- Begin VB.Label lblSuccess
- Caption = "Success message:"
- Height = 255
- Left = 120
- TabIndex = 18
- Top = 1680
- Width = 1455
- End
- Begin VB.Label lblWindowTitle
- Caption = "Self-extracting zip file's title:"
- Height = 255
- Left = 120
- TabIndex = 13
- Top = 360
- Width = 2175
- End
- End
- Begin MSComDlg.CommonDialog dlgSelect
- Left = 7680
- Top = 4680
- _ExtentX = 847
- _ExtentY = 847
- _Version = 393216
- End
- Begin VB.CommandButton cmdOk
- Caption = "&OK"
- Height = 375
- Left = 6930
- TabIndex = 10
- Top = 150
- Width = 1215
- End
- Begin VB.CheckBox chkMakeSfx
- Caption = "Create a &self-extracting zip file"
- Height = 255
- Left = 120
- TabIndex = 0
- Top = 240
- Width = 3135
- End
- Begin VB.CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "&Cancel"
- Height = 375
- Left = 6930
- TabIndex = 12
- Top = 600
- Width = 1215
- End
- Begin VB.Label lblBinModule
- Caption = "Type of self-extracting zip file:"
- Enabled = 0 'False
- Height = 255
- Left = 120
- TabIndex = 17
- Top = 720
- Width = 2295
- End
- Begin VB.Label lblIcon
- Caption = "SFX file's icon:"
- Height = 255
- Left = 120
- TabIndex = 16
- Top = 4800
- Width = 1935
- End
- Begin VB.Label lblReadme
- Caption = "Readme file to display:"
- Height = 255
- Left = 120
- TabIndex = 15
- Top = 4440
- Width = 2055
- End
- Begin VB.Label lblDefaultUnzipFolder
- Caption = "Default folder to unzip files to:"
- Height = 255
- Left = 120
- TabIndex = 14
- Top = 4080
- Width = 2415
- End
- Attribute VB_Name = "frmSfx"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- '=============================================================================
- ' Description: The frmSfx form lets the user customize some of Xceed Zip's
- ' Self-Extractor Module's settings.
- '=============================================================================
- '-----------------------------------------------------------------------------
- ' Displays the form, initializes its controls values and loads them to
- ' XceedZip's properties if OK is clicked.
- '-----------------------------------------------------------------------------
- Public Function ShowForm(xZip As XceedZip) As Boolean
- Me.Tag = "0"
- Call InitializeForm(xZip)
- Me.Show vbModal
- If chkMakeSfx.Value = vbUnchecked Then
- Me.Tag = "0"
- End If
- If Me.Tag = "1" Then
- Call LoadDatatoXceedZip(xZip)
- Else
- xZip.SfxBinaryModule = ""
- End If
- ShowForm = (frmSfx.Tag = "1")
- End Function
- '-----------------------------------------------------------------------------
- ' If cancel is clicked, tag stays at "0" and the form is hidden
- '-----------------------------------------------------------------------------
- Private Sub cmdCancel_Click()
- Me.Hide
- End Sub
- '-----------------------------------------------------------------------------
- ' Opens a Dialog Box permitting the user to choose the icon file.
- '-----------------------------------------------------------------------------
- Private Sub cmdIcon_Click()
- Dim sSelectedFile As String
-
- With Me.dlgSelect
- .FileName = ""
- .Flags = cdlOFNFileMustExist + cdlOFNNoChangeDir + cdlOFNHideReadOnly
- .Filter = "Icon files (*.ico)|*.ico"
- .MaxFileSize = 32000
- .DialogTitle = "Select icon file"
- .InitDir = App.Path
- .Action = 1
- End With
-
- If dlgSelect.FileName <> "" Then
- txtIcon.Text = dlgSelect.FileName
- End If
- End Sub
- '-----------------------------------------------------------------------------
- ' The MakeSfx checkbox is clicked and is the value is "unchecked", the controls
- ' on the form are disabled. In the value is "checked", the controls on the form
- ' are enabled.
- '-----------------------------------------------------------------------------
- Private Sub chkMakeSfx_Click()
- If chkMakeSfx.Value = vbUnchecked Then
- Call DisableAll
- Else
- Call EnableAll
- End If
- End Sub
- '-----------------------------------------------------------------------------
- ' Ok is pressed and Tag takes the "1" value. The form is then hidden.
- '-----------------------------------------------------------------------------
- Private Sub cmdOk_Click()
- Me.Tag = "1"
- Me.Hide
- End Sub
- '-----------------------------------------------------------------------------
- ' Opens a Dialog Box permitting the user to choose the readme file.
- '-----------------------------------------------------------------------------
- Private Sub cmbReadme_Click()
- Dim sSelectedFile As String
-
- With Me.dlgSelect
- .FileName = ""
- .Flags = cdlOFNFileMustExist + cdlOFNNoChangeDir + cdlOFNHideReadOnly
- .Filter = "Readme files (*.txt)|*.txt"
- .MaxFileSize = 32000
- .DialogTitle = "Select readme file"
- .InitDir = App.Path
- .Action = 1
- End With
-
- If dlgSelect.FileName <> "" Then
- txtReadme.Text = dlgSelect.FileName
- End If
- End Sub
- '-----------------------------------------------------------------------------
- ' Disables all the controls on the form
- '-----------------------------------------------------------------------------
- Private Sub DisableAll()
- cmbSelfBinModule.Enabled = False
- txtSWindowTitle.Enabled = False
- txtSWindowTitle.BackColor = &H8000000F
- txtSuccess.Enabled = False
- txtSuccess.BackColor = &H8000000F
- txtIntro.Enabled = False
- txtIntro.BackColor = &H8000000F
- txtDefaultFolder.Enabled = False
- txtDefaultFolder.BackColor = &H8000000F
- txtReadme.Enabled = False
- txtReadme.BackColor = &H8000000F
- cmbReadme.Enabled = False
- txtIcon.Enabled = False
- txtIcon.BackColor = &H8000000F
- cmdIcon.Enabled = False
- End Sub
- '-----------------------------------------------------------------------------
- ' Enables all the controls on the form.
- '-----------------------------------------------------------------------------
- Private Sub EnableAll()
- cmbSelfBinModule.Enabled = True
- txtSWindowTitle.Enabled = True
- txtSWindowTitle.BackColor = &H80000005
- txtSuccess.Enabled = True
- txtSuccess.BackColor = &H80000005
- txtIntro.Enabled = True
- txtIntro.BackColor = &H80000005
- txtDefaultFolder.Enabled = True
- txtDefaultFolder.BackColor = &H80000005
- txtReadme.Enabled = True
- txtReadme.BackColor = &H80000005
- cmbReadme.Enabled = True
- txtIcon.Enabled = True
- txtIcon.BackColor = &H80000005
- cmdIcon.Enabled = True
- End Sub
- '-----------------------------------------------------------------------------
- ' Initializes the Binary module combo box
- '-----------------------------------------------------------------------------
- Private Sub InitializeBinModuleCombo(xZip As XceedZip)
- cmbSelfBinModule.AddItem ("16-bit Self-Extractor")
- cmbSelfBinModule.AddItem ("32-bit Self-Extractor")
- cmbSelfBinModule.Text = cmbSelfBinModule.List(1)
- End Sub
- '-----------------------------------------------------------------------------
- ' Inializes the form with XceedZip's values
- '-----------------------------------------------------------------------------
- Private Sub InitializeForm(xZip As XceedZip)
- If xZip.SfxBinaryModule = "" Then
- chkMakeSfx.Value = vbUnchecked
- DisableAll
- Else
- chkMakeSfx.Value = vbChecked
- EnableAll
- End If
- Call InitializeBinModuleCombo(xZip)
- Call InitializeStringsAndMessages(xZip)
- txtDefaultFolder.Text = xZip.SfxDefaultUnzipToFolder
- txtReadme.Text = xZip.SfxReadmeFile
- txtIcon.Text = xZip.SfxIconFilename
- End Sub
- '-----------------------------------------------------------------------------
- ' Initializes the strings and messages controls with XceedZip's values.
- '-----------------------------------------------------------------------------
- Private Sub InitializeStringsAndMessages(xZip As XceedZip)
- txtSWindowTitle.Text = xZip.SfxStrings(xssTitle)
- txtSuccess.Text = xZip.SfxMessages(xsmSuccess)
- txtIntro.Text = xZip.SfxMessages(xsmIntro)
- End Sub
- '-----------------------------------------------------------------------------
- ' Calls functions to load the form's control values to XceedZip's properties.
- '-----------------------------------------------------------------------------
- Private Sub LoadDatatoXceedZip(xZip As XceedZip)
- Call LoadSelfExtractBinModule(xZip)
- Call LoadMessagesAndStrings(xZip)
- xZip.SfxDefaultUnzipToFolder = txtDefaultFolder.Text
- xZip.SfxReadmeFile = txtReadme.Text
- End Sub
- '-----------------------------------------------------------------------------
- ' Loads XceedZip's Message and Strings values to the control values.
- '-----------------------------------------------------------------------------
- Private Sub LoadMessagesAndStrings(xZip As XceedZip)
- xZip.SfxStrings(xssTitle) = txtSWindowTitle.Text
- xZip.SfxMessages(xsmSuccess) = txtSuccess.Text
- xZip.SfxMessages(xsmIntro) = txtIntro.Text
- xZip.SfxIconFilename = txtIcon.Text
- End Sub
- '-----------------------------------------------------------------------------
- ' Loads the appropriate self-extracting binary module from the combo box.
- '-----------------------------------------------------------------------------
- Private Sub LoadSelfExtractBinModule(xZip As XceedZip)
- If cmbSelfBinModule.ListIndex = 0 Then
- xZip.SfxBinaryModule = App.Path & "\..\..\..\Sfx\Xcdsfx16.bin"
- Else
- xZip.SfxBinaryModule = App.Path & "\..\..\..\Sfx\Xcdsfx32.bin"
- End If
- End Sub
-