Page 1 of 1

Pen.Style after Delphi 2005 upgrade

Posted: Tue Aug 30, 2005 6:01 pm
by 9236601
I have an existing application that was developed in D7. After Upgrading the application to Delphi 2005 Sp3 the Charts no longer print the line style assigned to each pen, just prints solid. If I try to change Pen to LinePen I get an error [Error] main.pas(1156): E2003 Undeclared identifier: 'LinePen' Yet in the Object Inspector I see LinePen not Line. This Happens on 2 different development computers.


Code: Select all

If not colorPrinter then
begin
for i := 0 to ch[x].SeriesCount-1 do
begin
      OldColor[i] := ch[x].series[i].SeriesColor;
      ch[x].series[i].SeriesColor := clblack;
      ch[x].Series[i].Pen.Width := 2;   
      case i of
              0: ch[x].series[i].Pen.style := psSolid;
              1: ch[x].series[i].Pen.Style := psDot;
              2: ch[x].series[i].Pen.Style := psDash;
              3: ch[x].series[i].Pen.Style := psDashDot;
              4: ch[x].series[i].Pen.Style := psDashDotDot;
              5: ch[x].series[i].Pen.Width := 1;
              6: ch[x].series[i].Pen.Width := 3;
      else
              ch[x].series[i].Pen.Style := psSolid;

      end;
end;

Posted: Fri Sep 02, 2005 10:48 am
by narcis
Hi kjs,

We are aware that Delphi 2005 has some Pen bugs since its first version. Some have been fixed by the updates but some no.

However, you can't access LinePen because you are trying to access it via the series array. In that case you'll need to typecast the series, for example:

Code: Select all

(ch[x].series[i] as TLineSeries).LinePen.Width:=5;
Regarding the Pen bugs, the Borland Quality Central reports below may help you finding a workaround for them.

http://qc.borland.com/wc/qcmain.aspx?d=9661
http://qc.borland.com/wc/qcmain.aspx?d=13225