source: cprs/branches/tmg-cprs/CPRS-Chart/Templates/fTemplateImport.pas@ 468

Last change on this file since 468 was 453, checked in by Kevin Toppenberg, 16 years ago

Initial upload of TMG-CPRS 1.0.26.69

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