prevent OnMouseMove event triggering

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
TonyHunt
Newbie
Newbie
Posts: 15
Joined: Mon Jan 15, 2007 12:00 am

prevent OnMouseMove event triggering

Post by TonyHunt » Mon Aug 17, 2009 12:09 pm

Hi,
I would like to prevent the OnMouseMove event triggering when the cursor is NOT over the actual chart drawing area.

Is this possible?

By the way what is the correct terminology for "the actual chart drawing area" :oops:

Tony

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

Re: prevent OnMouseMove event triggering

Post by Yeray » Tue Aug 18, 2009 9:49 am

Hi Tony,

I'm afraid you should test if the mouse cursor is in the target area manually:

Code: Select all

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
var dummyPoint: TPoint;
begin
  dummyPoint.X := X;
  dummyPoint.Y := Y;

  if PtInRect(Chart1.ChartRect, dummyPoint) then
  begin
    //your code
  end;
end;
So if you mean the rectangle formed by the left and the bottom axes, we call it "ChartRect". 8)
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

TonyHunt
Newbie
Newbie
Posts: 15
Joined: Mon Jan 15, 2007 12:00 am

Re: prevent OnMouseMove event triggering

Post by TonyHunt » Mon Aug 24, 2009 10:27 am

Thank you very much, that's exactly what I needed.

Please let me know if you ever get to visit the U.K.,
I would be delighted to introduce you to a quaint old English custom called "Pub Crawling".


Tony

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

Re: prevent OnMouseMove event triggering

Post by Yeray » Mon Aug 24, 2009 11:26 am

Hi Tony,

It's a pleasure trying to be helpful!

Thanks for the invitation! It looks culturally really interesting! ;)
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