source: cprs/trunk/CPRS-Chart/Templates/fTemplateImport.pas@ 908

Last change on this file since 908 was 829, checked in by Kevin Toppenberg, 14 years ago

Upgrade to version 27

File size: 1.9 KB
Line 
1unit fTemplateImport;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 Gauges, StdCtrls, ComCtrls, fBase508Form, VA508AccessibilityManager;
8
9type
10 TfrmTemplateImport = class(TfrmBase508Form)
11 animImport: TAnimate;
12 btnCancel: TButton;
13 lblImporting: TStaticText;
14 gaugeImport: TGauge;
15 procedure btnCancelClick(Sender: TObject);
16 private
17 { Private declarations }
18 public
19 { Public declarations }
20 end;
21
22procedure StartImportMessage(AFileName: string; MaxCount: integer);
23function UpdateImportMessage(CurrentCount: integer): boolean;
24procedure StopImportMessage;
25
26implementation
27
28{$R *.DFM}
29
30uses
31 ORFn;
32
33var
34 frmTemplateImport: TfrmTemplateImport = nil;
35
36procedure StartImportMessage(AFileName: string; MaxCount: integer);
37begin
38 if not assigned(frmTemplateImport) then
39 begin
40 frmTemplateImport := TfrmTemplateImport.Create(Application);
41 ResizeAnchoredFormToFont(frmTemplateImport);
42 with frmTemplateImport do
43 begin
44 lblImporting.Caption := lblImporting.Caption + AFileName;
45 lblImporting.Hint := lblImporting.Caption;
46 gaugeImport.MaxValue := MaxCount;
47 Show;
48 Application.ProcessMessages;
49 end;
50 end;
51end;
52
53function UpdateImportMessage(CurrentCount: integer): boolean;
54begin
55 if assigned(frmTemplateImport) then
56 begin
57 Result := (not frmTemplateImport.btnCancel.Enabled);
58 if not Result then
59 begin
60 frmTemplateImport.gaugeImport.Progress := CurrentCount;
61 Application.ProcessMessages;
62 end;
63 end
64 else
65 Result := TRUE;
66end;
67
68procedure StopImportMessage;
69begin
70 if assigned(frmTemplateImport) then
71 FreeAndNil(frmTemplateImport);
72end;
73
74
75procedure TfrmTemplateImport.btnCancelClick(Sender: TObject);
76begin
77 lblImporting.Caption := 'Canceling...';
78 btnCancel.Enabled := FALSE;
79 Application.ProcessMessages;
80end;
81
82end.
Note: See TracBrowser for help on using the repository browser.