⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sctstat.pas

📁 suite component ace report
💻 PAS
字号:
unit SctStat;

{ ----------------------------------------------------------------
  Ace Reporter
  Copyright 1995-1998 SCT Associates, Inc.
  Written by Kevin Maher, Steve Tyrakowski
  ---------------------------------------------------------------- }

interface
{$I ace.inc}

uses
  {$IFDEF WIN32}
  windows,
  {$ELSE}
  wintypes, winprocs,
  {$ENDIF}
  SysUtils, Messages, Classes, Graphics, Controls,
	Forms, Dialogs, StdCtrls, ExtCtrls, Acemeter, sctrep;

type
  TFormPrintStatus = class(TForm)
    Panel1: TPanel;
    lbWait: TLabel;
    lbPage: TLabel;
    Abortbutton: TButton;
    pagenumber: TPanel;
    LoadMeter: TAceMeter;
    procedure abortbuttonClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    Closing: Boolean;
		procedure AskAbort;
  public
    { Public declarations }
    Report: TComponent;
    procedure UpdateStatus(Page: TSctPage; Stat: TSctStatus);
  end;

var
  FormPrintStatus: TformPrintStatus;

implementation

uses sctconst, aceutil;

{$R *.DFM}


procedure TformPrintStatus.abortbuttonClick(Sender: TObject);
begin
  AskAbort;
end;

procedure TformPrintStatus.AskAbort;
begin
   case AceAskAbort of
      IDYES:
     	 begin
              TSctReport(Report).CancelPrintJob := True;
	      TSctReport(Report).Page.AbortPrinting := True;
	 end;
      IDNO:
	 begin
	      TSctReport(Report).Page.AbortPrinting := True;
	 end;
   end;
end;

procedure TformPrintStatus.FormShow(Sender: TObject);
begin
  lbPage.Caption := LoadStr(SCT_CPage);
  AbortButton.Caption := LoadStr(SCT_CAbort);
  caption := LoadStr(SCT_CPrintStatusCaption);
end;

procedure TFormPrintStatus.UpdateStatus(Page: TSctPage; stat: TSctStatus);
begin
  case stat of
    ssGenerating: lbWait.Caption := LoadStr(SCT_MGenerating);
    ssPrinting: lbWait.Caption := LoadStr(SCT_CPrintingWait);
  end;

  PageNumber.Caption := IntToStr( Page.PageNumber );
  LoadMeter.Progress := Round(Page.PercentDone);
  if stat = ssEnd then
  begin
    Page.OnUpdateStatus := nil;
    Closing := True;
    Close;
  end;
end;

procedure TformPrintStatus.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  if Closing then Action := caFree
  else
  begin
    AskAbort;
    Action := caNone;
  end;
end;

procedure TformPrintStatus.FormCreate(Sender: TObject);
begin
  Closing := False;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -