casua access violation

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Chartist
Newbie
Newbie
Posts: 60
Joined: Wed Sep 18, 2013 12:00 am

Re: casua access violation

Post by Chartist » Sat Apr 26, 2014 9:48 am

HI,

I tried it and I think, we are closer to it.
But it is not done.
The problem is "Shape Bounds".

But let me copy first, what I did:

I changed this line:
"Chart_.Canvas.Rectangle(Chart_.Title.ShapeBounds);"

against these lines, which do the same with local vars:
"
tmpTitle:=Chart_.Title;
tmpRect:=Chart_.Title.ShapeBounds;
Chart_.Canvas.Rectangle(tmpRect);
"

The problem remains here, the second line:
"tmpRect:=Chart_.Title.ShapeBounds;"

The values are:
Assigned(Chart_.Title) => true
Assigned(Chart_.ShapeBounds) => E2003 Undeclared identifier: 'ShapeBounds'


in other words:
Can you give me a way to have "Shape Bounds" in a local var?
Before this trouble line Shape Bounds is not used by anything (at least not by my code and as far I understand it).
So we can assign or create it from scratch?

Thanks,
Cheryll
Cheryll

Chartist
Newbie
Newbie
Posts: 60
Joined: Wed Sep 18, 2013 12:00 am

Re: casua access violation

Post by Chartist » Sat Apr 26, 2014 9:52 am

PS and:
Assigned(Chart_.Title.ShapeBounds) => E2008 Incompatible types
Cheryll

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: casua access violation

Post by Yeray » Mon Apr 28, 2014 11:40 am

Hi Cheryll,
Chartist wrote:The values are:
Assigned(Chart_.Title) => true
Assigned(Chart_.ShapeBounds) => E2003 Undeclared identifier: 'ShapeBounds'
I guess this is a typo, meaning Chart_.Title.ShapeBounds where says Chart1_.ShapeBounds, isn't it?
Chartist wrote:Can you give me a way to have "Shape Bounds" in a local var?
This is already shown in my last reply, here:

Code: Select all

  tmpTitle:=Chart1.Title;
  tmpRect:=tmpTitle.ShapeBounds;
Chartist wrote:Before this trouble line Shape Bounds is not used by anything (at least not by my code and as far I understand it).
So we can assign or create it from scratch?
Title should be internally created whenever Title is accessed the first time.
See how GetTitle creates a TChartTitle if not Assiged, and see how ShapeBounds is defined in TTeeCustomShape, from where TChartTitle derives:

Code: Select all

  TCustomChart=class(TCustomAxisPanel)
  public
    property Title:TChartTitle read GetTitle write SetTitle;

function TCustomChart.GetTitle:TChartTitle;
begin
  if not Assigned(FTitle) then
     FTitle:=TChartTitle.Create(Self);

  result:=FTitle;
end;

  TChartTitle=class(TStringsShape)
  TStringsShape=class(TTextShape)
  TTextShape=class(TTeeCustomShapePosition)
  TTeeCustomShapePosition=class(TCustomTextShape)
  TCustomTextShape=class(TTeeCustomShape)
  TTeeCustomShape=class(TTeeCustomShapeBrushPen)
  public
    ShapeBounds : TRect;
You can also use TitleRect property that internally calls ShapeBounds. Ie:

Code: Select all

tmpRect:=tmpTitle.TitleRect;
If you still find problems with it, please try to export a problematic chart as mentioned in my last reply. Then, try to create a simple example project that imports this tee file and try to reproduce the problem with it.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply