Стартовый пул

This commit is contained in:
2024-04-02 08:46:59 +03:00
parent fd57fffd3a
commit 3bb34d000b
5591 changed files with 3291734 additions and 0 deletions

View File

@@ -0,0 +1,92 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
unit ExQBinHxU;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TfrmExBinHex = class(TForm)
btnEncode: TButton;
OpenDialog1: TOpenDialog;
btnDecode: TButton;
procedure btnEncodeClick(Sender: TObject);
procedure btnDecodeClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmExBinHex: TfrmExBinHex;
implementation
{$R *.xfm}
uses
AbBinHex;
procedure TfrmExBinHex.btnEncodeClick(Sender: TObject);
var
SF, DF : string;
begin
SF := '';
DF := '';
if OpenDialog1.Execute then begin
SF := OpenDialog1.FileName;
DF := ChangeFileExt(SF, '.hqx');
if InputQuery(Caption, 'Destination file name', DF) then begin
Screen.Cursor := crHourGlass;
AbBin2Hex(SF, DF);
Screen.Cursor := crDefault;
end;
end;
end;
procedure TfrmExBinHex.btnDecodeClick(Sender: TObject);
var
SF, DF : string;
begin
SF := '';
DF := '';
if OpenDialog1.Execute then begin
SF := OpenDialog1.FileName;
DF := ChangeFileExt(SF, '.bin');
if InputQuery(Caption, 'Destination file name', DF) then begin
Screen.Cursor := crHourGlass;
AbHex2Bin(SF, DF);
Screen.Cursor := crDefault;
end;
end;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,42 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
program ExQCf;
uses
QForms,
QuCfMain in 'QuCfMain.pas' {fmCfMain},
QuCfGenDg in 'QuCfGenDg.pas' {frmCfGenDlg},
QuCfNewDg in 'QuCfNewDg.pas' {frmCfNewDlg};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TfmCfMain, fmCfMain);
Application.CreateForm(TfrmCfGenDlg, frmCfGenDlg);
Application.CreateForm(TfrmCfNewDlg, frmCfNewDlg);
Application.Run;
end.

View File

@@ -0,0 +1,41 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: EXQFILTER.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program ExQfilter;
uses
QForms,
ExQFiltrU in 'ExQFiltrU.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,242 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: EXQFILTRU.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit ExQFiltrU;
interface
uses
{$IFDEF MSWINDOWS}
Windows,
Messages,
{$ENDIF}
SysUtils, Classes, QForms, QGraphics, AbBase, AbBrowse, AbZBrows,
AbZipper, AbZipKit, QDialogs, QStdCtrls, QExtCtrls, QControls, QGrids,
AbQView, AbQZView, AbQMeter, AbUtils, AbArcTyp, QButtons;
type
TForm1 = class(TForm)
OpenDialog1: TOpenDialog;
OpenBtn: TButton;
AbZipView1: TAbZipView;
CloseBtn: TButton;
AddGroup: TGroupBox;
Label1: TLabel;
FileMask1: TEdit;
Label2: TLabel;
FilterMask1: TEdit;
AddBtn: TButton;
Label3: TLabel;
Bevel1: TBevel;
Label4: TLabel;
DeleteGroup: TGroupBox;
Label5: TLabel;
FileMask2: TEdit;
Label6: TLabel;
FilterMask2: TEdit;
DeleteBtn: TButton;
Bevel2: TBevel;
AbortBtn: TButton;
ExitBtn: TButton;
ExtractGroup: TGroupBox;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Bevel3: TBevel;
FileMask3: TEdit;
FilterMask3: TEdit;
ExtractBtn: TButton;
AbZipKit1: TAbZipKit;
AbMeter1: TAbMeter;
edtDirectory1: TEdit;
edtDirectory2: TEdit;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
OpenDialog2: TOpenDialog;
procedure AddBtnClick(Sender: TObject);
procedure OpenBtnClick(Sender: TObject);
procedure DeleteBtnClick(Sender: TObject);
procedure CloseBtnClick(Sender: TObject);
procedure AbortBtnClick(Sender: TObject);
procedure ExitBtnClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ExtractBtnClick(Sender: TObject);
procedure AbZipKit1ConfirmProcessItem(Sender: TObject;
Item: TAbArchiveItem; ProcessType: TAbProcessType;
var Confirm: Boolean);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.xfm}
const
MainCaption = ' ExFilter : Exception list example';
AddCaption = ' Add files to zip archive ';
DeleteCaption = ' Delete files from zip archive ';
ExtractCaption = ' Extract files from zip archive ';
var
AbortFlag : Boolean;
procedure TForm1.OpenBtnClick(Sender: TObject);
begin
AbZipKit1.Filename := '';
AddBtn.Enabled := False;
DeleteBtn.Enabled := False;
OpenDialog1.Filename := '*.zip';
if OpenDialog1.Execute then begin
AbZipKit1.Filename := OpenDialog1.Filename;
OpenBtn.Enabled := False;
CloseBtn.Enabled := True;
AddBtn.Enabled := True;
DeleteBtn.Enabled := True;
ExtractBtn.Enabled := True;
AbZipView1.Enabled := True;
Caption := ' ' + AbZipKit1.Filename;
end;
end;
procedure TForm1.CloseBtnClick(Sender: TObject);
begin
Screen.Cursor := crHourglass;
Caption := 'Saving ' + AbZipKit1.Filename;
AbZipKit1.CloseArchive;
Screen.Cursor := crDefault;
OpenBtn.Enabled := True;
CloseBtn.Enabled := False;
AddBtn.Enabled := False;
DeleteBtn.Enabled := False;
ExtractBtn.Enabled := False;
AbZipView1.Enabled := False;
Caption := MainCaption;
end;
procedure TForm1.AddBtnClick(Sender: TObject);
var
SavedColor : TColor;
begin
AbortFlag := False;
AbZipKit1.BaseDirectory := edtDirectory1.Text;
SavedColor := AddGroup.Font.Color;
AddGroup.Font.Color := clRed;
try
AbZipKit1.AddFilesEx(FileMask1.Text, FilterMask1.Text, 0 );
AbZipKit1.Save;
finally
AddGroup.Font.Color := SavedColor;
AddGroup.Caption := AddCaption;
end;
end;
procedure TForm1.DeleteBtnClick(Sender: TObject);
var
SavedColor : TColor;
begin
AbortFlag := False;
SavedColor := DeleteGroup.Font.Color;
DeleteGroup.Font.Color := clRed;
try
AbZipKit1.DeleteFilesEx(FileMask2.Text, FilterMask2.Text);
AbZipKit1.Save;
finally
DeleteGroup.Font.Color := SavedColor;
DeleteGroup.Caption := DeleteCaption;
end;
end;
procedure TForm1.ExtractBtnClick(Sender: TObject);
var
SavedColor : TColor;
begin
AbortFlag := False;
AbZipKit1.BaseDirectory := edtDirectory2.Text;
SavedColor := ExtractGroup.Font.Color;
ExtractGroup.Font.Color := clRed;
try
AbZipKit1.ExtractFilesEx(FileMask3.Text, FilterMask3.Text);
finally
ExtractGroup.Font.Color := SavedColor;
ExtractGroup.Caption := ExtractCaption;
end;
end;
procedure TForm1.AbortBtnClick(Sender: TObject);
begin
AbortFlag := True;
end;
procedure TForm1.ExitBtnClick(Sender: TObject);
begin
AbZipKit1.CloseArchive;
Close;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Caption := MainCaption;
AddGroup.Caption := AddCaption;
DeleteGroup.Caption := DeleteCaption;
ExtractGroup.Caption := ExtractCaption;
end;
procedure TForm1.AbZipKit1ConfirmProcessItem(Sender: TObject;
Item: TAbArchiveItem; ProcessType: TAbProcessType; var Confirm: Boolean);
begin
case ProcessType of
ptAdd : AddGroup.Caption := ' Adding ' + Item.Filename + ' ';
ptDelete : DeleteGroup.Caption := ' Deleting ' + Item.Filename + ' ';
ptExtract : ExtractGroup.Caption := ' Extracting ' + Item.Filename + ' ';
end;
Confirm := not AbortFlag;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
if OpenDialog2.Execute then
edtDirectory1.Text := ExtractFilePath (OpenDialog2.FileName);
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
if OpenDialog2.Execute then
edtDirectory1.Text := ExtractFilePath (OpenDialog2.FileName);
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,41 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: EXQZIPPER.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program ExQZipper;
uses
QForms,
ExQZipprU in 'ExQZipprU.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,120 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: EXQZIPPRU.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit ExQZipprU;
interface
uses
SysUtils, Classes, QGraphics, QForms, AbArcTyp, AbZipOut, AbZBrows, AbZipper,
AbBrowse, AbBase, AbMeter, AbUtils, QDialogs, QStdCtrls, QControls, AbQMeter,
QButtons;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
OpenDialog1: TOpenDialog;
Label1: TLabel;
AbZipper1: TAbZipper;
Button3: TButton;
AbMeter1: TAbMeter;
edtDirectory1: TEdit;
SpeedButton1: TSpeedButton;
OpenDialog2: TOpenDialog;
procedure Button1Click(Sender: TObject);
procedure DirectoryListBox1Change(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure AbZipper1ConfirmProcessItem(Sender: TObject;
Item: TAbArchiveItem; ProcessType: TAbProcessType;
var Confirm: Boolean);
procedure Button3Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.xfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
DirectoryListBox1Change(nil);
end;
procedure TForm1.DirectoryListBox1Change(Sender: TObject);
begin
AbZipper1.BaseDirectory := edtDirectory1.Text;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
OpenDialog1.Filename := '*.zip';
OpenDialog1.InitialDir := edtDirectory1.Text;
if OpenDialog1.Execute then
AbZipper1.Filename := OpenDialog1.Filename;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
AbZipper1.AddFiles('*.*', 0);
Caption := 'ExZipper';
end;
procedure TForm1.AbZipper1ConfirmProcessItem(Sender: TObject;
Item: TAbArchiveItem; ProcessType: TAbProcessType; var Confirm: Boolean);
begin
Caption := 'adding ' + Item.Filename;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Cursor := crHourGlass;
AbZipper1.CloseArchive;
Cursor := crDefault;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
if OpenDialog2.Execute then
edtDirectory1.Text := ExtractFilePath (OpenDialog2.FileName);
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,45 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QABBREXAM.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program QAbbrExam;
uses
QForms,
QuDemoDlg in 'QuDemoDlg.pas' {DemoDlg},
QuExample in 'QuExample.pas' {Form1};
{$R *.res}
begin
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TDemoDlg, DemoDlg);
Application.Run;
end.

