Compiler problem with OnDrawBorder
Posted: Fri Jan 27, 2012 2:29 pm
I've got a problem with compiling the following code:
When I want to compile this in Delphi 7 (TRVEdit version 13.6.2), I get the error message
Incompatible types 'TRVStyleLength' and 'Integer'
in line 36, i.e. "T.OnDrawBorder := DrawBorder;"
As I'm completely at a loss about why this happens or what it means, I would like to ask for help.
Code: Select all
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, RVStyle, RVScroll, RichView, RVEdit, RVTable;
type
TForm1 = class(TForm)
RVEd: TRichViewEdit;
RVStyle: TRVStyle;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
procedure DrawBorder(Sender: TRVTableItemInfo; Canvas: TCanvas;
Left, Top, Right, Bottom, Width: Integer; LightColor, Color,
BackgroundColor: TColor; Style: TRVTableBorderStyle; Printing: Boolean;
VisibleBorders: TRVBooleanRect; Row, Col: Integer; var DoDefault: Boolean);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var T: TRVTableItemInfo;
begin
T := TRVTableItemInfo.CreateEx(2, 2, RVEd.RVData);
T.SetCellVisibleBorders (False, True, True, True, 0, 0);
T.OnDrawBorder := DrawBorder;
RVEd.InsertItem ('', T); RVEd.Format;
end;
procedure TForm1.DrawBorder(Sender: TRVTableItemInfo; Canvas: TCanvas;
Left, Top, Right, Bottom, Width: Integer; LightColor, Color,
BackgroundColor: TColor; Style: TRVTableBorderStyle; Printing: Boolean;
VisibleBorders: TRVBooleanRect; Row, Col: Integer; var DoDefault: Boolean);
begin
if Width=0 then
exit;
inc(Right);
inc(Bottom);
Canvas.Pen.Color := Color;
Canvas.Pen.Style := psInsideFrame;
Canvas.Pen.Width := 1;
Canvas.Brush.Style := bsClear;
Canvas.Rectangle(Left,Top,Right,Bottom);
DoDefault := False;
end;
end.
Incompatible types 'TRVStyleLength' and 'Integer'
in line 36, i.e. "T.OnDrawBorder := DrawBorder;"
As I'm completely at a loss about why this happens or what it means, I would like to ask for help.