Requires Eyeshot 9.0.174 or greater.
Eyeshot normally supports Zoom/Pan/Rotation operation when a mouse button is pressed.
Using the following ViewportLayout-derived class it is possible to enable the Zoom/Pan/Rotate movements without pressing a mouse button, simply pressing some ModifierKeys combinations:
internal class MyViewportLayout : devDept.Eyeshot.ViewportLayout { protected override void OnKeyDown(KeyEventArgs e) { base.OnKeyDown(e); if (!Moving) { startZPR = true; } } protected override void OnKeyUp(KeyEventArgs e) { base.OnKeyUp(e); EndZoomPanRotate(Viewports[ActiveViewport]); } bool startZPR = false; protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (startZPR) { StartZoomPanRotate(e, Viewports[ActiveViewport]); startZPR = false; } } }
Then define some keyboard modifiers combinations:
viewportLayout1.Rotate.MouseButton = new MouseButton(MouseButtons.None, modifierKeys.Ctrl); viewportLayout1.Zoom.MouseButton = new MouseButton(MouseButtons.None, modifierKeys.Shift); viewportLayout1.Pan.MouseButton = new MouseButton(MouseButtons.None, modifierKeys.CtrlShift);
Comments
Thanks for this trick!
Please note that EndZoomPanRotate seems to change the current ActionMode of the viewport.
How to change pan button to midle mouse button like autocad in wpf control, please help me
Please sign in to leave a comment.