Update of /cvsroot/jvcl/dev/JVCL3/qexamples/JvZLibMultiple In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2296/JVCL3/qexamples/JvZLibMultiple Added Files: JvQZLibMultipleDemo.dof JvQZLibMultipleDemo.dpr JvQZLibMultipleDemo.kof JvQZLibMultipleMainFormU.pas JvQZLibMultipleMainFormU.xfm Log Message: added --- NEW FILE: JvQZLibMultipleMainFormU.xfm --- object JvZLibMultipleMainForm: TJvZLibMultipleMainForm Left = 306 Top = 160 Width = 368 Height = 231 VertScrollBar.Range = 165 HorzScrollBar.Range = 114 ActiveControl = edSrcFolder BorderIcons = [biSystemMenu, biMinimize] BorderStyle = fbsSingle Caption = 'JvZlibMultiple Demo' Color = clButton Font.Color = clText Font.Height = 11 Font.Name = 'MS Shell Dlg 2' Font.Pitch = fpVariable Font.Style = [] Font.Weight = 40 Icon.Data = { 0000010001002020100001001000E80200001600000028000000200000004000 0000010004000000000080020000000000000000000000000000000000000000 0000000080000080000000808000800000008000800080800000C0C0C0008080 80000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 000000000000000000000000000000000000CCCCCCCCCCCCCCCC000000000000 00CCCCBBBBBBCCCCCCCCCC00000000000CCCBBBCCCCBBBCCCCCCCCC000000000 0CCBBCCCCCCCCBBBCCCCCCC000000000CCCBBCCCCCCCCBBBCCCCCCCC00000000 CCBBBBCCCCCCCBBBBCCCCCCC00000000CCBBBBCCCCCCCCBBBBCCCCCC00000000 CCBBBBBCCCCCCCBBBBCCCCCC00000000CCBBBBBCCCCCCCBBBBCCCCCC00000000 CCBBBBBCCCCCCCBBBBCCCCCC00000000CCCBBBCCCCCCCCBBBBCCCCCC00000000 CCCCCCCCCCCCCCBBBBCCCCCC00000000CCCCCCCCCCCCCCBBBBCCCCCC00000000 CCCCCCCCCCCCCCBBBBCCCCCC00000000CCCCCCCCCCCCCCBBBBCCCCCC00000000 CCCCCCCCCCCCCCBBBBCCCCCC00000000CCCCCCCCCCCCCCBBBBCCCCCC00000000 CCCCCCCCCCCCCCBBBBCCCCCC00000000CCCCCCCCCCCCCCBBBBCCCCCC00000000 CCCCCCCCCCCCCCBBBBCCCCCC00000000CCCCCCCCCCCCCCBBBBCCCCCC00000000 CCCCCCCCCCCCCCBBBBCCCCCC00000000CCCCCCCCCCCCCCBBBBCCCCCC00000000 CCCCCCCCCCCCCCBBBBCCCCCC00000000CCCCCCCCCCCCCCBBBBCCCCCC00000000 CCCCCCCCCCCCCCBBBBCCCCCC00000000CCCCCCCCCCCCCCBBBBCCCCCC00000000 CCCCCCCCCCCCBBBBBBBCCCCC00000000CCCCCCCCCCBBBBBBBBBBBBCC00000000 CCCCCCCCCCCCCCCCCCCCCCCC000000000000000000000000000000000000FF00 00FFFC00003FF800001FF000000FF000000FE0000007E0000007E0000007E000 0007E0000007E0000007E0000007E0000007E0000007E0000007E0000007E000 0007E0000007E0000007E0000007E0000007E0000007E0000007E0000007E000 0007E0000007E0000007E0000007E0000007E0000007E0000007E0000007} ParentFont = False Position = poDesktopCenter Scaled = False OnShow = FormShow PixelsPerInch = 96 object pbProgress: TProgressBar Left = 0 Top = 215 Width = 368 Height = 16 Align = alBottom end object Label1: TLabel Left = 8 Top = 8 Width = 68 Height = 13 Caption = 'Source folder:' end object Label2: TLabel Left = 8 Top = 112 Width = 106 Height = 13 Caption = 'Decompress to folder:' end object Label3: TLabel Left = 8 Top = 56 Width = 75 Height = 13 Caption = 'Destination file:' end object lblFilename: TLabel Left = 8 Top = 196 Width = 31 Height = 13 Anchors = [akLeft, akBottom] Caption = 'Ready' end object btnCompress: TButton Left = 191 Top = 182 Width = 75 Height = 25 Anchors = [akRight, akBottom] Caption = '&Compress' Enabled = False TabOrder = 6 OnClick = btnCompressClick end object btnUnCompress: TButton Left = 281 Top = 182 Width = 75 Height = 25 Anchors = [akRight, akBottom] Caption = '&Decompress' Enabled = False TabOrder = 7 OnClick = btnUnCompressClick end object edSrcFolder: TEdit Left = 8 Top = 24 Width = 320 Height = 21 Anchors = [akLeft, akTop, akRight] TabOrder = 0 Text = 'C:\temp' OnChange = edSrcFolderChange end object edDestFolder: TEdit Left = 8 Top = 128 Width = 320 Height = 21 Anchors = [akLeft, akTop, akRight] TabOrder = 4 Text = 'C:\temp\dc' OnChange = edDestFolderChange end object edFilename: TEdit Left = 8 Top = 72 Width = 320 Height = 21 Anchors = [akLeft, akTop, akRight] TabOrder = 2 Text = 'C:\temp\temp.z' OnChange = edSrcFolderChange end object btnSrc: TButton Left = 333 Top = 24 Width = 21 Height = 21 Anchors = [akTop, akRight] Caption = '...' TabOrder = 1 OnClick = btnSrcClick end object btnDestFile: TButton Left = 333 Top = 72 Width = 21 Height = 21 Anchors = [akTop, akRight] Caption = '...' TabOrder = 3 OnClick = btnDestFileClick end object btnDestFolder: TButton Left = 333 Top = 128 Width = 21 Height = 21 Anchors = [akTop, akRight] Caption = '...' TabOrder = 5 OnClick = btnDestFolderClick end end --- NEW FILE: JvQZLibMultipleMainFormU.pas --- {******************************************************************************} {* WARNING: JEDI VCL To CLX Converter generated unit. *} {* Manual modifications will be lost on next release. *} {******************************************************************************} {****************************************************************** JEDI-VCL Demo Copyright (C) 2002 Project JEDI Original author: Contributor(s): You may retrieve the latest version of this file at the JEDI-JVCL home page, located at http://jvcl.sourceforge.net The contents of this file are used with permission, subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1_1Final.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. ******************************************************************} {$I jvcl.inc} unit JvQZLibMultipleMainFormU; interface uses QWindows, QMessages, SysUtils, Classes, Types, QGraphics, QControls, QForms, QDialogs, JvQZLibMultiple, QStdCtrls, QComCtrls; type TJvZLibMultipleMainForm = class(TForm) btnCompress: TButton; btnUnCompress: TButton; Label1: TLabel; edSrcFolder: TEdit; Label2: TLabel; edDestFolder: TEdit; Label3: TLabel; edFilename: TEdit; pbProgress: TProgressBar; lblFilename: TLabel; btnSrc: TButton; btnDestFile: TButton; btnDestFolder: TButton; procedure btnCompressClick(Sender: TObject); procedure btnUnCompressClick(Sender: TObject); procedure edDestFolderChange(Sender: TObject); procedure edSrcFolderChange(Sender: TObject); procedure FormShow(Sender: TObject); procedure btnSrcClick(Sender: TObject); procedure btnDestFolderClick(Sender: TObject); procedure btnDestFileClick(Sender: TObject); private { Private declarations } procedure DoProgress(Sender: TObject; Position, Total: Integer); procedure DoCompressFile(Sender: TObject; const Filename: string); end; var JvZLibMultipleMainForm: TJvZLibMultipleMainForm; implementation uses JvQBrowseFolder; {$R *.xfm} procedure TJvZLibMultipleMainForm.DoCompressFile(Sender:TObject;const Filename:string); begin lblFilename.Caption := Filename; Update; end; procedure TJvZLibMultipleMainForm.btnCompressClick(Sender: TObject); var z : TJvZlibMultiple; begin ForceDirectories(ExtractFilePath(edFilename.Text)); z := TJvZlibMultiple.Create(nil); Screen.Cursor := crHourGlass; try lblFilename.Caption := ''; pbProgress.Position := 0; z.OnProgress := DoProgress; z.OnCompressingFile := DoCompressFile; z.CompressDirectory(edSrcFolder.Text,false,edFilename.Text); finally z.Free; Screen.Cursor := crDefault; end; pbProgress.Position := 0; lblFilename.Caption := 'Ready'; end; procedure TJvZLibMultipleMainForm.btnUnCompressClick(Sender: TObject); var z:TJvZlibMultiple; begin z := TJvZlibMultiple.Create(nil); Screen.Cursor := crHourGlass; try lblFilename.Caption := ''; pbProgress.Position := 0; z.OnProgress := DoProgress; z.OnDecompressingFile := DoCompressFile; z.DecompressFile(edFilename.Text,edDestFolder.Text,true); finally z.Free; Screen.Cursor := crDefault; end; pbProgress.Position := 0; lblFilename.Caption := 'Ready'; end; procedure TJvZLibMultipleMainForm.DoProgress(Sender: TObject; Position, Total: Integer); begin pbProgress.Max := Total; pbProgress.Position := Position; Update; end; procedure TJvZLibMultipleMainForm.edDestFolderChange(Sender: TObject); begin btnUnCompress.Enabled := edDestFolder.Text <> ''; end; procedure TJvZLibMultipleMainForm.edSrcFolderChange(Sender: TObject); begin btnCompress.Enabled := DirectoryExists(edSrcFolder.Text) and (edFilename.Text <> ''); end; procedure TJvZLibMultipleMainForm.FormShow(Sender: TObject); begin edSrcFolderChange(Sender); edDestFolderChange(Sender); end; procedure TJvZLibMultipleMainForm.btnSrcClick(Sender: TObject); var S:string; begin S := edSrcFolder.Text; if BrowseForFolder('Select source folder',false,S) then edSrcFolder.Text := S; end; procedure TJvZLibMultipleMainForm.btnDestFolderClick(Sender: TObject); var S:string; begin S := edDestFolder.Text; if BrowseForFolder('Select source folder',true,S) then edDestFolder.Text := S; end; procedure TJvZLibMultipleMainForm.btnDestFileClick(Sender: TObject); begin with TSaveDialog.Create(self) do try InitialDir := '.'; Title := 'Select destination file'; Filename := edFilename.Text; if Execute then edFilename.Text := Filename; finally Free; end; end; end. --- NEW FILE: JvQZLibMultipleDemo.dpr --- program JvQZLibMultipleDemo; uses QForms, JvQZLibMultipleMainFormU in 'JvQZLibMultipleMainFormU.pas' {JvZLibMultipleMainForm}; {$R *.res} begin Application.Initialize; Application.CreateForm(TJvZLibMultipleMainForm, JvZLibMultipleMainForm); Application.Run; end. --- NEW FILE: JvQZLibMultipleDemo.dof --- [Compiler] UnsafeType=0 UnsafeCode=0 UnsafeCast=0 [Directories] OutputDir=..\bin UnitOutputDir=..\dcu SearchPath=..\..\qrun;..\..\qcommon;..\..\common --- NEW FILE: JvQZLibMultipleDemo.kof --- [Compiler] UnsafeType=0 UnsafeCode=0 UnsafeCast=0 [Directories] OutputDir=../bin UnitOutputDir=../dcu SearchPath=../../qrun;../../qcommon;../../common |