TCursorTool - Click Tolerance and movement

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
moelski
Advanced
Posts: 212
Joined: Mon Apr 23, 2007 12:00 am
Location: Germany
Contact:

TCursorTool - Click Tolerance and movement

Post by moelski » Tue Jun 10, 2008 6:35 am

Hi !

We use TCursorTools for measurement purpose. We calculate the x / y differences between two cursortools -> dx/dy.

This works nice but I have a problem with the clicktolerance. By default this is set to the value 3. If you move the cursor tool over the other cursor tool it hangs for a short while. And you can´t place the one cursortool over another one.

If you set Clicktolerance to 0 all works fine. But then you have a problem to "catch" the lines for moving.

So is there any way to disable the line "bouncing" if you use a clicktolerance > 0?

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Tue Jun 10, 2008 8:52 am

Hi Dominik,

I suggest you to force the ClickTolerance of the non clicked cursor to 0 when dragging. And restore the default (3) when finish dragging.

Code: Select all

procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  if ChartTool1.Clicked(X,Y) = ccBoth then
  begin
    ChartTool1.ClickTolerance := 3;
    ChartTool2.ClickTolerance := 0;
  end;

  if ChartTool2.Clicked(X,Y) = ccBoth then
  begin
    ChartTool1.ClickTolerance := 0;
    ChartTool2.ClickTolerance := 3;
  end;
end;

procedure TForm1.Chart1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  ChartTool1.ClickTolerance := 3;
  ChartTool2.ClickTolerance := 3;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply