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
casua access violation
Re: casua access violation
PS and:
Assigned(Chart_.Title.ShapeBounds) => E2008 Incompatible types
Assigned(Chart_.Title.ShapeBounds) => E2008 Incompatible types
Cheryll
Re: casua access violation
Hi Cheryll,
See how GetTitle creates a TChartTitle if not Assiged, and see how ShapeBounds is defined in TTeeCustomShape, from where TChartTitle derives:
You can also use TitleRect property that internally calls ShapeBounds. Ie:
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.
I guess this is a typo, meaning Chart_.Title.ShapeBounds where says Chart1_.ShapeBounds, isn't it?Chartist wrote:The values are:
Assigned(Chart_.Title) => true
Assigned(Chart_.ShapeBounds) => E2003 Undeclared identifier: 'ShapeBounds'
This is already shown in my last reply, here:Chartist wrote:Can you give me a way to have "Shape Bounds" in a local var?
Code: Select all
tmpTitle:=Chart1.Title;
tmpRect:=tmpTitle.ShapeBounds;
Title should be internally created whenever Title is accessed the first time.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?
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;
Code: Select all
tmpRect:=tmpTitle.TitleRect;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |