Page 1 of 1

OnMouseMove outside the chart & holding right mouse butt

Posted: Tue Sep 30, 2008 12:39 pm
by 9531187
Hi

I want to draw a zoom-like rectangle with use of right mouse button, i have read this article http://www.teechart.net/support/viewtop ... 1566#31566 and this one http://www.teechart.net/support/viewtop ... +rectangle and they solved my problem, except that OnMouseMove event doesn't work for right mouse button when leaving the chart. How zoom function with left mouse button get events outside of the chart? and how can i do the same for right mouse button?

Thanks.

Posted: Tue Sep 30, 2008 1:32 pm
by narcis
Hi amir6821,

I'm sorry but I don't understand which is your exact problem. Could you please give us some more details about it? If you want you can send a simple example project we can run "as-is" to reproduce the problem here at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

OnMouseMove

Posted: Wed Oct 08, 2008 2:31 pm
by 9531187
Hi

I attached a file (Project1.zip) that contains the example. when i click the right mouse button and drag it, it shows the mouse coordination in Edit boxes, but when then mouse goes out of the chart boundries OnMouseMove event doesn't hook the mouse motion. Is it a way to hook mouse movement out of chart like zooming with left mouse button?

Posted: Wed Oct 08, 2008 2:53 pm
by narcis
Hi amir6821,

Thanks for the example project. What about using form's OnMouseMove event too? For example:

Code: Select all

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  if Selecting then
  begin
    Edit1.Text:=IntToStr(X - Chart1.Left);
    Edit2.Text:=IntToStr(Y - Chart1.Top);
  end
end;