Hi,
I have a fast line serie with a drag point tool asociated to it and I would like to allow only de last point of the series to be dragged, not just any point of it.
I am using the event OnDragPoint of the tool to capture the point being dragged and in the OnMouseUp event of the TChart I do the rest.
Is there any way to "cancel" or "undo last drag" if the dragged point is not the last one?. I can't realise how to do that.
Thanks in advance.
Edit: I am using TeeChart 7.0 Source Code.
[Solved] TDragPointTool - Cancel dragging
[Solved] TDragPointTool - Cancel dragging
Last edited by Jorge Z on Thu Aug 30, 2007 5:41 pm, edited 1 time in total.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jorge,
The easiest way to only allow dragging of the last point is using chart's OnMouseDown and OnMouseUp event for only activating the tool for the last point in the series:
The easiest way to only allow dragging of the last point is using chart's OnMouseDown and OnMouseUp event for only activating the tool for the last point in the series:
Code: Select all
procedure TForm1.Chart1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ChartTool1.Active:=true;
end;
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if (Series1.Clicked(X,Y)<>Series1.Count-1) then
ChartTool1.Active:=false;
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 |