Hi,
With the conventional use of a pop-up menu on the right mouse click event, I can't use the TChart's automatic panning on the right mouse button, not even if I require e.g. [ssCtrl] in the TeeScrollKeyShift property.
I can't run the pan function on the left mouse button without losing the automatic zoom, again, even using TeeScrollKeyShift.
Is it possible to run the pan function through some other combination of keys so that the user does not have to explicitly switch between zoom and pan modes?
Thanks for any advice!
Toreba
Panning and pop-up menus
Re: Panning and pop-up menus
Hello toreba,
This seems to do the trick:
This seems to do the trick:
Code: Select all
var DownPos: TPoint;
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
DownPos.X:=X;
DownPos.Y:=Y;
end;
procedure TForm1.Chart1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if (Button=mbRight) and (DownPos.X = X) and (DownPos.Y = Y) then
PopupMenu1.Popup(GetClientOrigin.X+Chart1.Left+X, GetClientOrigin.Y+Chart1.Top+Y);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
PopupMenu1.AutoPopup := false;
Chart1.PopupMenu := PopupMenu1;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Panning and pop-up menus
Yeray,
Yeah, that's neat! Thanks very much!
Regards
Toreba
Yeah, that's neat! Thanks very much!
Regards
Toreba