Subversion Repositories autosfx

Rev

Blame | Last modification | View Log | RSS feed

  1. Unit extrunit;
  2. (************************************************************************
  3.  Copyright (C) 2009, 2010  by Russell J. Peters, Roger Aelbrecht,
  4.       Eric W. Engler and Chris Vleghert.
  5.  
  6.    This file is part of TZipMaster Version 1.9.
  7.  
  8.     TZipMaster is free software: you can redistribute it and/or modify
  9.     it under the terms of the GNU Lesser General Public License as published by
  10.     the Free Software Foundation, either version 3 of the License, or
  11.     (at your option) any later version.
  12.  
  13.     TZipMaster is distributed in the hope that it will be useful,
  14.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.     GNU Lesser General Public License for more details.
  17.  
  18.     You should have received a copy of the GNU Lesser General Public License
  19.     along with TZipMaster.  If not, see <http://www.gnu.org/licenses/>.
  20.  
  21.     contact: problems@delphizip.org (include ZipMaster in the subject).
  22.     updates: http://www.delphizip.org
  23.     DelphiZip maillist subscribe at http://www.freelists.org/list/delphizip
  24. ************************************************************************)
  25.  
  26. {$I '..\..\zipvers19.inc'}
  27. {$IFDEF VERD6up}
  28. {$WARN UNIT_PLATFORM OFF}
  29. {$WARN SYMBOL_PLATFORM OFF}
  30. {$ENDIF}
  31.  
  32. Interface
  33.  
  34. Uses
  35.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  36.   StdCtrls, ExtCtrls, FileCtrl, ShlObj;
  37.  
  38. Type
  39.   TExtract = Class(TForm)
  40.     Panel1: TPanel;
  41.     Panel2: TPanel;
  42.     Panel3: TPanel;
  43.     OKBut: TButton;
  44.     CancelBut: TButton;
  45.     RadioGroup1: TRadioGroup;
  46.     RadioGroup2: TRadioGroup;
  47.     RadioGroup3: TRadioGroup;
  48.     DriveComboBox1: TDriveComboBox;
  49.     DirectoryListBox1: TDirectoryListBox;
  50.  
  51.     Procedure OKButClick(Sender: TObject);
  52.     Procedure CancelButClick(Sender: TObject);
  53.     Procedure FormActivate(Sender: TObject);
  54.     Procedure FormCreate(Sender: TObject);
  55.   End;
  56.  
  57. Var
  58.   Extract: TExtract;
  59.  
  60. Implementation
  61.  
  62. Uses MainUnit;
  63. {$R *.DFM}
  64.  
  65. Procedure TExtract.OKButClick(Sender: TObject);
  66. Begin
  67.   MainUnit.Canceled := False;
  68.   MainUnit.ExtractDir := DirectoryListBox1.Directory;
  69.   If RadioGroup1.ItemIndex = 0 Then
  70.     MainUnit.ExpandDirs := False
  71.   Else
  72.     MainUnit.ExpandDirs := True;
  73.   If RadioGroup2.ItemIndex = 0 Then
  74.     MainUnit.Overwr := False
  75.   Else
  76.     MainUnit.Overwr := True;
  77.   If RadioGroup3.ItemIndex = 0 Then
  78.     MainUnit.AllFiles := True
  79.   Else
  80.     MainUnit.AllFiles := False;
  81.   Close;
  82. End;
  83.  
  84. Procedure TExtract.CancelButClick(Sender: TObject);
  85. Begin
  86.   MainUnit.ExtractDir := '';
  87.   Close;
  88. End;
  89.  
  90. Procedure TExtract.FormActivate(Sender: TObject);
  91. Begin
  92.   MainUnit.Canceled := True; { default }
  93. End;
  94.  
  95. Procedure TExtract.FormCreate(Sender: TObject);
  96. Var
  97.   SpecFolder: String;
  98. Begin
  99.   SpecFolder := '';
  100.  
  101.   MainForm.GetSpecialFolder(CSIDL_DESKTOPDIRECTORY, SpecFolder);
  102.   DriveComboBox1.Drive := ExtractFileDrive(SpecFolder)[1];
  103.   DirectoryListBox1.Directory := ExtractFilePath(SpecFolder);
  104. End;
  105.  
  106. End.
  107.