home *** CD-ROM | disk | FTP | other *** search
- unit ISIS;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, OleCtrls, LTISIOCX, LEADISIS;
-
- type
- TISISDlg = class(TForm)
- Button1: TButton;
- Label1: TLabel;
- Label2: TLabel;
- PageNo: TEdit;
- OutFileName: TEdit;
- Button2: TButton;
- LTIsis: TLeadIsisCtrl;
- procedure Button2Click(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure FormShow(Sender: TObject);
- procedure LTIsisISISPage(Sender: TObject; nPage: Integer;
- const pszFileName: string);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- ISISDlg: TISISDlg;
- bCancel:boolean;
- bScanning:boolean;
-
- implementation
-
- uses Main;
-
- {$R *.DFM}
-
- procedure TISISDlg.Button2Click(Sender: TObject);
- var
- MaxPages:integer;
- bVal : boolean;
- nret : smallint;
- begin
- if(bScanning=False) then
- begin
- bVal := True;
- bScanning := True;
- LTIsis.EnableMethodErrors := false;
- {enable ISISPage Event}
- LTIsis.EnableISISEvent := true;
- {Load ISIS Driver}
- nret := LTIsis.ISISLoadDriver();
- if (nret = 0) then
- begin
- {enable ScanAhead, and set max pages to max ADF pages}
- LTIsis.ISISSetTag(TAG_SCANAHEAD, TAG_SCANAHEAD_YES);
- LTIsis.ISISGetTag(TAG_MAXPAGES, MaxPages);
- LTIsis.ISISSetTag(TAG_SCANAHEAD_MAXPAGES, MaxPages);
- LTIsis.ISISAcquireMulti(handle, MainForm.SaveDialog.Filename, ISIS_SHOWUI, MainForm.SaveDialog.SaveFormat, MainForm.SaveDialog.SaveMulti);
- {Unload ISIS Driver}
- LTIsis.ISISUnloadDriver();
- end
- else
- bVal:=False;
- bScanning := False;
- if(bVal = True) then
- ModalResult:=mrOK
- else
- begin
- MessageDlg(IntToStr(LTIsis.PagesDiscarded) + ' pages aborted!', mtInformation, [mbOK], 0);
- ModalResult:=mrAbort;
- end;
- end;
- end;
-
- procedure TISISDlg.Button1Click(Sender: TObject);
- begin
- if(bScanning = True) then
- bCancel:=True
- else
- ModalResult:=mrCancel;
- end;
-
- procedure TISISDlg.FormShow(Sender: TObject);
- begin
- bCancel:=False;
- bScanning:=False;
- end;
-
- procedure TISISDlg.LTIsisISISPage(Sender: TObject; nPage: Integer;
- const pszFileName: string);
- begin
- if(bCancel = True) then
- LTIsis.EnableISISEvent:=false; {cancel scanning}
- PageNo.Text := IntToStr(nPage);
- PageNo.Refresh;
- OutFileName.Text := pszFileName;
- OutFileName.Refresh;
- Application.ProcessMessages;
- end;
-
- end.
-