📄 qqrdbtext1.pas
字号:
unit QQRDBText1;
interface
uses
Windows, Messages, SysUtils, Classes, Controls, QuickRpt, QRCtrls;
type
TRectType =(RtNone,RtRectangle);
myTQRDBText = class(TQRDBText)
private
{ Private declarations }
rtRecttype:TRectType;
procedure SetrtRecttype(Value:TRectType);
//iRect:integer;
protected
procedure Print(OfsX, OfsY : integer); override;
procedure Paint ;Override ;
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
property myRectType:TRectType read rtRecttype write SetrtRecttype;
// property myRectType1:integer Read iRect Write SetmyRectType1;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Samples', [myTQRDBText]);
end;
procedure myTQRDBText.SetrtRecttype(Value:TRectType);
begin
if Value<>rtRecttype then
begin
rtRecttype:=Value ;
Invalidate() ;
end ;
end ;
procedure myTQRDBText.Paint ;
begin
width:=22;
height:=16;
if rtRecttype=RtRectangle then
begin
canvas.Rectangle(0,0,width,height);
end;
//if upcase(caption)='TRUE' then
//begin
//Canvas.MoveTo(0,Height) ;
//Canvas.LineTo(width,0 ) ;
//end
//else
//begin
Canvas.Pen.Width:=2;
canvas.MoveTo(5,8);
canvas.lineto(width div 2-3,Height-3);
canvas.LineTo(width-3,2);
canvas.Pen.Width:=1;
//Canvas.textout(0,0,text) ;
//end
// end;
end ;
procedure myTQRDBText.Print(OfsX,OfsY : Integer);
begin
width:=22;
height:=16;
with QRPrinter do
begin
if rtRectType=RtRectangle then
begin
canvas.Rectangle(XPos(OfsX + Size.Left),YPos(OfsY + Size.Top),XPos(OfsX + Size.Left)+width,YPos(OfsY + Size.Top)+height);
end;
if uppercase(trim(dataset.FieldByName(datafield).asstring))='FALSE' then
begin
//Canvas.MoveTo(XPos(OfsX + Size.Left), YPos(OfsY + Size.Top)+Height);
//Canvas.LineTo(XPos(OfsX + Size.Left)+width,YPos(OfsY + Size.Top)) ;
end
else
begin
Canvas.Pen.Width:=2;
Canvas.MoveTo(XPos(OfsX + Size.Left)+4, YPos(OfsY + Size.Top)+8) ;
Canvas.LineTo(XPos(OfsX + Size.Left)+Width div 2-3,YPos(OfsY + Size.Top)+Height-3 ) ;
Canvas.LineTo(XPos(OfsX + Size.Left)+Width-3,YPos(OfsY + Size.Top)+2) ;
canvas.Pen.Width:=1;
end ;
//Canvas.textout(XPos(OfsX + Size.Left), YPos(OfsY + Size.Top),dataset.FieldByName(datafield).asstring) ;
end ;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -