Also, since we need the right mouse button for a context menu, all mouse actions have to be done via modifier keys (shift/control). This I implemented by using the KeyUp/KeyDown events:
Code: Select all
void Chart_KeyDownXY(object sender, KeyEventArgs e)
{
var zpo = Chart.ViewXY.ZoomPanOptions;
if (e.Shift && e.Control)
{
zpo.MouseWheelZooming = MouseWheelZooming.HorizontalAndVertical;
}
else if (e.Shift)
{
// Zoom-Action
zpo.LeftMouseButtonAction = MouseButtonAction.Zoom;
Chart.Cursor = Cursors.Cross;
zpo.MouseWheelZooming = MouseWheelZooming.Horizontal;
}
// ... more ...
}
void Chart_KeyUpXY(object sender, KeyEventArgs e)
{
var zpo = Chart.ViewXY.ZoomPanOptions;
zpo.MouseWheelZooming = MouseWheelZooming.HorizontalAndVertical;
zpo.LeftMouseButtonAction = MouseButtonAction.Pan;
Chart.Cursor = Cursors.Default;
}
I don't know how far you are with v7, but would you consider switching the properties around? In Helix3D for example, one can write:
Code: Select all
base.PanGesture2 = new MouseGesture(MouseAction.LeftClick);
base.RotateGesture = new MouseGesture(MouseAction.LeftClick, System.Windows.Input.ModifierKeys.Control);