Lazarus
Programming => Packages and Libraries => Ported from Delphi/Kylix => Topic started by: Ignace on May 16, 2007, 10:27:06 pm
-
TCanvas in Lazarus has width and Height property while TCanvas in Delphi does not. TCanvas should not have width and height property.
When I have following code in a form with a TPaintBox on it, Lazarus crashes while Delphi works:
with Paintbox1.Canvas.Pen do
with Paintbox1.canvas do
begin
width := 2;
moveto(10,10);
lineto(40,200);
end;
Lazarus thinks width refers to the canvas.
I encountered a similar problem in real life when translating a delphi component to lazarus. It gave me weird results where a line was drawn with a linewidth equal to the canvas width instead of the pen width.
-
File a delphi bug report for missing properties.
In the mean time, don't use with.
-
OK, I just found the bug reporting section.
By the way, this is not a missing property, that property SHOULD be missing.
-
No, absolutely not. It is a Delphi bug that it hasn't the property. You should report it with CodeGear.
-
Yeah right :)
Lazarus is the one who is cloning the other, remember :)
I think Lazarus should be consistent with Delphi
-
No, if it can improve for example by adding extra properties, it will.
If you think Lazarus is a clone, that you are in a for a disapointment.
Next you will be complaining about the fact that a form has a text property, which breaks your Delphi code.
-
with ACanvas do begin
w:= cliprect.Right -cliprect.Left;
h:= cliprect.Bottom -cliprect.Top;
..