Class TBackupDlg (unit Backup)

Inherits from

TForm

Constructors



Functions

procedure BitBtn1Click(Sender: TObject);

*Buttons*********************************************************************} {help

procedure btnCancelClick(Sender: TObject);

close

procedure btnOKClick(Sender: TObject);

copy

procedure chkNewClick(Sender: TObject);

new

procedure chkSelectClick(Sender: TObject);

check-box

procedure FListClick(Sender: TObject);

check state of check-box.

procedure FListDblClick(Sender: TObject);

on double click show file info

procedure FListKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);

on ALT + RETURN get info

procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);

*form's preferences**********************************************************} {on close

procedure SpeedButton1Click(Sender: TObject);

Select Directory

function ChangeExt(sSrce: string): string;

change file extension routine - this routine simply iterates through an array, swapping the extension for a "full" extension

function CheckDir(sDir: string): string;

check directory - adds a colon and backslash if they're missing, and then calls isDir to check that the directory\drive is valid

procedure CustCopyFiles(sSrce, sDest: string);

copy routine

procedure CustExpandFile(pSrce, pDest: pChar);

expansion routine - uses LZExpand unit to expand the files

procedure CustInitialise(pSource,pDestination,pHelp,pCompat: pChar; bOverwritePrompt: boolean);

stores bool for determining whether to copy only newer files

set environment


function DiskInDrive(i: integer): boolean;

check for floppy disk in drive

function GetFileInfo(sFile: string): TFileInfo;

routine returns file information - called in the case of overwrites

function IsDir(sDrive: string): boolean;

check for directory, or drive

function IsSpace(sDestination: string): longint;

*custom routines*************************************************************} {return free space, plus size of existing file.

procedure SetUpFiles;

*Copy procs******************************************************************} {setup copying

Properties

Events

Variables

Bevel1 : TBevel;


Bevel2 : TBevel;


Bevel3 : TBevel;


Bevel4 : TBevel;


BitBtn1 : TBitBtn;


btnCancel : TBitBtn;


btnOK : TBitBtn;


chkNew : TCheckBox;


chkSelect : TCheckBox;


DirList : TDirectoryListBox;


driveBox : TDriveComboBox;


FCancel : boolean;

Public declarations

FList : TFileListBox;


Label1 : TLabel;


Label2 : TLabel;


lblDestination : TLabel;


lblSource : TLabel;


SpeedButton1 : TSpeedButton;


FDir : string;

Private declarations

FNew : boolean;

stores initial value passed to DLL for overwrite prompt

FOkToAll : boolean;

stores current directory


Constructors


Functions


procedure BitBtn1Click(Sender: TObject);

*Buttons*********************************************************************} {help


procedure btnCancelClick(Sender: TObject);

close


procedure btnOKClick(Sender: TObject);

copy


procedure chkNewClick(Sender: TObject);

new


procedure chkSelectClick(Sender: TObject);

check-box


procedure FListClick(Sender: TObject);

check state of check-box. Then check if the user has deselected any items. If so, and the check-box is checked, then remove check


procedure FListDblClick(Sender: TObject);

on double click show file info


procedure FListKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);

on ALT + RETURN get info


procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);

*form's preferences**********************************************************} {on close


procedure SpeedButton1Click(Sender: TObject);

Select Directory


function ChangeExt(sSrce: string): string;

change file extension routine - this routine simply iterates through an array, swapping the extension for a "full" extension


function CheckDir(sDir: string): string;

check directory - adds a colon and backslash if they're missing, and then calls isDir to check that the directory\drive is valid


procedure CustCopyFiles(sSrce, sDest: string);

copy routine


procedure CustExpandFile(pSrce, pDest: pChar);

expansion routine - uses LZExpand unit to expand the files


procedure CustInitialise(pSource,pDestination,pHelp,pCompat: pChar; bOverwritePrompt: boolean);

stores bool for determining whether to copy only newer files

set environment


function DiskInDrive(i: integer): boolean;

check for floppy disk in drive


function GetFileInfo(sFile: string): TFileInfo;

routine returns file information - called in the case of overwrites


function IsDir(sDrive: string): boolean;

check for directory, or drive


function IsSpace(sDestination: string): longint;

*custom routines*************************************************************} {return free space, plus size of existing file. This routine is only called by CustCopyFiles (which it calls just before it attempts to copy the source file


procedure SetUpFiles;

*Copy procs******************************************************************} {setup copying


Properties


Events


Variables


Bevel1 : TBevel;


Bevel2 : TBevel;


Bevel3 : TBevel;


Bevel4 : TBevel;


BitBtn1 : TBitBtn;


btnCancel : TBitBtn;


btnOK : TBitBtn;


chkNew : TCheckBox;


chkSelect : TCheckBox;


DirList : TDirectoryListBox;


driveBox : TDriveComboBox;


FCancel : boolean;

Public declarations


FList : TFileListBox;


Label1 : TLabel;


Label2 : TLabel;


lblDestination : TLabel;


lblSource : TLabel;


SpeedButton1 : TSpeedButton;


FDir : string;

Private declarations


FNew : boolean;

stores initial value passed to DLL for overwrite prompt


FOkToAll : boolean;

stores current directory