Page 1 of 1

TCursorTool problem

Posted: Mon Mar 13, 2006 1:28 pm
by 9340791
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?

Posted: Thu Mar 16, 2006 2:31 pm
by narcis
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.

Reply

Posted: Fri Mar 17, 2006 10:54 am
by 9340791
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.