Forum > Ported from Delphi/Kylix

TCanvas width and height property

(1/2) > >>

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
      width := 2;

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.

Vincent Snijders:
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.

Vincent Snijders:
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


[0] Message Index

[#] Next page

Go to full version