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

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,46 @@
(* ***** 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: ABBREXAM.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program Abbrexam;
{$R *.res}
uses
Forms,
udemodlg in 'udemodlg.pas' {DemoDlg},
uexample in 'Uexample.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
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 Basedlgu;
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 *.DFM}
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,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 ***** *)
{*********************************************************}
{* ABBREVIA: UNZIP.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program CabExt;
uses
Forms,
CabExt1 in 'CabExt1.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

Binary file not shown.

View File

@@ -0,0 +1,112 @@
(* ***** 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: EXTCAB.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit CabExt1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
AbArcTyp, AbCBrows, ComCtrls, AbCabExt, AbCabTyp, AbBase, AbBrowse, AbMeter, AbUtils;
type
TForm1 = class(TForm)
Button1: TButton;
OpenDialog1: TOpenDialog;
Memo1: TMemo;
Label1: TLabel;
Button2: TButton;
AbMeter1: TAbMeter;
AbCabExtractor1: TAbCabExtractor;
procedure Button1Click(Sender: TObject);
procedure AbCabExtractor1ConfirmProcessItem(Sender: TObject;
Item: TAbArchiveItem; ProcessType: TAbProcessType;
var Confirm: Boolean);
procedure Button2Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
const
MainCaption = 'Cabinet Extractor';
var
AbortFlag : Boolean;
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then begin
with AbCabExtractor1 do begin
FileName := OpenDialog1.FileName;
BaseDirectory := ExtractFilePath(FileName);
Cursor := crHourglass;
try
ExtractFiles('*.*');
except {swallow exception if aborted}
end;
Cursor := crDefault;
end;
end;
Caption := MainCaption;
AbortFlag := False;
end;
procedure TForm1.AbCabExtractor1ConfirmProcessItem(Sender: TObject;
Item: TAbArchiveItem; ProcessType: TAbProcessType; var Confirm: Boolean);
begin
Caption := 'Extracting ' + Item.Filename;
Confirm := not AbortFlag;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
AbortFlag := True;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
AbCabExtractor1.FileName := '';
end;
end.

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 ***** *)
{*********************************************************}
{* ABBREVIA: FINDER.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program CabFind;
uses
Forms,
CabFind1 in 'CabFind1.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

Binary file not shown.

View File

@@ -0,0 +1,128 @@
(* ***** 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: CABFIND1.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit CabFind1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, FileCtrl, Buttons, ExtCtrls,
AbArcTyp, AbBrowse, AbCBrows, AbBase;
type
TForm1 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Memo1: TMemo;
DriveComboBox1: TDriveComboBox;
DirectoryListBox1: TDirectoryListBox;
FileListBox1: TFileListBox;
Memo2: TMemo;
Label2: TLabel;
AbCabBrowser1: TAbCabBrowser;
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 *.DFM}
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
i : Integer;
CurFile : string;
begin
Button1.Enabled := False;
Memo1.Clear;
try
Button2.Enabled := True;
Aborted := False;
{look in the file list box for the file}
for i := 0 to pred( FileListBox1.Items.Count ) do begin
Application.ProcessMessages;
if Aborted then
break;
if CompareText( Edit1.Text, FileListBox1.Items[i] ) = 0 then begin
Memo1.Lines.Add( 'Found in ' + FileListBox1.Directory );
break;
end;
{now add search of zip and self extracting files}
CurFile := UpperCase( FileListBox1.Items[i] );
if ( Pos( '.CAB', CurFile ) > 0 ) then begin
try
AbCabBrowser1.FileName := FileListBox1.Items[i];
if AbCabBrowser1.FindFile(Edit1.Text) >= 0 then
Memo1.Lines.Add( 'Found in ' + FileListBox1.Items[i] );
except
end;
end;
end;
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.

View File

@@ -0,0 +1,36 @@
(* ***** 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 CabView;
uses
Forms,
CabView1 in 'CabView1.PAS' {Form1};
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

Binary file not shown.

View File

@@ -0,0 +1,444 @@
(* ***** 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: CABVIEW1.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit CabView1;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, Grids, StdCtrls, ExtCtrls, Menus, FileCtrl,
AbArcTyp, AbCabTyp, AbMeter, AbDlgDir, AbView, AbCView, AbCBrows,
AbBrowse, AbCabMak, AbCabKit, AbBase, AbUtils;
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;
CabView1: 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;
Extract1: TMenuItem;
ShowIcons1: TMenuItem;
Colors1: TMenuItem;
Selectedcolor: TMenuItem;
Selectedtextcolor: TMenuItem;
Alternatecolor1: TMenuItem;
Alternatetextcolor1: TMenuItem;
Panel2: TPanel;
AbMeter1: TAbMeter;
Label1: TLabel;
Label2: TLabel;
PopupMenu1: TPopupMenu;
Extract2: TMenuItem;
AbMeter2: TAbMeter;
AbCabView1: TAbCabView;
Extractoptions1: TMenuItem;
CreateDirs1: TMenuItem;
RestorePath1: TMenuItem;
AbCabKit1: TAbCabKit;
Additems1: TMenuItem;
procedure AbCabView1Click(Sender: TObject);
procedure AttributeClick(Sender: TObject);
procedure DisplayOptionClick(Sender: TObject);
procedure SortAttributeClick(Sender: TObject);
procedure SetAttribute(Attr : TAbViewAttribute; Value : Boolean);
procedure SetDisplayOption(Option : TAbDisplayOption; Value : Boolean);
procedure SetExtractOption(Option : TAbExtractOption; Value : Boolean);
procedure SetSortAttribute(Option : TAbSortAttribute; Value : Boolean);
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 ExtractOptionClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Selected1Click(Sender: TObject);
procedure Selectedtext1Click(Sender: TObject);
procedure Rowheight1Click(Sender: TObject);
procedure Headerheight1Click(Sender: TObject);
procedure Extract1Click(Sender: TObject);
procedure AbCabKit1ConfirmProcessItem(Sender: TObject;
Item: TAbArchiveItem; ProcessType: TAbProcessType;
var Confirm: Boolean);
procedure AbCabView1Change(Sender: TObject);
procedure Alternatecolor1Click(Sender: TObject);
procedure Alternatetextcolor1Click(Sender: TObject);
procedure AbCabKit1Save(Sender: TObject);
procedure Additems1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
const
MainCaption = ' TAbCabView example';
{ -------------------------------------------------------------------------- }
procedure TForm1.SetAttribute(Attr : TAbViewAttribute; Value : Boolean);
procedure SetMenu(Item : TMenuItem);
begin
Item.Checked := Value;
if Item.Checked then
AbCabView1.Attributes := AbCabView1.Attributes + [Attr]
else
AbCabView1.Attributes := AbCabView1.Attributes - [Attr];
end;
begin
case Attr of
vaItemName : SetMenu(ItemName1);
vaPacked : SetMenu(Packed1);
vaMethod : SetMenu(Method1);
vaRatio : SetMenu(Ratio1);
vaCRC : SetMenu(CRC1);
vaFileAttributes : SetMenu(FileAttributes1);
vaFileType : SetMenu(FileType1);
vaEncryption : SetMenu(Encryption1);
vaTimeStamp : SetMenu(TimeStamp1);
vaFileSize : SetMenu(FileSize1);
vaVersionMade : SetMenu(VersionMade1);
vaVersionNeeded : SetMenu(VersionNeeded1);
vaPath : SetMenu(Path1);
end;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.SetDisplayOption(Option : TAbDisplayOption; Value : Boolean);
procedure SetMenu(Item : TMenuItem);
begin
Item.Checked := Value;
if Item.Checked then
AbCabView1.DisplayOptions := AbCabView1.DisplayOptions + [Option]
else
AbCabView1.DisplayOptions := AbCabView1.DisplayOptions - [Option]
end;
begin
case Option of
doAlternateColors : SetMenu(AlternateColors1);
doColLines : SetMenu(ColumnLines1);
doColMove : SetMenu(ColumnMoving1);
doColSizing : SetMenu(ColumnResizing1);
doMultiSelect : SetMenu(MultiSelect1);
doRowLines : SetMenu(RowLines1);
doShowIcons : SetMenu(ShowIcons1);
doThumbTrack : SetMenu(ThumbTracking1);
doTrackActiveRow : SetMenu(TrackActiveRow1);
end;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.SetExtractOption(Option : TAbExtractOption; Value : Boolean);
procedure SetMenu(Item : TMenuItem);
begin
Item.Checked := Value;
if Item.Checked then
AbCabKit1.ExtractOptions := AbCabKit1.ExtractOptions + [Option]
else
AbCabKit1.ExtractOptions := AbCabKit1.ExtractOptions - [Option]
end;
begin
case Option of
eoCreateDirs : SetMenu(CreateDirs1);
eoRestorePath : SetMenu(RestorePath1);
end;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.SetSortAttribute(Option : TAbSortAttribute; Value : Boolean);
procedure SetMenu(Item : TMenuItem);
begin
Item.Checked := Value;
if Item.Checked then
AbCabView1.SortAttributes := AbCabView1.SortAttributes + [Option]
else
AbCabView1.SortAttributes := AbCabView1.SortAttributes - [Option];
end;
begin
case Option of
saItemName : SetMenu(ItemName2);
saPacked : SetMenu(Packed2);
saRatio : SetMenu(Ratio2);
saTimeStamp : SetMenu(TimeStamp2);
saFileSize : SetMenu(FileSize2);
end;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.AbCabView1Click(Sender: TObject);
begin
Panel1.Caption := AbCabView1.Items[AbCabView1.ActiveRow].Filename;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Open1Click(Sender: TObject);
begin
OpenDialog1.Filename := '*.cab';
if OpenDialog1.Execute then begin
AbCabKit1.Filename := OpenDialog1.Filename;
{ AbCabKit1.BaseDirectory := ExtractFilePath(AbCabKit1.Filename);}
Caption := AbCabKit1.Filename +
' ' + IntToStr(AbCabView1.Count) + ' items';
Action1.Enabled := True;
end;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Close1Click(Sender: TObject);
begin
AbCabKit1.Filename := '';
Caption := MainCaption;
Panel1.Caption := '';
Action1.Enabled := False;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.AttributeClick(Sender: TObject);
begin
with TMenuItem(Sender) do
SetAttribute(TAbViewAttribute(Tag), not Checked);
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.DisplayOptionClick(Sender: TObject);
begin
with TMenuItem(Sender) do
SetDisplayOption(TAbDisplayOption(Tag), not Checked);
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.SortAttributeClick(Sender: TObject);
begin
with TMenuItem(Sender) do
SetSortAttribute(TAbSortAttribute(Tag), not Checked);
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.SelectAll1Click(Sender: TObject);
begin
AbCabView1.SelectAll;
AbCabView1Click(nil);
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.ClearSelections1Click(Sender: TObject);
begin
AbCabView1.ClearSelections;
AbCabView1Click(nil);
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.ExtractOptionClick(Sender: TObject);
begin
with TMenuItem(Sender) do
SetExtractOption(TAbExtractOption(Tag), not Checked);
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Font1Click(Sender: TObject);
begin
FontDialog1.Font := AbCabView1.Font;
if FontDialog1.Execute then
AbCabView1.Font := FontDialog1.Font;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Exit1Click(Sender: TObject);
begin
Close;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.FormCreate(Sender: TObject);
var
i : TAbViewAttribute;
j : TAbDisplayOption;
k : TAbSortAttribute;
m : TAbExtractOption;
begin
for i := Low(TAbViewAttribute) to High(TAbViewAttribute) do
SetAttribute(i, i in AbCabView1.Attributes);
for j := Low(TAbDisplayOption) to High(TAbDisplayOption) do
SetDisplayOption(j, j in AbCabView1.DisplayOptions);
for k := Low(TAbSortAttribute) to High(TAbSortAttribute) do
SetSortAttribute(k, k in AbCabView1.SortAttributes);
for m := Low(TAbExtractOption) to High(TAbExtractOption) do
SetExtractOption(m, m in AbCabKit1.ExtractOptions);
Caption := MainCaption;
Action1.Enabled := AbCabKit1.FileName <> '';
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Selected1Click(Sender: TObject);
begin
if ColorDialog1.Execute then
AbCabView1.Colors.Selected := ColorDialog1.Color;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Selectedtext1Click(Sender: TObject);
begin
if ColorDialog1.Execute then
AbCabView1.Colors.SelectedText := ColorDialog1.Color;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Rowheight1Click(Sender: TObject);
var
s : string;
begin
s := IntToStr(AbCabView1.DefaultRowHeight);
if InputQuery(MainCaption, 'Row Height', s) then
AbCabView1.DefaultRowHeight := StrToIntDef(s, 18);
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Headerheight1Click(Sender: TObject);
var
s : string;
begin
s := IntToStr(AbCabView1.HeaderRowHeight);
if InputQuery(MainCaption, 'Header Height', s) then
AbCabView1.HeaderRowHeight := StrToIntDef(s, 18);
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Extract1Click(Sender: TObject);
var
i : Longint;
Continue : Boolean;
begin
with TAbDirDlg.Create(Self) do begin
Caption := 'Directory';
AdditionalText := 'Select folder to extract into';
Continue := Execute;
if Continue then
AbCabKit1.BaseDirectory := SelectedFolder;
Free;
end;
if not Continue then
Exit;
Panel1.Caption := '';
with AbCabView1 do
for i := 0 to Pred(Count) do
Items[i].Tagged := Selected[i];
AbCabKit1.ExtractTaggedItems;
AbCabView1.ClearSelections;
Panel1.Caption := '';
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.AbCabKit1ConfirmProcessItem(Sender: TObject;
Item: TAbArchiveItem; ProcessType: TAbProcessType; var Confirm: Boolean);
var
s : string;
begin
if (ProcessType = ptExtract) then
s := 'Extracting '
else
s := '??? ';
Panel1.Caption := s + Item.Filename;
Confirm := True;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.AbCabView1Change(Sender: TObject);
begin
Caption := AbCabKit1.Filename +
' ' + IntToStr(AbCabView1.Count) + ' items';
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Alternatecolor1Click(Sender: TObject);
begin
if ColorDialog1.Execute then
AbCabView1.Colors.Alternate := ColorDialog1.Color;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Alternatetextcolor1Click(Sender: TObject);
begin
if ColorDialog1.Execute then
AbCabView1.Colors.AlternateText := ColorDialog1.Color;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.AbCabKit1Save(Sender: TObject);
begin
Panel1.Caption := 'Saving ' + AbCabKit1.Filename;
end;
{ -------------------------------------------------------------------------- }
procedure TForm1.Additems1Click(Sender: TObject);
var
i : Integer;
begin
with OpenDialog1 do begin
FileName := '*.*';
Title := 'Select files to add';
if Execute then
if (Files.Count > 0) then
for i := 0 to Pred(Files.Count) do
AbCabKit1.AddFiles(Files[i], 0);
end;
end;
end.

View File

@@ -0,0 +1,14 @@
program ComCtrlsDemo;
uses
Forms,
ComCtrlsMain in 'ComCtrlsMain.pas' {frmComCtrls};
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TfrmComCtrls, frmComCtrls);
Application.Run;
end.

View File

@@ -0,0 +1,156 @@
object frmComCtrls: TfrmComCtrls
Left = 0
Top = 0
Caption = 'AbComCtrls Example'
ClientHeight = 524
ClientWidth = 699
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
Menu = MainMenu
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Splitter1: TSplitter
Left = 153
Top = 0
Height = 524
ExplicitLeft = 360
ExplicitTop = 240
ExplicitHeight = 100
end
object AbTreeView: TAbTreeView
Left = 0
Top = 0
Width = 153
Height = 524
Align = alLeft
Indent = 19
TabOrder = 0
Items.NodeData = {
0301000000200000000000000000000000FFFFFFFFFFFFFFFF00000000000000
000000000001015C00}
Archive = AbUnZipper
ListView = AbListView
end
object Panel1: TPanel
Left = 156
Top = 0
Width = 543
Height = 524
Align = alClient
Caption = 'Panel1'
TabOrder = 1
ExplicitLeft = 264
ExplicitTop = 272
ExplicitWidth = 185
ExplicitHeight = 41
object Splitter2: TSplitter
Left = 1
Top = 335
Width = 541
Height = 3
Cursor = crVSplit
Align = alBottom
ExplicitLeft = 539
ExplicitTop = 1
ExplicitWidth = 337
end
object Memo1: TMemo
Left = 1
Top = 338
Width = 541
Height = 185
Align = alBottom
Lines.Strings = (
'Memo1')
TabOrder = 0
ExplicitLeft = 354
ExplicitTop = 1
ExplicitWidth = 522
end
object AbListView: TAbListView
Left = 1
Top = 1
Width = 541
Height = 334
Align = alClient
Archive = AbUnZipper
TabOrder = 1
TreeView = AbTreeView
OnSelectItem = ListViewSelectItem
ExplicitLeft = 328
ExplicitTop = 112
ExplicitWidth = 250
ExplicitHeight = 150
end
end
object AbUnZipper: TAbUnZipper
Left = 96
Top = 24
end
object MainMenu: TMainMenu
Left = 16
Top = 24
object mnuFile: TMenuItem
Caption = 'File'
object mnuOpenArchive: TMenuItem
Caption = 'Open...'
OnClick = OpenArchiveClick
end
end
object mnuView: TMenuItem
Caption = 'View'
object mnuAllFiles: TMenuItem
AutoCheck = True
Caption = 'All Files (WinZip Style)'
GroupIndex = 1
RadioItem = True
OnClick = FolderStyleClick
end
object mnuFilesByFolder: TMenuItem
AutoCheck = True
Caption = 'Files By Folder (Explorer Style)'
Checked = True
GroupIndex = 1
RadioItem = True
OnClick = FolderStyleClick
end
object N1: TMenuItem
Caption = '-'
GroupIndex = 1
end
object mnuIcons: TMenuItem
AutoCheck = True
Caption = 'Icons'
Checked = True
GroupIndex = 2
RadioItem = True
OnClick = ViewStyleClick
end
object mnuList: TMenuItem
AutoCheck = True
Caption = 'List'
GroupIndex = 2
RadioItem = True
OnClick = ViewStyleClick
end
object mnuDetails: TMenuItem
AutoCheck = True
Caption = 'Details'
GroupIndex = 2
RadioItem = True
OnClick = ViewStyleClick
end
end
end
object OpenDialog: TOpenDialog
Filter = 'Archive Files|*.zip;*.tar;*.gz;*.tgz;*.bz2;*.tbz'
Options = [ofEnableSizing]
Left = 56
Top = 24
end
end

View File

@@ -0,0 +1,123 @@
(* ***** 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
* Craig Peterson <capeterson@users.sourceforge.net>
*
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* This demonstrates the TAbTreeView and TAbListView *}
{* components. By setting references to each other and *}
{* a shared TAbBaseBrowser descendant (e.g., TAbZipKit *}
{* you can have a WinZip/Explorer-like interface without *}
{* any code. *}
{*********************************************************}
unit ComCtrlsMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Menus, ComCtrls, AbComCtrls, AbBase, AbBrowse,
AbZBrows, AbUnzper;
type
TfrmComCtrls = class(TForm)
AbUnZipper: TAbUnZipper;
AbTreeView: TAbTreeView;
AbListView: TAbListView;
MainMenu: TMainMenu;
mnuFile: TMenuItem;
mnuOpenArchive: TMenuItem;
Splitter1: TSplitter;
Splitter2: TSplitter;
Memo1: TMemo;
OpenDialog: TOpenDialog;
mnuView: TMenuItem;
mnuAllFiles: TMenuItem;
mnuFilesByFolder: TMenuItem;
N1: TMenuItem;
mnuIcons: TMenuItem;
mnuList: TMenuItem;
mnuDetails: TMenuItem;
Panel1: TPanel;
procedure FolderStyleClick(Sender: TObject);
procedure ListViewSelectItem(Sender: TObject; Item: TListItem;
Selected: Boolean);
procedure OpenArchiveClick(Sender: TObject);
procedure ViewStyleClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmComCtrls: TfrmComCtrls;
implementation
{$R *.dfm}
procedure TfrmComCtrls.FolderStyleClick(Sender: TObject);
begin
AbTreeView.Visible := mnuFilesByFolder.Checked;
Splitter1.Visible := mnuFilesByFolder.Checked;
AbListView.FlatList := mnuAllFiles.Checked;
end;
procedure TfrmComCtrls.ListViewSelectItem(Sender: TObject; Item: TListItem;
Selected: Boolean);
var
Stream: TMemoryStream;
begin
if TAbListItem(Item).IsDirectory then
Memo1.Clear
else begin
Stream := TMemoryStream.Create;
try
AbUnZipper.ExtractToStream(TAbListItem(Item).ArchiveItem.FileName, Stream);
Stream.Position := 0;
Memo1.Lines.LoadFromStream(Stream);
finally
Stream.Free;
end;
end;
end;
procedure TfrmComCtrls.OpenArchiveClick(Sender: TObject);
begin
if OpenDialog.Execute then
AbUnZipper.FileName := OpenDialog.FileName;
end;
procedure TfrmComCtrls.ViewStyleClick(Sender: TObject);
begin
if mnuIcons.Checked then
AbListView.ViewStyle := vsIcon
else if mnuList.Checked then
AbListView.ViewStyle := vsList
else
AbListView.ViewStyle := vsReport;
end;
end.

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 ***** *)
{*********************************************************}
{* ABBREVIA: COMPPAD.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program CompPad;
uses
Forms,
ucomppad in 'UCOMPPAD.PAS' {Form1};
begin
Application.Initialize;
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: CONTENTS.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program Contents;
uses
Forms,
UContent in 'UCONTENT.PAS' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

Binary file not shown.

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: CONTENTS.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program ExCBrows;
uses
Forms,
ExCBrowu in 'ExCBrowu.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

Binary file not shown.

View File

@@ -0,0 +1,130 @@
(* ***** 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: UCONTENT.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit ExCBrowu;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls,
AbArcTyp, AbCBrows, AbMeter, AbBrowse, AbBase;
type
TForm1 = class(TForm)
OpenDialog1: TOpenDialog;
AbCabBrowser1: TAbCabBrowser;
Memo1: TMemo;
Panel1: TPanel;
Button1: TButton;
Button2: TButton;
Label1: TLabel;
Panel2: TPanel;
AbMeter1: TAbMeter;
AbMeter2: TAbMeter;
Label2: TLabel;
Label3: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure AbCabBrowser1Load(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
const
BoolToStr : array[Boolean] of string = ('No', 'Yes');
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
AbCabBrowser1.FileName := OpenDialog1.FileName;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
AbCabBrowser1.Filename := '';
Memo1.Clear;
end;
procedure TForm1.AbCabBrowser1Load(Sender: TObject);
var
i : Integer;
LI : Longint;
DT : TDateTime;
s : string;
begin
Memo1.Clear;
with AbCabBrowser1 do begin
Memo1.Lines.Add(Filename);
Memo1.Lines.Add('----------------------------------------------');
Memo1.Lines.Add(' Size: ' + #9 + #9 + IntToStr(CabSize));
Memo1.Lines.Add(' Folders: ' + #9 + #9 + IntToStr(FolderCount));
Memo1.Lines.Add(' Files: ' + #9 + #9 + IntToStr(Count));
Memo1.Lines.Add(' SetID: ' + #9 + #9 + IntToStr(SetID));
Memo1.Lines.Add(' Cab #: ' + #9 + #9 + IntToStr(CurrentCab));
Memo1.Lines.Add(' hasPrev: ' + #9 + BoolToStr[HasPrev]);
Memo1.Lines.Add(' hasNext: ' + #9 + BoolToStr[HasNext]);
Memo1.Lines.Add(' ');
if (Count > 0) then begin
Memo1.Lines.Add('Files' + #9 + #9 + 'Size' +
#9 + 'Timestamp' + #9 + #9 + 'Attributes' + #9 +'Partial File');
Memo1.Lines.Add('--------------------------------------------' +
'--------------------------------------------' +
'--------------------------------------------');
for i := 0 to Pred(Count) do begin
LI := LongInt(Items[i].LastModFileDate) shl 16 +
Items[i].LastModFileTime;
DT := FileDateToDateTime(LI);
s := Items[i].FileName + #9 +
IntToStr(Items[i].UnCompressedSize) + #9 +
DateTimeToStr(DT) + #9 +
IntToStr(Items[i].ExternalFileAttributes) + #9 +
BoolToStr[Items[i].PartialFile];
Memo1.Lines.Add(s);
end;
end;
end;
end;
end.

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 ExCf;
uses
Forms,
uCfMain in 'uCfMain.pas' {fmCfMain},
uCfGenDg in 'uCfGenDg.pas' {frmCfGenDlg},
uCfNewDg in 'uCfNewDg.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: EXFILTER.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program Exfilter;
uses
Forms,
Exfiltru in 'EXFILTRU.PAS' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

Binary file not shown.

View File

@@ -0,0 +1,225 @@
(* ***** 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: EXFILTRU.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit Exfiltru;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Gauges, Grids, ExtCtrls, FileCtrl,
AbZipper, AbArcTyp, AbZBrows, AbMeter, AbZipKit, AbView, AbZView, AbBrowse,
AbBase, AbUtils;
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;
DirectoryListBox1: TDirectoryListBox;
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;
DirectoryListBox2: TDirectoryListBox;
AbZipKit1: TAbZipKit;
AbMeter1: TAbMeter;
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);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
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 := DirectoryListBox1.Directory;
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 := DirectoryListBox2.Directory;
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;
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 ExZipper;
uses
Forms,
Exzippru in 'EXZIPPRU.PAS' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
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: EXZIPPRU.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit ExZippru;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, FileCtrl,
AbArcTyp, AbZipOut, AbZBrows, AbZipper, AbBrowse, AbBase, AbMeter, AbUtils;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
OpenDialog1: TOpenDialog;
DirectoryListBox1: TDirectoryListBox;
DriveComboBox1: TDriveComboBox;
Label1: TLabel;
AbZipper1: TAbZipper;
Button3: TButton;
AbMeter1: TAbMeter;
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);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
DirectoryListBox1Change(nil);
AbZipper1.LogFile := ExtractFilePath(Application.ExeName) + 'Log.txt';
end;
procedure TForm1.DirectoryListBox1Change(Sender: TObject);
begin
AbZipper1.BaseDirectory := DirectoryListBox1.Directory;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
OpenDialog1.Filename := '*.zip';
OpenDialog1.InitialDir := DirectoryListBox1.Directory;
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;
end.

Binary file not shown.

View File

@@ -0,0 +1,88 @@
(* ***** 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 FCITest1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, AbCabKit{, TestCab};
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
OpenDialog1: TOpenDialog;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
OpenDialog1.Filename := '*.cab';
if OpenDialog1.Execute then begin
Memo1.Clear;
MakeCab(OpenDialog1.Filename);
Memo1.Lines.Assign(TestCab.AuditTrail);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
i : Integer;
begin
OpenDialog1.Filename := '*.*';
if OpenDialog1.Execute then
if OpenDialog1.Files.Count > 0 then
for i := 0 to Pred(OpenDialog1.Files.Count) do begin
try
AddFile(OpenDialog1.Files[i]);
finally
end;
end;
Memo1.Lines.Assign(TestCab.AuditTrail);
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
CloseArchive;
Memo1.Lines.Assign(TestCab.AuditTrail);
end;
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: FINDER.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program finder;
uses
Forms,
ufinder in 'ufinder.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: MAKECAB.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program MakeCab;
uses
Forms,
MakeCab1 in 'MakeCab1.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

Binary file not shown.

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: MAKECAB1.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit MakeCab1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Gauges, ExtCtrls, ComCtrls,
AbArcTyp, AbCBrows, AbCabMak, AbCabTyp, AbMeter, AbBrowse, AbBase;
type
TForm1 = class(TForm)
AddBtn: TButton;
OpenDialog1: TOpenDialog;
Label1: TLabel;
CreateBtn: TButton;
CloseBtn: TButton;
Panel1: TPanel;
NewFolderBtn: TButton;
Label2: TLabel;
NewCabBtn: TButton;
AbMeter1: TAbMeter;
AbMakeCab1: TAbMakeCab;
procedure AddBtnClick(Sender: TObject);
procedure CreateBtnClick(Sender: TObject);
procedure CloseBtnClick(Sender: TObject);
procedure NewFolderBtnClick(Sender: TObject);
procedure NewCabBtnClick(Sender: TObject);
procedure AbMakeCab1ArchiveItemProgress(Sender: TObject;
Item: TAbArchiveItem; Progress: Byte; var Abort: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
const
MainCaption = 'Make Cabinet Archive';
procedure TForm1.CreateBtnClick(Sender: TObject);
begin
OpenDialog1.Filename := '*.Cab';
OpenDialog1.Title := 'Name of 1st cabinet';
if OpenDialog1.Execute then begin
Panel1.Caption := 'Creating ' + OpenDialog1.FileName;
AbMakeCab1.OpenArchive(OpenDialog1.FileName);
Caption := AbMakeCab1.FileName;
Panel1.Caption := 'Idle';
end;
end;
procedure TForm1.AddBtnClick(Sender: TObject);
var
i : Integer;
SC : TCursor;
FileList : TStringList;
begin
OpenDialog1.Filename := '*.*';
OpenDialog1.Title := 'Add files to cabinet';
if OpenDialog1.Execute then
if (OpenDialog1.Files.Count > 0) then begin
SC := Cursor;
Cursor := crHourglass;
FileList := TStringList.Create;
try
FileList.Assign(OpenDialog1.Files);
for i := 0 to Pred(FileList.Count) do
AbMakeCab1.AddFiles(FileList.Strings[i], 0);
finally
FileList.Free;
end;
Cursor := SC;
Panel1.Caption := 'Idle';
end;
end;
procedure TForm1.CloseBtnClick(Sender: TObject);
begin
Panel1.Caption := 'Closing ' + AbMakeCab1.FileName;
AbMakeCab1.CloseArchive;
Caption := MainCaption;
Panel1.Caption := 'Idle';
end;
procedure TForm1.NewFolderBtnClick(Sender: TObject);
begin
AbMakeCab1.StartNewFolder;
end;
procedure TForm1.NewCabBtnClick(Sender: TObject);
begin
AbMakeCab1.StartNewCabinet;
end;
procedure TForm1.AbMakeCab1ArchiveItemProgress(Sender: TObject;
Item: TAbArchiveItem; Progress: Byte; var Abort: Boolean);
begin
Panel1.Caption := 'Adding ' + ExtractFilename(Item.Filename);
Abort := False;
end;
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: SELFEXV.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program Selfstbv;
uses
Forms,
Slfstbv1 in 'SLFSTBV1.PAS' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,82 @@
(* ***** 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: SELFSTUB.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 Selfstub;
{$APPTYPE CONSOLE}
uses
AbArcTyp,
AbUnzPrc,
AbUtils,
AbZipTyp,
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.

Binary file not shown.

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: SLFSTBV1.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit Slfstbv1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
AbZBrows, AbUnZper, AbArcTyp, AbBrowse, AbBase, AbUtils;
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 *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
AbUnzipper1.FileName := ExtractFilePath(Application.ExeName) + 'abtest.exe';
AbUnzipper1.ArchiveType := atSelfExtZip;
AbUnzipper1.ExtractFiles( '*.*' );
end;
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: STREAMS.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program Streams;
uses
Forms,
Streams1 in 'Streams1.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

Binary file not shown.

View File

@@ -0,0 +1,148 @@
(* ***** 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: STREAMS1.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit Streams1;
interface
uses
Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Grids,
AbView, AbZView, Menus, AbArcTyp, AbZBrows, AbUnZper,
AbZipper, AbZipKit, AbBrowse, AbBase;
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 *.DFM}
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.

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: STRMBMP.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program StrmBmp;
uses
Forms,
StrmBmpU in 'StrmBmpU.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
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: STRMBMPU.DPR *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit StrmBmpU;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
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 *.DFM}
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.

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: STRMPAD.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program StrmPad;
uses
Forms,
Ustrpad in 'Ustrpad.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,10 @@
;{*********************************************************}
;{* ABBREVIA: TPZIP.RC *}
;{* Copyright (c) TurboPower Software Co 1997 *}
;{* All rights reserved. *}
;{*********************************************************}
;{* ABBREVIA Example program file *}
;{*********************************************************}
MAINICON ICON "tpzip.ico"

View File

@@ -0,0 +1,52 @@
(* ***** 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: TPZIP.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program TPZip;
uses
Forms,
ubasedlg in 'UBASEDLG.PAS' {BaseDirDlg},
udemodlg in 'UDEMODLG.PAS' {DemoDlg},
dgAbout in 'DGABOUT.PAS' {dlgAboutBox},
usplash in 'USPLASH.PAS' {Splash},
UMain in 'Umain.pas' {Form1};
{$R *.R32}
begin
Application.Title := 'TP Zip';
Application.HelpFile := 'Tpzip31.hlp';
Application.CreateForm(TForm1, Form1);
Splash := TSplash.Create( Application );
Splash.Show;
Splash.Refresh;
Application.Run;
end.

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,85 @@
(* ***** 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: UCONTENT.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit UContent;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
AbZBrows, AbArcTyp, AbBrowse, AbBase;
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 *.DFM}
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.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,199 @@
(* ***** 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: UEXAMPLE.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit uexample;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Menus, ExtCtrls, Gauges, StdCtrls,
AbZipOut, AbArcTyp, AbMeter, AbBase, AbUtils;
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 udemodlg;
{$R *.DFM}
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.

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: UNZIP.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program Unzip;
uses
Forms,
Uunzip in 'Uunzip.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,148 @@
(* ***** 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 UsingAPI;
{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 [ cmStored..cmDCLImploded ] of string;
const
MethodStrings : TMethodStrings = ('UnStoring', 'UnShrinking', 'UnReducing',
'UnReducing', 'UnReducing', 'UnReducing',
'Exploding', 'DeTokenizing', 'Inflating',
'Enhanced Inflating', 'DCL Exploding');
var
ActionString : string;
CompMethod: TAbZipCompressionMethod;
begin
case Item.Action of
aaAdd : ActionString := 'Adding ';
aaFreshen : ActionString := 'Freshening ';
else begin
CompMethod := (Item as TAbZipItem).CompressionMethod;
if CompMethod in [cmStored..cmDCLImploded] then
ActionString := MethodStrings[(Item as TAbZipItem).CompressionMethod] +
' '
else
ActionString := 'Decompressing ';
end;
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.

Binary file not shown.

View File

@@ -0,0 +1,115 @@
(* ***** 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: USTRPAD.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit Ustrpad;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
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 *.DFM}
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,78 @@
(* ***** 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: UUNZIP.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit Uunzip;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
AbZBrows, AbUnZper, AbArcTyp, AbMeter, AbBrowse, AbBase;
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 *.DFM}
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: UZIP.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit Uzip;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Gauges,
AbZipper, AbArcTyp, AbZBrows, AbMeter, AbBrowse, AbBase;
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 *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
AbZipper1.AddFiles( OpenDialog1.FileName, 0 );
end;
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: ZIPREG.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program ZipReg;
uses
Forms,
ZipReg1 in 'ZipReg1.pas' {ExZipAssociation};
begin
Application.CreateForm(TExZipAssociation, ExZipAssociation);
Application.Run;
end.

Binary file not shown.

View File

@@ -0,0 +1,139 @@
(* ***** 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: ZIPREG1.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit ZipReg1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, ExtCtrls, Buttons;
type
TExZipAssociation = class(TForm)
CheckZipReg: TButton;
RegZipExt: TButton;
Replace: TCheckBox;
ExitBtn: TButton;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Icon1: TImage;
ID1: TEdit;
FileType1: TEdit;
App1: TEdit;
Browse1: TSpeedButton;
OpenDialog1: TOpenDialog;
procedure CheckZipRegClick(Sender: TObject);
procedure RegZipExtClick(Sender: TObject);
procedure ExitBtnClick(Sender: TObject);
procedure Browse1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
ExZipAssociation: TExZipAssociation;
implementation
{$R *.DFM}
uses
AbZipExt, ShellApi;
var
App, ID, FileType : string;
FN : array[0..255] of char;
IconIndex : Word;
procedure TExZipAssociation.CheckZipRegClick(Sender: TObject);
begin
App := '';
ID := '';
FileType := '';
if AbGetZipAssociation(App, ID, FileType) then begin
GroupBox1.Caption := ' ''zip'' is currently registered ';
StrPCopy(FN, App);
{$IFNDEF Win32}
Icon1.Picture.Icon.Handle := ExtractIcon(HInstance, FN, 0);
{$ELSE}
Icon1.Picture.Icon.Handle := ExtractAssociatedIcon(HInstance, FN, IconIndex);
{$ENDIF}
end else begin
GroupBox1.Caption := ' ''zip'' is not registered ';
Icon1.Picture.Icon.Handle := 0;
end;
ID1.Text := ID;
FileType1.Text := FileType;
App1.Text := App;
end;
procedure TExZipAssociation.RegZipExtClick(Sender: TObject);
begin
if (AbExistingZipAssociation and not Replace.Checked) then
CheckZipRegClick(nil)
else begin
App := App1.Text;
FileType := FileType1.Text;
ID := ID1.Text;
if AbRegisterZipExtension(App, ID, FileType, Replace.Checked) then
CheckZipRegClick(nil)
else begin
GroupBox1.Caption := ' Error occurred during registration ';
Icon1.Picture.Icon.Handle := 0;
end;
end;
end;
procedure TExZipAssociation.ExitBtnClick(Sender: TObject);
begin
Close;
end;
procedure TExZipAssociation.Browse1Click(Sender: TObject);
begin
OpenDialog1.Title := 'Select application to associate with ''zip'' files';
OpenDialog1.Filename := '*.exe';
if OpenDialog1.Execute then begin
App := OpenDialog1.Filename;
App1.Text := App;
end;
end;
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: ZIPVIEW.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program ZipView;
uses
Forms,
ZipView1 in 'ZipView1.PAS' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

Binary file not shown.

View File

@@ -0,0 +1,536 @@
(* ***** 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: ZIPVIEW1.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit ZipView1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Grids, StdCtrls, ExtCtrls, Menus, FileCtrl, Gauges, ComCtrls,
AbArcTyp, AbUtils, AbZipper, AbZipKit, AbZipTyp, AbZBrows, AbMeter,
AbDlgDir, AbView, AbZView, AbBrowse, AbBase;
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;
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);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
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
AbZipView1.BeginUpdate;
// AbZipKit1.FileName := '';
AbZipKit1.Filename := OpenDialog1.Filename;
Caption := AbZipKit1.Filename +
' ' + IntToStr(AbZipView1.Count) + ' items';
Action1.Enabled := True;
AbZipView1.EndUpdate;
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;
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: ZIPPER.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program zipper;
uses
Forms,
Uzip in 'Uzip.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

Binary file not shown.

View File

@@ -0,0 +1,86 @@
(* ***** 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 *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit dgAbout;
interface
uses
Windows, Classes, Graphics, Forms, Controls, StdCtrls,
Buttons, ExtCtrls;
type
TdlgAboutBox = class(TForm)
Panel1: TPanel;
ProgramIcon: TImage;
Label7: TLabel;
Label8: TLabel;
Panel2: TPanel;
lnTitleShadow: TLabel;
lblTitle: TLabel;
Label5: 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 *.DFM}
uses
AbConst;
procedure TdlgAboutBox.FormCreate(Sender: TObject);
begin
Version.Caption := 'Abbrevia ' + AbVersionS;
end;
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: MAKESFX.DPR *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
program makesfx;
uses
Forms,
umakesfx in 'umakesfx.pas' {Form1};
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
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 spntst0;
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 *.DFM}
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,67 @@
(* ***** 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 uCfGenDg;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
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 *.DFM}
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,247 @@
(* ***** 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: UCFMAIN.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit uCfMain;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, Menus, ImgList, ComCtrls,
AbHexVw, AbCompnd;
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);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
fmCfMain: TfmCfMain;
AbCompoundFile1 : TAbCompoundFile;
HexV : THexView;
implementation
uses uCfNewDg, uCfGenDg;
{$R *.DFM}
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 not Assigned(tvDirectory.Selected) then
tvDirectory.Selected := tvDirectory.TopItem;
if (tvDirectory.Selected.ImageIndex = 0) then begin
AbCompoundFile1.CurrentDirectory := tvDirectory.Selected.Text;
StatusBar1.SimpleText := ' Current Directory: ' + AbCompoundFile1.CurrentDirectory;
end;
end;
procedure TfmCfMain.FormDestroy(Sender: TObject);
begin
if AbCompoundFile1 <> nil then
AbCompoundFile1.Free;
end;
end.

Binary file not shown.

View File

@@ -0,0 +1,72 @@
(* ***** 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 uCfNewDg;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
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 *.DFM}
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,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: UBASEDLG.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit ubasedlg;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, FileCtrl;
type
TBaseDirDlg = class(TForm)
Button1: TButton;
Button2: TButton;
Edit1: TEdit;
DriveComboBox1: TDriveComboBox;
DLB: TDirectoryListBox;
DirLabel: TLabel;
ActionLabel: TLabel;
CheckBox2: TCheckBox;
CheckBox1: TCheckBox;
Button3: TButton;
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
BaseDirDlg: TBaseDirDlg;
implementation
{$R *.DFM}
uses
AbUtils,
uDemoDlg;
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( DLB.Directory + '\' + DemoDlg.Edit1.Text );
DLB.Update;
finally
DemoDlg.Free;
end;
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: UCOMPPAD.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit ucomppad;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Menus, ExtCtrls,
AbZBrows, AbZipper, AbZipKit, AbArcTyp, AbBrowse, AbBase;
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 *.DFM}
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,60 @@
(* ***** 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: UDEMODLG.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit udemodlg;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TDemoDlg = class(TForm)
Button1: TButton;
Button2: TButton;
Edit1: TEdit;
private
{ Private declarations }
public
{ Public declarations }
end;
var
DemoDlg: TDemoDlg;
implementation
{$R *.DFM}
end.

Binary file not shown.

View File

@@ -0,0 +1,124 @@
(* ***** 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: UFINDER.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit ufinder;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, FileCtrl, Buttons, ExtCtrls,
AbZBrows, AbArcTyp, AbBrowse, AbBase;
type
TForm1 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Memo1: TMemo;
DriveComboBox1: TDriveComboBox;
DirectoryListBox1: TDirectoryListBox;
AbZipBrowser1: TAbZipBrowser;
Memo2: TMemo;
Label2: TLabel;
Button1: TButton;
Button2: TButton;
FileListBox1: TFileListBox;
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 *.DFM}
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
i, j : Integer;
CurFile : string;
begin
Button1.Enabled := False;
Memo1.Clear;
try
Button2.Enabled := True;
Aborted := False;
{look in the file list box for the file}
for i := 0 to pred( FileListBox1.Items.Count ) do begin
Application.ProcessMessages;
if Aborted then
Break;
{now add search of zip and self extracting files}
try
AbZipBrowser1.FileName := FileListBox1.Directory + '\' + FileListBox1.Items[i];
for j := 0 to AbZipBrowser1.Count - 1 do
if AbZipBrowser1[j].MatchesStoredName(Edit1.Text) then begin
Memo1.Lines.Add( 'Found in ' + FileListBox1.Items[i] );
Break;
end;
except
end;
end;
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,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: UMAKESFX.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit umakesfx;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
AbArcTyp, AbSelfEx, AbBase;
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 *.DFM}
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,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 ***** *)
{*********************************************************}
{* ABBREVIA: USPLASH.PAS *}
{* Copyright (c) TurboPower Software Co 1997 *}
{* All rights reserved. *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit usplash;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls;
type
TSplash = class(TForm)
Image1: TImage;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Splash: TSplash;
implementation
{$R *.DFM}
procedure TSplash.Timer1Timer(Sender: TObject);
begin
Close;
end;
end.