//error message
error :'paint' differs from previous declaration.
error : incompatible types
TMMShape = class(TdtpShape)
public
URL: string;
Caption: string;
UseController: boolean;
constructor Create; override;
procedure Paint(Canvas:TCanvas); override; // 여기
procedure SaveToXML(ANode:TXMLNode); override;
procedure LoadFromXML(ANode: TXMLNode); override;
end;
//paint 구현부분
procedure TMMShape.Paint(Canvas: TCanvas);
var
siz: TSize;
begin
inherited;
siz := Canvas.TextExtent(Caption);
Canvas.Rectangle(0, 0, CanvasWidth, CanvasHeight);
Canvas.TextOut((CanvasWidth - siz.cx) div 2, (CanvasHeight - siz.cy) div 2, Caption);
end;
무엇이 문제일까요?
//paint 함수 원형(TdtpShape) 호출 부분
procedure TdtpShape.Paint(Canvas: TCanvas; const Device: TDeviceContext);
// Override this method to paint on the canvas. In order for this method to be
// called in the first place, make sure to set UseCanvasPainting to True!
begin
// Must be overridden in descendant methods.
end;
// 구현 부분