TCursorTool problem

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
vvv
Newbie
Newbie
Posts: 9
Joined: Mon Jan 31, 2005 5:00 am
Location: Donetsk, Ukraine
Contact:

TCursorTool problem

Post by vvv » Mon Mar 13, 2006 1:28 pm

Hi.

I`ve added vertical TCursorTool.
When chart area is scrolled and TCursorTool has the same X position with the left border, TCursorTool automaticaly returns to the chart center.
Is this problem fixed?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Mar 16, 2006 2:31 pm

Hi vvv,

I've been able to reproduce the problem here and added it to our defect list (TV52011317) to be fixed for future releases.

In the meantime, a workaround would be storing the tool's position in a variable every time you modify its position using its OnChange event. Then, when you scroll the chart, in the OnScroll event, you can assign that value stored to the tool.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

vvv
Newbie
Newbie
Posts: 9
Joined: Mon Jan 31, 2005 5:00 am
Location: Donetsk, Ukraine
Contact:

Reply

Post by vvv » Fri Mar 17, 2006 10:54 am

Hi Narcís.

I`ve solved this problem with help to small modify teetools.pas file.
In basic Procedure TCursorTool.CalcScreenPositions execute condition:
//---
if (IPoint.X=-1) or (IPoint.Y=-1) then
begin
....
end
This condition must be execute for first initialization TCursorTool.
But when chart area is scrolled and TCursorTool has the same X position with the left border IPoint.X = -1 again.
This problem can be avoid if
1. In TCursorTool class adding variable
TCursorTool=class(TTeeCustomToolSeries)
private
......
LBeg : Boolean;
.....
2. In Constructor TCursorTool.Create(AOwner:TComponent);
begin
....
LBeg:=false;
....
end;
3. In Procedure TCursorTool.CalcScreenPositions:
//---
if {(IPoint.X=-1) or (IPoint.Y=-1)} (LBeg=False) then
begin
LBeg := True;
....
end;

That`s all.

Post Reply