Is there a possible way to execute the OnChange event of the TCursor Tool from else where in my code?
I am updating labels showing the output this change and as doing the updat would like that event to execute WITHOUT actually moving a cursor.
Is this possible?
Thanks,
Tom
Make TCursorTool perform OnChange Event?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tom,
Yes, you can do something like this:
Yes, you can do something like this:
Code: Select all
procedure TForm1.ChartTool1Change(Sender: TCursorTool; x, y: Integer;
const XValue, YValue: Double; Series: TChartSeries; ValueIndex: Integer);
begin
Chart1.Title.Text.Add('Cursor Changed');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if ((X0 <> -1) and (Y0 <> -1)) then
begin
ChartTool1Change(ChartTool1, X0, Y0, Chart1.Axes.Bottom.CalcPosPoint(X0),
Chart1.Axes.Bottom.CalcPosPoint(X0), ChartTool1.Series,
ChartTool1.Series.Clicked(X0,Y0));
end;
end;
procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
X0:=X;
Y0:=Y;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
X0:=-1;
Y0:=-1;
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tom,
Sorry but the tool's event call should be something like this:
I forgot to change the YValue argument after copy and paste .
Sorry but the tool's event call should be something like this:
Code: Select all
ChartTool1Change(ChartTool1, X0, Y0, Chart1.Axes.Bottom.CalcPosPoint(X0),
Chart1.Axes.Left.CalcPosPoint(Y0), ChartTool1.Series,
ChartTool1.Series.Clicked(X0,Y0));
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |