home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 October / Chip_2001-10_cd1.bin / zkuste / delphi / kolekce / d6 / FRCLX.ZIP / SOURCE / FR_Progr.pas < prev    next >
Pascal/Delphi Source File  |  2001-07-03  |  2KB  |  77 lines

  1.  
  2. {******************************************}
  3. {                                          }
  4. {           FastReport CLX v2.4            }
  5. {             Progress dialog              }
  6. {                                          }
  7. { Copyright (c) 1998-2001 by Tzyganenko A. }
  8. {                                          }
  9. {******************************************}
  10.  
  11. unit FR_Progr;
  12.  
  13. interface
  14.  
  15. {$I FR.inc}
  16.  
  17. uses
  18.   SysUtils, Classes, QGraphics, QControls, QForms, QDialogs,
  19.   QStdCtrls, FR_Class, FR_Const, QTypes, QExtCtrls;
  20.  
  21.  
  22. type
  23.   TfrProgressForm = class(TForm)
  24.     Button1: TButton;
  25.     Label1: TLabel;
  26.     Label2: TLabel;
  27.     Timer1: TTimer;
  28.     procedure Button1Click(Sender: TObject);
  29.     procedure Timer1Timer(Sender: TObject);
  30.   private
  31.     { Private declarations }
  32.     FDoc: TfrReport;
  33.     FOnBeforeModal: TNotifyEvent;
  34.     procedure Localize;
  35.   public
  36.     { Public declarations }
  37.     FirstCaption: String;
  38.     property OnBeforeModal: TNotifyEvent read FOnBeforeModal write FOnBeforeModal;
  39.     function Show_Modal(Doc: TfrReport): Word;
  40.   end;
  41.  
  42.  
  43. implementation
  44.  
  45. uses FR_Utils;
  46.  
  47. {$R *.xfm}
  48.  
  49. function TfrProgressForm.Show_Modal(Doc: TfrReport): Word;
  50. begin
  51.   Localize;
  52.   FDoc := Doc;
  53.   Label2.Caption := '';
  54.   Timer1.Enabled := True;
  55.   Result := ShowModal;
  56. end;
  57.  
  58. procedure TfrProgressForm.Button1Click(Sender: TObject);
  59. begin
  60.   FDoc.Terminated := True;
  61.   ModalResult := mrCancel;
  62. end;
  63.  
  64. procedure TfrProgressForm.Localize;
  65. begin
  66.   Button1.Caption := SCancel;
  67. end;
  68.  
  69. procedure TfrProgressForm.Timer1Timer(Sender: TObject);
  70. begin
  71.   Timer1.Enabled := False;
  72.   if Assigned(FOnBeforeModal) then FOnBeforeModal(Self);
  73. end;
  74.  
  75. end.
  76.  
  77.