Cursor Tool Snap Change misses manual changes to XValue

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
SteveP
Advanced
Posts: 132
Joined: Sun Sep 07, 2003 4:00 am

Cursor Tool Snap Change misses manual changes to XValue

Post by SteveP » Tue Jun 14, 2005 7:52 pm

A vertical Cursor Tool's OnSnapChange event does not fire if the cursor tool's X value has been changed programmatically and the next mouse movement is then back to the XValue the cursor tool was at before its XValue was changed.

Fill a line series with 10 values (FillSampleValues) so its X axis goes from 0 to 9.
Add a CursorTool with Snap true and FollowMouse true.
In the CursorTool's OnSnapChange event, display GetTickCount on a label so this event's firing can be detected.
Move the mouse to position the cursor at X=8 and move the mouse off the chart.
Click a button configured to set the cursortool's XValue = 1
The cursor will move to X=1
Now move the mouse back onto the chart at location X = 8. The cursor moves from X=1 to X=8 but the OnSnapChange event does not fire.

It seems as though manual changes to the cursortool's XValue are not passed onto whatever parameter the OnSnapChange method is comparing to. Any way to get this to happen ?

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

Post by Narcís » Wed Jun 15, 2005 8:43 am

Hi Steve,

It works fine here following your instructions, using latest TeeChart sources and this code:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Series1.FillSampleValues(10);
  GetTickCount:=0;
end;

procedure TForm1.ChartTool1SnapChange(Sender: TCursorTool; x, y: Integer;
  const XValue, YValue: Double; Series: TChartSeries; ValueIndex: Integer);
begin
  inc(GetTickCount);
  Chart1.Title.Text[0]:=IntToStr(GetTickCount);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ChartTool1.XValue:=1;
end;
If you want I can send you the complete application for you to test it.
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

SteveP
Advanced
Posts: 132
Joined: Sun Sep 07, 2003 4:00 am

Post by SteveP » Thu Jun 16, 2005 1:24 pm

Narcis,

Are you moving the mouse on the chart to X=8 so the cursor gets positioned there, then moving the mouse vertically off the chart so the cursor remains at X=8. Then click the buton to programmatically change the XValue=1. Then move the mouse (still off the chart) so it is aligned above or below the chart at the chart's X=8 position. Then move the mouse to re-enter the chart at X=8 ? When I re-enter at X=8, the OnSnapChange event does not fire. If I re-enter at another X value, it does fire. TChart 7.04

Steve

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

Post by Narcís » Mon Jun 20, 2005 11:02 am

Hi Steve,

I've been able to reproduce this problem here and has already been fixed to be included at the next maintenance release.
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

Post Reply