📄 pjdemogrid.pas
字号:
(* GREATIS PRINT SUITE *)
(* Copyright (C) 2001-2007 Greatis Software *)
(* web: http://www.greatis.com *)
(* support: http://www.greatis.com/bteam.html *)
unit PJDemoGrid;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
PJTextGrid, Printers;
type
TDemoGridPrintJob = class(TTextGridPrintJob)
private
{ Private declarations }
protected
{ Protected declarations }
function GetCellText(APageIndex,ACol,ARow: Integer): string; override;
function GetCellAlignment(APageIndex,ACol: Integer): TAlignment; override;
function GetColWidth(TheCanvas: TCanvas; ACol: Integer): Integer; override;
public
{ Public declarations }
property RowsPerPage;
published
{ Published declarations }
end;
procedure Register;
implementation
function TDemoGridPrintJob.GetCellText(APageIndex,ACol,ARow: Integer): string;
begin
case ARow of
rowHeader: Result:=Format('Col: %d',[ACol]);
rowFooter:
if ACol=Pred(ColCount) then Result:=Format('Page: %d',[APageIndex])
else Result:='';
else Result:=Format('%d.%d',[ACol,ARow]);
end;
end;
function TDemoGridPrintJob.GetCellAlignment(APageIndex,ACol: Integer): TAlignment;
begin
Result:=taCenter;
end;
function TDemoGridPrintJob.GetColWidth(TheCanvas: TCanvas; ACol: Integer): Integer;
begin
Result:=300;
end;
procedure Register;
begin
RegisterComponents('Print Job Examples', [TDemoGridPrintJob]);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -