关于编写画斜线功能的组件(for RBuilder5.51)出现的问题?(100分)

  • 主题发起人 主题发起人 fstao
  • 开始时间 开始时间
F

fstao

Unregistered / Unconfirmed
GUEST, unregistred user!
由于ReportBuilder5.51没有画斜线的功能,本人想做一个能画斜线的组件。
源程序如下:

unit ppMyLine;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ppComm, ppRelatv, ppProd, ppClass;

type
TLines = ( None,TopBottom,BottomTop ) ;
TppMyLine = class(TppCustomReport)
private
FLineType:TLines ;
procedure SetFLineType(Value:TLines) ;
protected
procedure ppPrint(OfsX, OfsY : integer); override; // [Error] Method 'ppPrint'
// not found in base class
procedure Paint ;Override ;//[Error] Method 'Paint' not found in base class
public
{ Public declarations }
published
property LineType:TLines Read FLineType Write SetFLineType ;
end;

procedure Register;

implementation

procedure TppMyLine.SetFLineType(Value:TLines);
begin
if Value<>FLineType then
begin
FLineType:=Value ;
Invalidate ;
end ;
end ;

procedure TppMyLine.Paint ;
begin
case LineType of
BottomTop:
begin
Canvas.MoveTo(0,Height) ;
Canvas.LineTo(width,0 ) ;
end ;
TopBottom:
begin
Canvas.MoveTo(0,0) ;
Canvas.LineTo(width,Height ) ;
end ;
None:
begin
Height := Parent.Height ;
Top:=0 ;
Width:=4 ;
Shape:=qrsVertLine ;
Inherited Paint ;
end ;
end ;
end ;

procedure TppMyLine.ppPrint(OfsX,OfsY : Integer);
begin
with QRPrinter do
begin
case LineType of
BottomTop:
begin
Canvas.MoveTo(XPos(OfsX + Size.Left), YPos(OfsY + Size.Top)+Height) ;
Canvas.LineTo(XPos(OfsX + Size.Left)+width,YPos(OfsY + Size.Top) ) ;
end ;
TopBottom:
begin
Canvas.MoveTo(XPos(OfsX + Size.Left), YPos(OfsY + Size.Top)) ;
Canvas.LineTo(XPos(OfsX + Size.Left)+Width,YPos(OfsY + Size.Top)+Height ) ;
end ;
None:
Inherited ppPrint(OfsX,OfsY ) ;
end ;
end ;
end;


procedure Register;
begin
RegisterComponents('RBuilder', [TppMyLine]);
end;

end.

编译时出现错误,错误如上提示,请问如何改上面的代码?以上例子是根据QuickReport画斜线
而改动的。或者谁有这个画斜线的组件(for RBuilder5.51)的单独源程序e_mail给我。
 
这两个方法在父类中根本没有,怎么 override 呢?
 
可能该方法定义为private了。
 
帮帮忙,如何实现画斜线的功能?
 
Huizhang 的 TLine 控件在练功场上有,可以看一看!
 
在哪里啊?我怎么找不到?
 
我在
http://wjiachun.edu.chinaren.com/down/TLine.zip
不能下载。你能不能E_mail给我Tline.zip?多谢!
chentao@fuxi.com
 
给你发过来了!
 
接受答案了.
 
后退
顶部