View File

@@ -0,0 +1,65 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
unit QBaseDlgU;
interface
uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, Buttons,
StdCtrls, FileCtrl, ExtCtrls;
type
TBaseDlg = class(TForm)
Bevel1: TBevel;
DirectoryListBox1: TDirectoryListBox;
CancelBtn: TButton;
OkBtn: TButton;
procedure DirectoryListBox1Change(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
BaseDirectory : string;
end;
var
BaseDlg: TBaseDlg;
implementation
{$R *.xfm}
procedure TBaseDlg.DirectoryListBox1Change(Sender: TObject);
begin
BaseDirectory := DirectoryListBox1.Directory;
end;
procedure TBaseDlg.FormShow(Sender: TObject);
begin
DirectoryListBox1.Directory := BaseDirectory;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,41 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QCOMPPAD.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program QCompPad;
uses
QForms,
QuCompPad in 'QuCompPad.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,41 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QCONTENTS.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program QContents;
uses
QForms,
QUContent in 'QUContent.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,41 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QFINDER.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program QFinder;
uses
QForms,
QuFinder in 'QuFinder.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,41 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QMAKESFX.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program QMakeSfx;
uses
QForms,
QuMakeSfx in 'QuMakeSfx.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,41 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QSELFSTBV.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program QSelfStbV;
uses
QForms,
QSlfStbV1 in 'QSlfStbV1.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,87 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QSELFSTUB.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
(* This program creates a ZIP stub called SELFEX.EXE. This
stub can then be used to create self-extracting ZIP files.
For more information on self-extracting ZIPs and ZIP stubs see
page 112 in the Abbrevia manual. *)
program QSelfStub;
{$IFDEF WIN32}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
AbArcTyp,
AbUnzPrc,
AbUtils,
AbZipTyp,
{$IFDEF Windows}
WinCRT,
{$ENDIF}
SysUtils;
type
THelper = class
public
procedure UnzipProc(Sender : TObject;
Item : TAbArchiveItem;
const NewName : string);
end;
procedure THelper.UnzipProc(Sender : TObject;
Item : TAbArchiveItem;
const NewName : string);
begin
AbUnzip(Sender, TAbZipItem(Item), NewName);
end;
{Build this app using the Define "BuildingStub", to keep it smaller!}
var
ZipArchive : TAbZipArchive;
Helper : THelper;
begin
WriteLn( 'Abbrevia Self Extracting Archive' );
ZipArchive := TAbZipArchive.Create(ParamStr(0),
fmOpenRead or fmShareDenyNone);
ChDir( ExtractFilePath(ParamStr(0)));
Helper := THelper.Create;
try
ZipArchive.Load;
ZipArchive.ExtractHelper := Helper.UnzipProc;
ZipArchive.ExtractFiles('*.*');
finally
Helper.Free;
ZipArchive.Free;
end;
end.

View File

@@ -0,0 +1,70 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QSLFSTBV1.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit QSlfStbV1;
interface
uses
{$IFDEF WIN32}
Windows,
{$ELSE}
{$ENDIF}
SysUtils, Classes, QGraphics, QForms,
AbZBrows, AbUnzper, AbArcTyp, AbBrowse, AbBase, QControls,
QStdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
AbUnZipper1: TAbUnZipper;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.xfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
AbUnzipper1.FileName := 'abtest.exe';
AbUnzipper1.ExtractFiles( '*.*' );
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,126 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
unit QSpnTst0;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
{IpStrms,}
{StStrms,}
AbBufStm, AbBase, AbBrowse, AbZBrows, AbZipper, AbZipKit,
AbSpanSt, ExtCtrls;
type
TForm1 = class(TForm)
AbZipKit1: TAbZipKit;
Button1: TButton;
OpenDialog1: TOpenDialog;
Button3: TButton;
Bevel1: TBevel;
SaveDialog1: TSaveDialog;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure DoRequestImage(Sender: TObject; ImageNumber: Integer;
var ImageName: String; var Abort: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.xfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Span: TAbSpanStream;
SrcFile : TFileStream;
Src, Dest : string;
begin
OpenDialog1.FileName := '*.*';
OpenDialog1.Title := 'Select Source File';
if OpenDialog1.Execute then begin
Src := OpenDialog1.FileName;
OpenDialog1.Title := 'Specify Destination File';
if OpenDialog1.Execute then begin
Dest := OpenDialog1.FileName;
Span := TAbSpanStream.Create(Dest, fmCreate);
SrcFile := TFileStream.Create(Src, fmOpenRead);
Span.CopyFrom(SrcFile, SrcFile.Size);
Span.Free;
SrcFile.Free;
end;
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
var
Span: TAbSpanStream;
DestFile : TFileStream;
Src, Dest : string;
begin
OpenDialog1.FileName := '*.*';
OpenDialog1.Title := 'Select Source File';
if OpenDialog1.Execute then begin
Src := OpenDialog1.FileName;
SaveDialog1.Title := 'Specify Destination File';
if SaveDialog1.Execute then begin
Dest := SaveDialog1.FileName;
Span := TAbSpanStream.Create(Src, fmOpenRead);
Span.SpanType := stLocal;
Span.OnRequestImage := DoRequestImage;
DestFile := TFileStream.Create(Dest, fmCreate);
DestFile.CopyFrom(Span, 3145728{Span.Size});
Span.Free;
DestFile.Free;
end;
end;
end;
procedure TForm1.DoRequestImage(Sender: TObject;
ImageNumber: Integer; var ImageName: String; var Abort: Boolean);
begin
Abort := not OpenDialog1.Execute;
if not Abort then
ImageName := OpenDialog1.FileName;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,41 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QSTREAMS.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program QStreams;
uses
QForms,
QStreams1 in 'QStreams1.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,144 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QSTREAMS1.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit QStreams1;
interface
uses
SysUtils, Classes, QGraphics, QForms, AbView, AbZView, AbArcTyp, AbZBrows,
AbUnzper, AbZipper, AbZipKit, AbBrowse, AbBase, QDialogs, QMenus, QTypes,
QControls, QStdCtrls, QGrids, AbQView, AbQZView;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
File1: TMenuItem;
Open1: TMenuItem;
Exit1: TMenuItem;
Action1: TMenuItem;
Extract1: TMenuItem;
AbZipView1: TAbZipView;
Memo1: TMemo;
OpenDialog1: TOpenDialog;
Close1: TMenuItem;
N1: TMenuItem;
Add1: TMenuItem;
AbZipKit1: TAbZipKit;
Clearmemo1: TMenuItem;
procedure Open1Click(Sender: TObject);
procedure Extract1Click(Sender: TObject);
procedure Close1Click(Sender: TObject);
procedure Exit1Click(Sender: TObject);
procedure AbZipView1DblClick(Sender: TObject);
procedure Clearmemo1Click(Sender: TObject);
procedure Add1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.xfm}
const
MainCaption = ' Compressed Memo';
procedure TForm1.Open1Click(Sender: TObject);
begin
OpenDialog1.Filename := '*.zip';
if OpenDialog1.Execute then
AbZipKit1.OpenArchive(OpenDialog1.Filename);
end;
procedure TForm1.Extract1Click(Sender: TObject);
var
ToStream : TMemoryStream;
Item : TAbArchiveItem;
begin
Memo1.Clear;
ToStream := TMemoryStream.Create;
try
Item := AbZipView1.Items[AbZipView1.ActiveRow];
Caption := Item.Filename;
AbZipKit1.ExtractToStream(Item.FileName, ToStream);
ToStream.Position := 0;
Memo1.Lines.LoadFromStream(ToStream);
finally
ToStream.Free;
end;
end;
procedure TForm1.Close1Click(Sender: TObject);
begin
AbZipKit1.CloseArchive;
Caption := MainCaption;
end;
procedure TForm1.Exit1Click(Sender: TObject);
begin
Close1Click(nil);
Close;
end;
procedure TForm1.AbZipView1DblClick(Sender: TObject);
begin
Extract1Click(nil);
end;
procedure TForm1.Clearmemo1Click(Sender: TObject);
begin
Memo1.Clear;
end;
procedure TForm1.Add1Click(Sender: TObject);
var
FromStream : TMemoryStream;
FN : string;
begin
FromStream := TMemoryStream.Create;
try
Memo1.Lines.SaveToStream(FromStream);
if InputQuery('Streams', 'Give it a filename', FN) then begin
Caption := FN;
AbZipKit1.AddFromStream(FN, FromStream);
end;
finally
FromStream.Free;
end;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,40 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QSTRMBMP.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program QStrmBmp;
uses
QForms,
QStrmBmpU in 'QStrmBmpU.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,117 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QSTRMBMPU.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit QStrmBmpU;
interface
uses
{$IFDEF WIN32}
Windows,
{$ELSE}
{$ENDIF}
SysUtils, Classes, QGraphics, QForms, QControls, QStdCtrls, QExtCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses
AbUnzPrc,
AbZipPrc;
{$R *.xfm}
procedure TForm1.Button1Click(Sender: TObject);
var
UStrm : TMemoryStream;
CStrm : TMemoryStream;
Image2 : TImage;
begin
{ Create the compressed stream and the uncompressed stream. }
UStrm := TMemoryStream.Create;
CStrm := TMemoryStream.Create;
{ Copy the bitmap image to the memory stream. }
Image1.Picture.Bitmap.SaveToStream(UStrm);
{ Set the stream position to the beginning. }
UStrm.Position := 0;
{ Compress the stream. }
DeflateStream(UStrm, CStrm);
{ Remove all data from the uncompressed stream. }
UStrm.Clear;
{ Reset the compressed stream back to the beginning. }
CStrm.Position := 0;
{ Decompress the stream back to the original uncompressed }
{ stream and then reset the stream position back to 0. }
InflateStream(CStrm, UStrm);
UStrm.Position := 0;
{ Now create a new TImage. Make it the same size as the }
{ original image but move it down and to the left. }
Image2 := TImage.Create(Self);
Image2.Top := Image1.Top + 20;
Image2.Left := Image1.Left + 20;
Image2.Width := Image1.Width;
Image2.Height := Image1.Height;
Image2.Parent := Self;
{ Delete the original TImage. }
Image1.Free;
{ Load the new bitmap with the data from the stream }
{ that contains the decompressed image. }
Image2.Picture.Bitmap.LoadFromStream(UStrm);
{ Free the memory streams. }
UStrm.Free;
CStrm.Free;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,41 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QSTRMPAD.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program QStrmPad;
uses
QForms,
QUStrPad in 'QUStrPad.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,87 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QUCONTENT.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit QUContent;
interface
uses
{$IFDEF MSWINDOWS}
Windows,
{$ELSE}
{$ENDIF}
SysUtils, Classes, QGraphics, QForms,
AbZBrows, AbArcTyp, AbBrowse, AbBase, QDialogs, QStdCtrls,
QControls;
type
TForm1 = class(TForm)
ListBox1: TListBox;
Button1: TButton;
OpenDialog1: TOpenDialog;
AbZipBrowser1: TAbZipBrowser;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.xfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i : Integer;
begin
ListBox1.Clear;
if OpenDialog1.Execute then begin
try
with AbZipBrowser1 do begin
FileName := OpenDialog1.FileName;
if Count > 0 then
for i := 0 to pred( Count ) do
ListBox1.Items.Add( Items[i].FileName );
end;
except
ListBox1.Items.Add( OpenDialog1.FileName + ' is not a valid archive.' );
end;
end;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,116 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: SUSTRPAD.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit QUStrPad;
interface
uses
{$IFDEF WIN32}
Windows,
{$ELSE}
{$ENDIF}
SysUtils, Classes, QGraphics, QForms, QControls, QExtCtrls, QStdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Panel1: TPanel;
Memo2: TMemo;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
ZnfName : string;
TxtName : string;
ZnfStream : TFileStream;
TxtStream : TStream;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses
AbUnzPrc,
AbZipPrc;
{$R *.xfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
ZnfName := ChangeFileExt(Application.ExeName, '.zst');
TxtName := ExtractFileName( ChangeFileExt(Application.ExeName, '.pad') );
ChDir( ExtractFilePath( Application.ExeName ) );
if FileExists( ZnfName ) then begin
TxtStream := TMemoryStream.Create;
try
ZnfStream := TFileStream.Create( ZnfName,
fmOpenRead or fmShareExclusive );
try
InflateStream( ZnfStream, TxtStream );
finally
ZnfStream.Free;
end;
TxtStream.Position := 0;
Memo1.Lines.LoadFromStream( TxtStream );
finally
TxtStream.Free;
end;
end;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
TxtStream := TMemoryStream.Create;
try
Memo1.Lines.SaveToStream( TxtStream );
TxtStream.Position := 0;
if FileExists( ZnfName ) then
ZnfStream := TFileStream.Create( ZnfName,
fmOpenWrite or fmShareExclusive )
else
ZnfStream := TFileStream.Create( ZnfName,
fmCreate or fmShareExclusive );
try
DeflateStream( TxtStream, ZnfStream );
finally
ZnfStream.Free;
end;
finally
TxtStream.Free;
end;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,80 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QUUNZIP.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit QUUnzip;
interface
uses
{$IFDEF MSWINDOWS}
Windows,
{$ELSE}
{$ENDIF}
QForms, QGraphics, SysUtils,
AbZBrows, AbUnzper, AbArcTyp, AbMeter, AbBrowse, AbBase,
QDialogs, QStdCtrls, QControls, AbQMeter, Classes;
type
TForm1 = class(TForm)
Button1: TButton;
OpenDialog1: TOpenDialog;
AbUnZipper1: TAbUnZipper;
Memo1: TMemo;
AbMeter1: TAbMeter;
AbMeter2: TAbMeter;
Label1: TLabel;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.xfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then begin
with AbUnzipper1 do begin
FileName := OpenDialog1.FileName;
BaseDirectory := ExtractFilePath( FileName );
ExtractFiles( '*.*' );
end;
end;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,74 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QUZIP.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit QUZip;
interface
uses
{$IFDEF MSWINDOWS}
Windows,
{$ENDIF}
SysUtils, Classes, QForms, QGraphics,
AbZipper, AbArcTyp, AbZBrows, AbMeter, AbBrowse, AbBase,
QDialogs, QStdCtrls, QControls, AbQMeter;
type
TForm1 = class(TForm)
AbZipper1: TAbZipper;
Button1: TButton;
OpenDialog1: TOpenDialog;
Memo1: TMemo;
AbMeter1: TAbMeter;
AbMeter2: TAbMeter;
Label1: TLabel;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.xfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
AbZipper1.AddFiles( OpenDialog1.FileName, 0 );
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,41 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QUNZIP.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program QUnzip;
uses
QForms,
QUUnzip in 'QUUnzip.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,143 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: USINGAPI.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
{$APPTYPE CONSOLE}
program QUsingAPI;
{Build this app using the Define "BuildingStub", to keep it smaller!}
uses
AbArcTyp, AbZipTyp, AbZipPrc, AbUnzPrc, Classes, SysUtils, AbUtils;
type
THelper = class
public
procedure UnzipProc( Sender : TObject; Item : TAbArchiveItem;
const NewName : string );
procedure ZipProc( Sender : TObject; Item : TAbArchiveItem;
OutStream : TStream );
procedure ArchiveItemProgress( Sender: TObject;
Item: TAbArchiveItem;
Progress: Byte;
var Abort: Boolean);
end;
procedure THelper.ArchiveItemProgress( Sender: TObject;
Item: TAbArchiveItem; Progress: Byte; var Abort: Boolean);
type
TMethodStrings = array [ TAbZipCompressionMethod ] of string;
const
MethodStrings : TMethodStrings = ('UnStoring', 'UnShrinking', 'UnReducing',
'UnReducing', 'UnReducing', 'UnReducing',
'Exploding', 'DeTokenizing', 'Inflating',
'Enhanced Inflating', 'DCL Exploding',
'Extracting');
var
ActionString : string;
begin
case Item.Action of
aaAdd : ActionString := 'Adding ';
aaFreshen : ActionString := 'Freshening ';
else
ActionString := MethodStrings[(Item as TAbZipItem).CompressionMethod] +
' ';
end;
WriteLn( ActionString + Item.FileName );
end;
procedure THelper.UnzipProc( Sender : TObject; Item : TAbArchiveItem;
const NewName : string );
begin
AbUnzip( Sender, TAbZipItem(Item), NewName );
end;
procedure THelper.ZipProc( Sender : TObject; Item : TAbArchiveItem;
OutStream : TStream );
begin
AbZip( TAbZipArchive(Sender), TAbZipItem(Item), OutStream );
end;
var
ZipFileName : string;
OutDirectory : string;
InDirectory : string;
Mask : string;
Archive : TAbZipArchive;
Helper : THelper;
begin
WriteLn;
{usage: UsingAPI ZipFileName InDirectory Mask OutDirectory}
if (ParamCount < 4) or
((ParamCount > 0) and (Pos('?', ParamStr(1))>0)) then begin
WriteLn;
WriteLn( ' Syntax: UsingAPI ZipFileName InDirectory Mask OutDirectory');
Halt;
end;
ZipFileName := ParamStr(1);
InDirectory := ParamStr(2);
Mask := ParamStr(3);
OutDirectory := ParamStr(4);
{open the file}
if FileExists( ZipFileName ) then begin
Archive := TAbZipArchive.Create( ZipFileName,
fmOpenReadWrite or fmShareDenyWrite );
Archive.Load;
end
else
Archive := TAbZipArchive.Create( ZipFileName,
fmCreate or fmShareDenyNone );
try
Helper := THelper.Create;
try
{set the event handlers}
Archive.InsertHelper := Helper.ZipProc;
Archive.ExtractHelper := Helper.UnzipProc;
Archive.OnArchiveItemProgress := Helper.ArchiveItemProgress;
{set the BaseDirectory for input files}
Archive.BaseDirectory := InDirectory;
{add all the files in the BaseDirectory to the archive}
Archive.AddFiles( Mask, 0 );
{save the files to the zipfile}
Archive.Save;
{now, change the base directory to the output}
Archive.BaseDirectory := OutDirectory;
Archive.ExtractFiles( Mask );
finally
Helper.Free;
end;
finally
Archive.Free;
end;
end.

View File

@@ -0,0 +1,35 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
program QZipView;
uses
QForms,
QZipView1 in 'QZipView1.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,545 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
unit QZipView1;
interface
uses
SysUtils,
AbArcTyp, AbUtils,
QForms,
AbZipper, AbZipKit, AbZipTyp, AbZBrows, AbMeter,
AbDlgDir, AbView, AbZView, AbBrowse, AbBase, AbQMeter, QMenus, QDialogs,
QTypes, QControls, QStdCtrls, QExtCtrls, QGrids, AbQView, AbQZView,
Classes;
type
TForm1 = class(TForm)
OpenDialog1: TOpenDialog;
Panel1: TPanel;
FontDialog1: TFontDialog;
MainMenu1: TMainMenu;
File1: TMenuItem;
Open1: TMenuItem;
Close1: TMenuItem;
N1: TMenuItem;
Print1: TMenuItem;
Exit1: TMenuItem;
ColorDialog1: TColorDialog;
ZipView1: TMenuItem;
Attributes1: TMenuItem;
Itemname1: TMenuItem;
Packed1: TMenuItem;
Method1: TMenuItem;
Ratio1: TMenuItem;
CRC1: TMenuItem;
Fileattributes1: TMenuItem;
Filetype1: TMenuItem;
Encryption1: TMenuItem;
Timestamp1: TMenuItem;
Filesize1: TMenuItem;
Versionmade1: TMenuItem;
Versionneeded1: TMenuItem;
Path1: TMenuItem;
Display1: TMenuItem;
Columnlines1: TMenuItem;
Columnmoving1: TMenuItem;
Columnresizing1: TMenuItem;
MultiSelect1: TMenuItem;
Rowlines1: TMenuItem;
Thumbtracking1: TMenuItem;
Trackactiverow1: TMenuItem;
Sort1: TMenuItem;
Itemname2: TMenuItem;
Packed2: TMenuItem;
Ratio2: TMenuItem;
Timestamp2: TMenuItem;
Filesize2: TMenuItem;
Select1: TMenuItem;
SelectAll1: TMenuItem;
ClearSelections1: TMenuItem;
Rows1: TMenuItem;
Rowheight1: TMenuItem;
Headerheight1: TMenuItem;
Font1: TMenuItem;
Alternatecolors1: TMenuItem;
Action1: TMenuItem;
Add1: TMenuItem;
Delete1: TMenuItem;
Extract1: TMenuItem;
Freshen1: TMenuItem;
AbZipView1: TAbZipView;
AbZipKit1: TAbZipKit;
ZipKit1: TMenuItem;
Compress1: TMenuItem;
N2: TMenuItem;
Store1: TMenuItem;
Stored1: TMenuItem;
Deflated1: TMenuItem;
Best1: TMenuItem;
Deflation1: TMenuItem;
Normal1: TMenuItem;
Maximum1: TMenuItem;
Fast1: TMenuItem;
SuperFast1: TMenuItem;
CreateDirs1: TMenuItem;
RestorePath1: TMenuItem;
StripPath1: TMenuItem;
RemoveDots1: TMenuItem;
Recurse1: TMenuItem;
ShowIcons1: TMenuItem;
Colors1: TMenuItem;
Selectedcolor: TMenuItem;
Selectedtextcolor: TMenuItem;
AlternateColor1: TMenuItem;
AlternateTextColor1: TMenuItem;
Freshen2: TMenuItem;
Panel2: TPanel;
AbMeter1: TAbMeter;
Label1: TLabel;
Label2: TLabel;
Moveselecteditem1: TMenuItem;
Replace1: TMenuItem;
PopupMenu1: TPopupMenu;
Delete2: TMenuItem;
Extract2: TMenuItem;
Freshen3: TMenuItem;
Move1: TMenuItem;
AbMeter2: TAbMeter;
Save1: TMenuItem;
Testselecteditems1: TMenuItem;
Logging1: TMenuItem;
DeletedColor1: TMenuItem;
DeletedTextColor1: TMenuItem;
AutomaticTar: TMenuItem;
ViewasTar1: TMenuItem;
procedure AbZipView1Click(Sender: TObject);
procedure AttributeClick(Sender: TObject);
procedure DisplayOptionClick(Sender: TObject);
procedure SortAttributeClick(Sender: TObject);
procedure Open1Click(Sender: TObject);
procedure Close1Click(Sender: TObject);
procedure SelectAll1Click(Sender: TObject);
procedure ClearSelections1Click(Sender: TObject);
procedure Font1Click(Sender: TObject);
procedure Exit1Click(Sender: TObject);
procedure Selected1Click(Sender: TObject);
procedure Selectedtext1Click(Sender: TObject);
procedure Rowheight1Click(Sender: TObject);
procedure Headerheight1Click(Sender: TObject);
procedure Add1Click(Sender: TObject);
procedure Delete1Click(Sender: TObject);
procedure Extract1Click(Sender: TObject);
procedure ExtractOptionClick(Sender: TObject);
procedure StoreOptionClick(Sender: TObject);
procedure MethodClick(Sender: TObject);
procedure DeflationOptionClick(Sender: TObject);
procedure AbZipKit1ConfirmProcessItem(Sender: TObject;
Item: TAbArchiveItem; ProcessType: TAbProcessType;
var Confirm: Boolean);
procedure AbZipView1Change(Sender: TObject);
procedure AlternateColor1Click(Sender: TObject);
procedure AlternateTextColor1Click(Sender: TObject);
procedure Freshen1Click(Sender: TObject);
procedure Moveselecteditem1Click(Sender: TObject);
procedure AbZipKit1Save(Sender: TObject);
procedure Save1Click(Sender: TObject);
procedure Testselecteditems1Click(Sender: TObject);
procedure Logging1Click(Sender: TObject);
procedure DeletedColor1Click(Sender: TObject);
procedure DeletedTextColor1Click(Sender: TObject);
procedure AutomaticTarClick(Sender: TObject);
procedure ViewasTar1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.xfm}
const
MainCaption = ' TAbZipView example';
{ -------------------------------------------------------------------------- }
procedure TForm1.AbZipView1Click(Sender: TObject);
begin
Panel1.Caption := AbZipView1.Items[AbZipView1.ActiveRow].Filename;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Open1Click(Sender: TObject);
begin
OpenDialog1.Filename := '*.zip';
if OpenDialog1.Execute then begin
AbZipKit1.Filename := OpenDialog1.Filename;
Caption := AbZipKit1.Filename +
' ' + IntToStr(AbZipView1.Count) + ' items';
Action1.Enabled := True;
end;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Close1Click(Sender: TObject);
begin
AbZipKit1.Filename := '';
Caption := MainCaption;
Panel1.Caption := '';
Action1.Enabled := False;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.AttributeClick(Sender: TObject);
begin
with TMenuItem(Sender) do begin
Checked := not Checked;
if Checked then
AbZipView1.Attributes := AbZipView1.Attributes + [TAbViewAttribute(Tag)]
else
AbZipView1.Attributes := AbZipView1.Attributes - [TAbViewAttribute(Tag)];
end;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.DisplayOptionClick(Sender: TObject);
begin
with TMenuItem(Sender) do begin
Checked := not Checked;
if Checked then
AbZipView1.DisplayOptions := AbZipView1.DisplayOptions +
[TAbDisplayOption(Tag)]
else
AbZipView1.DisplayOptions := AbZipView1.DisplayOptions -
[TAbDisplayOption(Tag)]
end;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.SortAttributeClick(Sender: TObject);
begin
with TMenuItem(Sender) do begin
Checked := not Checked;
if Checked then
AbZipView1.SortAttributes := AbZipView1.SortAttributes +
[TAbSortAttribute(Tag)]
else
AbZipView1.SortAttributes := AbZipView1.SortAttributes -
[TAbSortAttribute(Tag)]
end;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.StoreOptionClick(Sender: TObject);
begin
with TMenuItem(Sender) do begin
Checked := not Checked;
if Checked then
AbZipKit1.StoreOptions := AbZipKit1.StoreOptions +
[TAbStoreOption(Tag)]
else
AbZipKit1.StoreOptions := AbZipKit1.StoreOptions -
[TAbStoreOption(Tag)]
end;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.ExtractOptionClick(Sender: TObject);
begin
with TMenuItem(Sender) do begin
Checked := not Checked;
if Checked then
AbZipKit1.ExtractOptions := AbZipKit1.ExtractOptions +
[TAbExtractOption(Tag)]
else
AbZipKit1.ExtractOptions := AbZipKit1.ExtractOptions -
[TAbExtractOption(Tag)]
end;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.MethodClick(Sender: TObject);
begin
with TMenuItem(Sender) do begin
Checked := true;
AbZipKit1.CompressionMethodToUse := TAbZipSupportedMethod(Tag);
end;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.DeflationOptionClick(Sender: TObject);
begin
with TMenuItem(Sender) do begin
Checked := true;
AbZipKit1.DeflationOption := TAbZipDeflationOption(Tag);
end;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.SelectAll1Click(Sender: TObject);
begin
AbZipView1.SelectAll;
AbZipView1Click(nil);
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.ClearSelections1Click(Sender: TObject);
begin
AbZipView1.ClearSelections;
AbZipView1Click(nil);
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Font1Click(Sender: TObject);
begin
FontDialog1.Font := AbZipView1.Font;
if FontDialog1.Execute then
AbZipView1.Font := FontDialog1.Font;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Exit1Click(Sender: TObject);
begin
Close;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.DeletedColor1Click(Sender: TObject);
begin
if ColorDialog1.Execute then
AbZipView1.Colors.Deleted := ColorDialog1.Color;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.DeletedTextColor1Click(Sender: TObject);
begin
if ColorDialog1.Execute then
AbZipView1.Colors.DeletedText := ColorDialog1.Color;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Selected1Click(Sender: TObject);
begin
if ColorDialog1.Execute then
AbZipView1.Colors.Selected := ColorDialog1.Color;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Selectedtext1Click(Sender: TObject);
begin
if ColorDialog1.Execute then
AbZipView1.Colors.SelectedText := ColorDialog1.Color;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Rowheight1Click(Sender: TObject);
var
s : string;
begin
s := IntToStr(AbZipView1.DefaultRowHeight);
if InputQuery(MainCaption, 'Row Height', s) then
AbZipView1.DefaultRowHeight := StrToIntDef(s, 18);
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Headerheight1Click(Sender: TObject);
var
s : string;
begin
s := IntToStr(AbZipView1.HeaderRowHeight);
if InputQuery(MainCaption, 'Header Height', s) then
AbZipView1.HeaderRowHeight := StrToIntDef(s, 18);
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Add1Click(Sender: TObject);
var
i : Integer;
begin
with OpenDialog1 do begin
Filename := '*.*';
Options := Options + [ofAllowMultiSelect];
AbZipView1.BeginUpdate;
if Execute then for i := 0 to Pred(Files.Count) do
AbZipKit1.AddFiles(Files[i], 0);
AbZipView1.EndUpdate;
Panel1.Caption := '';
Options := Options - [ofAllowMultiSelect];
end;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Delete1Click(Sender: TObject);
var
i : Longint;
begin
Panel1.Caption := '';
with AbZipView1 do
for i := 0 to Pred(Count) do
Items[i].Tagged := Selected[i];
AbZipKit1.DeleteTaggedItems;
Panel1.Caption := '';
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Extract1Click(Sender: TObject);
var
i : Longint;
Continue : Boolean;
begin
{$IFDEF Win32}
with TAbDirDlg.Create(Self) do begin
Caption := 'Directory';
AdditionalText := 'Select folder to extract into';
SelectedFolder := AbZipKit1.BaseDirectory;
Continue := Execute;
if Continue then
AbZipKit1.BaseDirectory := SelectedFolder;
{$ELSE}
with TDirDlg.Create(Self) do begin
SelectedFolder := AbZipKit1.BaseDirectory;
Continue := (ShowModal = mrOK);
if Continue then
AbZipKit1.BaseDirectory := SelectedFolder;
{$ENDIF}
Free;
end;
if not Continue then
Exit;
Panel1.Caption := '';
with AbZipView1 do
for i := 0 to Pred(Count) do
Items[i].Tagged := Selected[i];
AbZipKit1.ExtractTaggedItems;
AbZipView1.ClearSelections;
Panel1.Caption := '';
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Freshen1Click(Sender: TObject);
var
i : Longint;
begin
Panel1.Caption := '';
with AbZipView1 do
for i := 0 to Pred(Count) do
Items[i].Tagged := Selected[i];
AbZipKit1.FreshenTaggedItems;
AbZipKit1.Save;
AbZipView1.ClearSelections;
Panel1.Caption := '';
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.TestSelecteditems1Click(Sender: TObject);
var
i : Longint;
begin
Panel1.Caption := '';
with AbZipView1 do
for i := 0 to Pred(Count) do
Items[i].Tagged := Selected[i];
AbZipKit1.TestTaggedItems;
AbZipView1.ClearSelections;
Panel1.Caption := '';
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.AbZipKit1ConfirmProcessItem(Sender: TObject;
Item: TAbArchiveItem; ProcessType: TAbProcessType; var Confirm: Boolean);
var
s : string;
begin
case ProcessType of
ptAdd : s := 'Adding ';
ptDelete : s := 'Deleting ';
ptExtract : s := 'Extracting ';
ptFreshen : s := 'Freshening ';
else
s := '??? ';
end;
Panel1.Caption := s + Item.Filename;
Confirm := True;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.AbZipView1Change(Sender: TObject);
begin
Caption := AbZipKit1.Filename +
' ' + IntToStr(AbZipView1.Count) + ' items';
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.AlternateColor1Click(Sender: TObject);
begin
if ColorDialog1.Execute then
AbZipView1.Colors.Alternate := ColorDialog1.Color;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.AlternateTextColor1Click(Sender: TObject);
begin
if ColorDialog1.Execute then
AbZipView1.Colors.AlternateText := ColorDialog1.Color;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Moveselecteditem1Click(Sender: TObject);
var
i : Longint;
s : string;
begin
with AbZipView1 do
if (SelCount > 0) then begin
for i := 0 to Pred(Count) do
if Selected[i] then begin
s := Items[i].Filename;
if InputQuery(MainCaption, 'Rename file', s) then
AbZipKit1.Move(Items[i], s);
end;
AbZipKit1.Save;
AbZipView1.ClearSelections;
Panel1.Caption := '';
end;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.AbZipKit1Save(Sender: TObject);
begin
Panel1.Caption := 'Saving ' + AbZipKit1.Filename;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Save1Click(Sender: TObject);
begin
if (AbZipKit1.Filename <> '') then
AbZipKit1.Save;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Logging1Click(Sender: TObject);
begin
Logging1.Checked := not Logging1.Checked;
if Logging1.Checked then begin
OpenDialog1.Title := 'Select log file';
if AbZipKit1.LogFile = '' then
OpenDialog1.Filename := '*.txt'
else
OpenDialog1.Filename := AbZipKit1.LogFile;
Logging1.Checked := OpenDialog1.Execute;
if Logging1.Checked then
AbZipKit1.LogFile := OpenDialog1.Filename;
end;
AbZipKit1.Logging := Logging1.Checked;
end;
procedure TForm1.AutomaticTarClick(Sender: TObject);
begin
AbZipKit1.TarAutoHandle := not AbZipKit1.TarAutoHandle;
AutomaticTar.Checked := AbZipKit1.TarAutoHandle;
end;
procedure TForm1.ViewasTar1Click(Sender: TObject);
begin
AbZipKit1.ForceType := not AbZipKit1.ForceType;
ViewasTar1.Checked := AbZipKit1.ForceType;
if AbZipKit1.ForceType then
AbZipKit1.ArchiveType := atGzippedTar;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,41 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QZIPPER.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program QZipper;
uses
QForms,
QUZip in 'QUZip.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,94 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: DGABOUT.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
{$IFDEF Windows}
{$C MOVEABLE DEMANDLOAD DISCARDABLE}
{$ENDIF}
unit QdgAbout;
interface
uses
{$IFDEF Win32}
Windows,
{$ELSE}
{$ENDIF}
Classes, QGraphics, QForms, QStdCtrls, QControls, QExtCtrls;
type
TdlgAboutBox = class(TForm)
Panel1: TPanel;
ProgramIcon: TImage;
Label7: TLabel;
Label8: TLabel;
Panel2: TPanel;
lnTitleShadow: TLabel;
lblTitle: TLabel;
Label5: TLabel;
Label86: TLabel;
Label85: TLabel;
Label84: TLabel;
OKButton: TButton;
Version: TLabel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label6: TLabel;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
dlgAboutBox: TdlgAboutBox;
implementation
{$R *.xfm}
uses
AbConst;
procedure TdlgAboutBox.FormCreate(Sender: TObject);
begin
Version.Caption := 'Abbrevia ' + AbVersion;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,97 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: UBASEDLG.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit QuBaseDlg;
interface
uses
{$IFDEF WIN32}
Windows,
{$ELSE}
{$ENDIF}
SysUtils, Classes, QGraphics, QForms, QStdCtrls, QControls, QButtons,
QDialogs;
type
TBaseDirDlg = class(TForm)
Button1: TButton;
Button2: TButton;
Edit1: TEdit;
DirLabel: TLabel;
ActionLabel: TLabel;
CheckBox2: TCheckBox;
CheckBox1: TCheckBox;
Button3: TButton;
edtDirectory1: TEdit;
SpeedButton1: TSpeedButton;
OpenDialog1: TOpenDialog;
procedure Button3Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
BaseDirDlg: TBaseDirDlg;
implementation
{$R *.xfm}
uses
AbUtils,
QuDemoDlg;
procedure TBaseDirDlg.Button3Click(Sender: TObject);
begin
DemoDlg := TDemoDlg.Create( Self );
try
DemoDlg.Caption := 'Create Subdirectory';
DemoDlg.Edit1.Text := '';
DemoDlg.ShowModal;
if ( DemoDlg.ModalResult = mrOK ) and ( DemoDlg.Edit1.Text <> '' ) then
AbCreateDirectory(IncludeTrailingPathDelimiter(edtDirectory1.Text) +
DemoDlg.Edit1.Text );
finally
DemoDlg.Free;
end;
end;
procedure TBaseDirDlg.SpeedButton1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
edtDirectory1.Text := ExtractFilePath (OpenDialog1.FileName);
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,66 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
unit QuCfGenDg;
interface
uses
SysUtils, Classes, QGraphics, QForms, QStdCtrls, QControls;
type
TfrmCfGenDlg = class(TForm)
Label1: TLabel;
Edit1: TEdit;
btnCancel: TButton;
btnOK: TButton;
procedure btnOKClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmCfGenDlg: TfrmCfGenDlg;
implementation
{$R *.xfm}
procedure TfrmCfGenDlg.btnOKClick(Sender: TObject);
begin
if Edit1.Text <> '' then
ModalResult := mrOK;
end;
procedure TfrmCfGenDlg.FormShow(Sender: TObject);
begin
Edit1.Text := '';
Edit1.SetFocus;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,236 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QUCFMAIN.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
{$DEFINE UsingCLX}
unit QuCfMain;
interface
uses
SysUtils, Classes, QGraphics, QForms, AbQHexVw, AbQCmpnd,
QDialogs, QMenus, QTypes, QImgList, QExtCtrls, QControls, QComCtrls;
type
TfmCfMain = class(TForm)
StatusBar1: TStatusBar;
tvDirectory: TTreeView;
tvImages: TImageList;
OpenDialog1: TOpenDialog;
mnuMain: TMainMenu;
mnuFile: TMenuItem;
mnuFileNew: TMenuItem;
mnuFileOpen: TMenuItem;
N6: TMenuItem;
mnuFileExit: TMenuItem;
mnuEdit: TMenuItem;
mnuEditAddFile: TMenuItem;
mnuEditAddFolder: TMenuItem;
mnuEditDelete: TMenuItem;
N1: TMenuItem;
mnuEditChangeDir: TMenuItem;
mnuPopupMenu: TPopupMenu;
puAddFile: TMenuItem;
puAddFolder: TMenuItem;
puViewFile: TMenuItem;
puChangeDir: TMenuItem;
puViewCompoundFile: TMenuItem;
puDelete: TMenuItem;
Rename1: TMenuItem;
SaveDialog1: TSaveDialog;
OpenDialog2: TOpenDialog;
pnlHexView: TPanel;
procedure mnuFileNewClick(Sender: TObject);
procedure mnuFileOpenClick(Sender: TObject);
procedure mnuFileExitClick(Sender: TObject);
procedure mnuEditAddFileClick(Sender: TObject);
procedure mnuEditAddFolderClick(Sender: TObject);
procedure mnuEditDeleteClick(Sender: TObject);
procedure mnuEditChangeDirClick(Sender: TObject);
procedure puViewFileClick(Sender: TObject);
procedure puViewCompoundFileClick(Sender: TObject);
procedure Rename1Click(Sender: TObject);
procedure tvDirectoryClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
fmCfMain: TfmCfMain;
AbCompoundFile1 : TAbCompoundFile;
HexV : THexView;
implementation
uses QuCfNewDg, QuCfGenDg;
{$R *.xfm}
procedure TfmCfMain.mnuFileNewClick(Sender: TObject);
var
AllocSize : Integer;
begin
if SaveDialog1.Execute then begin
if frmCfNewDlg.ShowModal = mrOK then begin
if AbCompoundFile1 <> nil then
AbCompoundFile1.Free;
AllocSize := StrToInt(frmCfNewDlg.lbAllocSize.
Items[frmCfNewDlg.lbAllocSize.ItemIndex]);
AbCompoundFile1 := TAbCompoundFile.Create(SaveDialog1.FileName,
frmCfNewDlg.edtVolLbl.Text, AllocSize);
Caption := 'Abbrevia 3 Compound File Example (' + SaveDialog1.FileName + ')';
HexV := THexView.Create(Self);
HexV.BlockSize := AllocSize;
HexV.Parent := pnlHexView;
HexV.Align := alClient;
HexV.Stream := AbCompoundFile1.Stream;
AbCompoundFile1.PopulateTreeView(tvDirectory);
end;
end;
end;
procedure TfmCfMain.mnuFileOpenClick(Sender: TObject);
begin
{OpenExisting compound file}
if OpenDialog1.Execute then begin
if AbCompoundFile1 <> nil then
AbCompoundFile1.Free;
AbCompoundFile1 := TAbCompoundFile.Create('', '', 512);
AbCompoundFile1.Open(OpenDialog1.FileName);
Caption := 'Abbrevia 3 Compound File Example (' + OpenDialog1.FileName + ')';
HexV := THexView.Create(Self);
HexV.BlockSize := AbCompoundFile1.AllocationSize;
HexV.Parent := pnlHexView;
HexV.Align := alClient;
HexV.Stream := AbCompoundFile1.Stream;
AbCompoundFile1.PopulateTreeView(tvDirectory);
end;
end;
procedure TfmCfMain.mnuFileExitClick(Sender: TObject);
begin
Application.Terminate;
end;
procedure TfmCfMain.mnuEditAddFileClick(Sender: TObject);
var
i : Integer;
Strm : TFileStream;
begin
if OpenDialog2.Execute then begin
Strm := TFileStream.Create(OpenDialog2.FileName, fmOpenRead
or fmShareDenyNone);
AbCompoundFile1.AddFile(OpenDialog2.FileName, Strm, Strm.Size);
Strm.Free;
AbCompoundFile1.PopulateTreeView(tvDirectory);
for i := 0 to tvDirectory.Items.Count - 1 do
tvDirectory.Items.Item[i].Expand(True);
HexV.Stream := AbCompoundFile1.Stream;
end;
end;
procedure TfmCfMain.mnuEditAddFolderClick(Sender: TObject);
var
i : Integer;
begin
if frmCfGenDlg.ShowModal = mrOK then begin
AbCompoundFile1.AddFolder(frmCfGenDlg.Edit1.Text);
AbCompoundFile1.PopulateTreeView(tvDirectory);
for i := 0 to tvDirectory.Items.Count - 1 do
tvDirectory.Items.Item[i].Expand(True);
end;
HexV.Stream := AbCompoundFile1.Stream;
end;
procedure TfmCfMain.mnuEditDeleteClick(Sender: TObject);
var
i : Integer;
begin
if tvDirectory.Selected.ImageIndex = 0 then
AbCompoundFile1.DeleteFolder(tvDirectory.Selected.Text)
else
AbCompoundFile1.DeleteFile(tvDirectory.Selected.Text);
HexV.Stream := AbCompoundFile1.Stream;
AbCompoundFile1.PopulateTreeView(tvDirectory);
for i := 0 to tvDirectory.Items.Count - 1 do
tvDirectory.Items.Item[i].Expand(True);
end;
procedure TfmCfMain.mnuEditChangeDirClick(Sender: TObject);
begin
frmCfGenDlg.Caption := AbCompoundFile1.CurrentDirectory;
if frmCfGenDlg.ShowModal = mrOK then begin
AbCompoundFile1.CurrentDirectory := frmCfGenDlg.Edit1.Text;
StatusBar1.SimpleText := ' Current Directory: ' + AbCompoundFile1.CurrentDirectory;
end;
end;
procedure TfmCfMain.puViewFileClick(Sender: TObject);
var
Strm : TStream;
begin
Strm := TMemoryStream.Create;
AbCompoundFile1.OpenFile(tvDirectory.Selected.Text, Strm);
Hexv.SetStream(Strm);
Strm.Free;
end;
procedure TfmCfMain.puViewCompoundFileClick(Sender: TObject);
begin
HexV.Stream := AbCompoundFile1.Stream;
end;
procedure TfmCfMain.Rename1Click(Sender: TObject);
begin
frmCfGenDlg.Caption := 'Rename';
frmCfGenDlg.Label1.Caption := 'New Name';
if frmCfGenDlg.ShowModal = mrOK then begin
if tvDirectory.Selected.ImageIndex = 0 then
AbCompoundFile1.RenameFolder(tvDirectory.Selected.Text, frmCfGenDlg.Edit1.Text)
else
AbCompoundFile1.RenameFile(tvDirectory.Selected.Text, frmCfGenDlg.Edit1.Text);
end;
frmCfGenDlg.Caption := 'Change Directory';
frmCfGenDlg.Label1.Caption := 'New Directory';
end;
procedure TfmCfMain.tvDirectoryClick(Sender: TObject);
begin
if (tvDirectory.Selected.ImageIndex = 0) then begin
AbCompoundFile1.CurrentDirectory := tvDirectory.Selected.Text;
StatusBar1.SimpleText := ' Current Directory: ' + AbCompoundFile1.CurrentDirectory;
end;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,71 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
unit QuCfNewDg;
interface
uses
SysUtils, Classes, QGraphics, QForms, QStdCtrls, QControls, QDialogs;
type
TfrmCfNewDlg = class(TForm)
Label1: TLabel;
edtVolLbl: TEdit;
Label2: TLabel;
lbAllocSize: TListBox;
btnCancel: TButton;
btnOK: TButton;
procedure FormShow(Sender: TObject);
procedure btnOKClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmCfNewDlg: TfrmCfNewDlg;
implementation
{$R *.xfm}
procedure TfrmCfNewDlg.FormShow(Sender: TObject);
begin
lbAllocSize.ItemIndex := 2;
edtVolLbl.SetFocus;
end;
procedure TfrmCfNewDlg.btnOKClick(Sender: TObject);
begin
if edtVolLbl.Text = '' then begin
ShowMessage('Volume label required');
edtVolLbl.SetFocus;
end else
ModalResult := mrOK;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,95 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QUCOMPPAD.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit QuCompPad;
interface
uses
{$IFDEF MSWINDOWS}
Windows,
{$ELSE}
{$ENDIF}
SysUtils, Classes, QGraphics, QForms, AbZBrows, AbZipper, AbZipKit,
AbArcTyp, AbBrowse, AbBase, QControls, QExtCtrls, QStdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
AbZipKit1: TAbZipKit;
Panel1: TPanel;
Memo2: TMemo;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
ZnfName : string;
TxtName : string;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.xfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
ZnfName := ChangeFileExt(Application.ExeName, '.zip');
TxtName := ExtractFileName( ChangeFileExt(Application.ExeName, '.txt') );
with AbZipKit1 do begin
BaseDirectory := ExtractFilePath( Application.ExeName );
ChDir( BaseDirectory );
FileName := ZnfName;
if Count > 0 then begin
ExtractFiles( TxtName );
Memo1.Lines.LoadFromFile( TxtName );
end;
end;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
Memo1.Lines.SaveToFile( TxtName );
with AbZipKit1 do begin
if Count = 0 then
AddFiles( TxtName, 0 )
else
FreshenFiles( TxtName );
Save;
end;
DeleteFile( TxtName );
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,61 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QUDEMODLG.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit QuDemoDlg;
interface
uses
{$IFDEF WIN32}
Windows,
{$ELSE}
{$ENDIF}
SysUtils, Classes, QGraphics, QForms, QStdCtrls, QControls;
type
TDemoDlg = class(TForm)
Button1: TButton;
Button2: TButton;
Edit1: TEdit;
private
{ Private declarations }
public
{ Public declarations }
end;
var
DemoDlg: TDemoDlg;
implementation
{$R *.xfm}
end.

Binary file not shown.

View File

@@ -0,0 +1,200 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QUEXAMPLE.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit QuExample;
interface
uses
{$IFDEF WIN32}
Windows,
{$ELSE}
{$ENDIF}
SysUtils, Classes, QGraphics, QForms,
AbArcTyp, AbBase, AbUtils, QMenus, QDialogs, QTypes, AbQZpOut,
QStdCtrls, QControls, AbQMeter, QExtCtrls;
type
TForm1 = class(TForm)
BottomStatus: TPanel;
MainMenu1: TMainMenu;
File1: TMenuItem;
Open1: TMenuItem;
N1: TMenuItem;
Exit1: TMenuItem;
OpenDialog1: TOpenDialog;
TopStatus: TPanel;
PopupMenu1: TPopupMenu;
Add1: TMenuItem;
Delete1: TMenuItem;
Extract1: TMenuItem;
Freshen1: TMenuItem;
Move1: TMenuItem;
Panel1: TPanel;
Memo1: TMemo;
AbMeter1: TAbMeter;
AbMeter2: TAbMeter;
Label1: TLabel;
Label2: TLabel;
AbZipOutline1: TAbZipOutline;
procedure Open1Click(Sender: TObject);
procedure Exit1Click(Sender: TObject);
procedure AbZipOutline1Load(Sender: TObject);
procedure AbZipOutline1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Delete1Click(Sender: TObject);
procedure Extract1Click(Sender: TObject);
procedure Freshen1Click(Sender: TObject);
procedure Add1Click(Sender: TObject);
procedure Move1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure AbZipOutline1ProcessItemFailure(Sender: TObject;
Item: TAbArchiveItem; ProcessType: TAbProcessType;
ErrorClass: TAbErrorClass; ErrorCode: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses QuDemoDlg;
{$R *.xfm}
procedure TForm1.Open1Click(Sender: TObject);
begin
if OpenDialog1.Execute then begin
AbZipOutline1.OpenArchive(OpenDialog1.FileName);
end;
end;
procedure TForm1.Exit1Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.AbZipOutline1Load(Sender: TObject);
begin
TopStatus.Caption := ' ' + AbZipOutline1.FileName;
end;
procedure TForm1.AbZipOutline1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
i : LongInt;
begin
if Button = mbRight then begin
{prepare popup menu}
if AbZipOutline1.Count > 0 then begin
{there are items in the outline - select the item under the mouse}
i := AbZipOutline1.GetOutlineItem( X, Y );
if i <> -1 then
AbZipOutline1.SelectedItem := i;
end;
if AbZipOutline1.FileName <> '' then
Add1.Enabled := True
else
{archive has to be initialized before we can add to it}
Add1.Enabled := False;
if AbZipOutline1.SelectedZipItem <> nil then begin
{pointing at a file - allow file operations}
Delete1.Enabled := True;
Extract1.Enabled := True;
Freshen1.Enabled := True;
Move1.Enabled := True;
end
else begin
{pointing at a directory - don't allow file operations}
Delete1.Enabled := False;
Extract1.Enabled := False;
Freshen1.Enabled := False;
Move1.Enabled := False;
end;
end;
end;
procedure TForm1.Delete1Click(Sender: TObject);
begin
AbZipOutline1.DeleteFiles(AbZipOutline1.SelectedZipItem.FileName);
end;
procedure TForm1.Extract1Click(Sender: TObject);
begin
AbZipOutline1.ExtractFiles(AbZipOutline1.SelectedZipItem.FileName);
end;
procedure TForm1.Freshen1Click(Sender: TObject);
begin
AbZipOutline1.FreshenFiles(AbZipOutline1.SelectedZipItem.FileName);
end;
procedure TForm1.Add1Click(Sender: TObject);
begin
DemoDlg.Caption := 'Add Files with FileMask';
DemoDlg.Edit1.Text := '*.*';
DemoDlg.ShowModal;
if DemoDlg.ModalResult = mrOK then
AbZipOutline1.AddFiles(DemoDlg.Edit1.Text, 0);
end;
procedure TForm1.Move1Click(Sender: TObject);
begin
DemoDlg.Caption := 'Move File to New Name';
DemoDlg.Edit1.Text := AbZipOutline1.SelectedZipItem.FileName;
DemoDlg.ShowModal;
if DemoDlg.ModalResult = mrOK then
AbZipOutline1.Move(AbZipOutline1.SelectedZipItem, DemoDlg.Edit1.Text);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
AbZipOutline1.BaseDirectory := ExtractFilePath( Application.ExeName );
end;
procedure TForm1.AbZipOutline1ProcessItemFailure(Sender: TObject;
Item: TAbArchiveItem; ProcessType: TAbProcessType;
ErrorClass: TAbErrorClass; ErrorCode: Integer);
begin
case ProcessType of
ptAdd : ShowMessage( 'Failed to add ' + Item.Filename );
ptExtract : ShowMessage('Failed to extract ' + Item.Filename);
ptFreshen : ShowMessage('Failed to freshen ' + Item.Filename);
end;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,133 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QUFINDER.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit QuFinder;
interface
uses
{$IFDEF Win32}
Windows,
{$ELSE}
{$ENDIF}
SysUtils, Classes, QGraphics, QForms, AbZBrows, AbArcTyp, AbBrowse,
AbBase, QStdCtrls, QControls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Memo1: TMemo;
AbZipBrowser1: TAbZipBrowser;
Memo2: TMemo;
Label2: TLabel;
Button1: TButton;
Button2: TButton;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Edit1Change(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
Aborted: Boolean;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.xfm}
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Aborted := True;
end;
procedure TForm1.Edit1Change(Sender: TObject);
begin
Button1.Enabled := Length( Edit1.Text ) > 0;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
CurFile : string;
sr : TSearchRec;
begin
Button1.Enabled := False;
Memo1.Clear;
try
Button2.Enabled := True;
Aborted := False;
{look in the file list box for the file}
if FindFirst ('*', faAnyFile, sr) = 0 then
repeat
Application.ProcessMessages;
if Aborted then
break;
if CompareText( Edit1.Text, sr.Name ) = 0 then begin
{$IFDEF MSWINDOWS}
Memo1.Lines.Add( 'Found in ' + ExtractFilePath(sr.Name));
{$ENDIF}
{$IFDEF LINUX}
Memo1.Lines.Add( 'Found in ' + sr.PathOnly);
{$ENDIF}
break;
end;
{now add search of zip and self extracting files}
CurFile := UpperCase( sr.Name );
if ( Pos( '.zip', CurFile ) > 0 ) or
( Pos( '.exe', CurFile ) > 0 ) then begin
try
AbZipBrowser1.FileName := sr.Name;
if AbZipBrowser1.FindFile(Edit1.Text) >= 0 then
Memo1.Lines.Add( 'Found in ' + sr.Name);
except
end;
end;
until FindNext (sr) <> 0;
FindClose (sr);
finally
Memo1.Lines.Add( 'Done!' );
Edit1.Enabled := True;
Button1.Enabled := True;
Button2.Enabled := False;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Aborted := True;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,98 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QUMAKESFX.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit QuMakeSfx;
interface
uses
{$IFDEF WIN32}
Windows,
{$ELSE}
{$ENDIF}
SysUtils, Classes, QGraphics, QForms,
AbArcTyp, AbSelfEx, AbBase, QDialogs, QStdCtrls, QControls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
AbMakeSelfExe1: TAbMakeSelfExe;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
procedure AbMakeSelfExe1GetStubExe(Sender: TObject;
var aFilename: string; var Abort: Boolean);
procedure AbMakeSelfExe1GetZipFile(Sender: TObject;
var aFilename: string; var Abort: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.xfm}
uses
AbZipTyp;
procedure TForm1.Button1Click(Sender: TObject);
begin
if AbMakeSelfExe1.Execute then
ShowMessage(AbMakeSelfExe1.SelfExe + ' has been created');
end;
procedure TForm1.AbMakeSelfExe1GetStubExe(Sender: TObject;
var aFilename: string; var Abort: Boolean);
begin
OpenDialog1.Title := 'Select executable stub';
OpenDialog1.Filename := '';
OpenDialog1.Filter := 'Exe files|*.exe';
Abort := not OpenDialog1.Execute;
if not Abort then
aFileName := OpenDialog1.Filename;
end;
procedure TForm1.AbMakeSelfExe1GetZipFile(Sender: TObject;
var aFilename: string; var Abort: Boolean);
begin
OpenDialog1.Title := 'Select Zip File';
OpenDialog1.Filename := '';
OpenDialog1.Filter := 'Zip files|*.zip';
Abort := not OpenDialog1.Execute;
if not Abort then
aFileName := OpenDialog1.Filename;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,66 @@
(* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are 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/
*
* 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.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: USPLASH.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit QuSplash;
interface
uses
{$IFDEF Win32}
Windows,
{$ELSE}
{$ENDIF}
SysUtils, Classes, QGraphics, QForms, QTypes, QExtCtrls, QControls;
type
TSplash = class(TForm)
Image1: TImage;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Splash: TSplash;
implementation
{$R *.xfm}
procedure TSplash.Timer1Timer(Sender: TObject);
begin
Close;
end;
end.

Binary file not shown.