home *** CD-ROM | disk | FTP | other *** search
-
- {******************************************}
- { }
- { FastReport CLX v2.4 }
- { Progress dialog }
- { }
- { Copyright (c) 1998-2001 by Tzyganenko A. }
- { }
- {******************************************}
-
- unit FR_Progr;
-
- interface
-
- {$I FR.inc}
-
- uses
- SysUtils, Classes, QGraphics, QControls, QForms, QDialogs,
- QStdCtrls, FR_Class, FR_Const, QTypes, QExtCtrls;
-
-
- type
- TfrProgressForm = class(TForm)
- Button1: TButton;
- Label1: TLabel;
- Label2: TLabel;
- Timer1: TTimer;
- procedure Button1Click(Sender: TObject);
- procedure Timer1Timer(Sender: TObject);
- private
- { Private declarations }
- FDoc: TfrReport;
- FOnBeforeModal: TNotifyEvent;
- procedure Localize;
- public
- { Public declarations }
- FirstCaption: String;
- property OnBeforeModal: TNotifyEvent read FOnBeforeModal write FOnBeforeModal;
- function Show_Modal(Doc: TfrReport): Word;
- end;
-
-
- implementation
-
- uses FR_Utils;
-
- {$R *.xfm}
-
- function TfrProgressForm.Show_Modal(Doc: TfrReport): Word;
- begin
- Localize;
- FDoc := Doc;
- Label2.Caption := '';
- Timer1.Enabled := True;
- Result := ShowModal;
- end;
-
- procedure TfrProgressForm.Button1Click(Sender: TObject);
- begin
- FDoc.Terminated := True;
- ModalResult := mrCancel;
- end;
-
- procedure TfrProgressForm.Localize;
- begin
- Button1.Caption := SCancel;
- end;
-
- procedure TfrProgressForm.Timer1Timer(Sender: TObject);
- begin
- Timer1.Enabled := False;
- if Assigned(FOnBeforeModal) then FOnBeforeModal(Self);
- end;
-
- end.
-
-