public override void OnMouseIsUp(BasicMouseEventArgs e) { if (Configurable && !e.IsMainButton) { NumericAxisPropertiesForm f = new NumericAxisPropertiesForm(Text, IsLogarithmic ? Math.Exp(ZoomMin) : ZoomMin, IsLogarithmic ? Math.Exp(ZoomMax) : ZoomMax); f.ShowDialog(); if (f.Ok) { Text = f.Title; double newMin = IsLogarithmic ? Math.Log(f.MinValue) : f.MinValue; double newMax = IsLogarithmic ? Math.Log(f.MaxValue) : f.MaxValue; if (!double.IsNaN(newMin) && !double.IsNaN(newMax) && newMin < newMax) { ZoomMin = newMin; ZoomMax = newMax; TotalMin = newMin; TotalMax = newMax; FireZoomChanged(); Invalidate(); } } f.Dispose(); return; } if (!IsValid()) { return; } if (e.IsMainButton) { if (ZoomType == AxisZoomType.None) { return; } switch (MouseMode) { case AxisMouseMode.Zoom: SetZoomFromView((int)GetMinIndicator(GetLength(e.Width, e.Height)), (int)GetMaxIndicator(GetLength(e.Width, e.Height)), GetLength(e.Width, e.Height)); break; case AxisMouseMode.Move: switch (ZoomType) { case AxisZoomType.Indicate: if (IsFullZoom()) { return; } FireZoomChanged(); break; case AxisZoomType.Zoom: if (IsFullZoom()) { return; } if (indicator1 == indicator2) { Center(e); FireZoomChanged(); break; } Invalidate(); FireZoomChanged(); break; } break; } indicator1 = -1; indicator2 = -1; } }
public override void OnMouseIsUp(BasicMouseEventArgs e) { if (Configurable && !e.IsMainButton){ NumericAxisPropertiesForm f = new NumericAxisPropertiesForm(Text, IsLogarithmic ? Math.Exp(ZoomMin) : ZoomMin, IsLogarithmic ? Math.Exp(ZoomMax) : ZoomMax); f.ShowDialog(); if (f.Ok){ Text = f.Title; double newMin = IsLogarithmic ? Math.Log(f.MinValue) : f.MinValue; double newMax = IsLogarithmic ? Math.Log(f.MaxValue) : f.MaxValue; if (!double.IsNaN(newMin) && !double.IsNaN(newMax) && newMin < newMax){ ZoomMin = newMin; ZoomMax = newMax; TotalMin = newMin; TotalMax = newMax; FireZoomChanged(); Invalidate(); } } f.Dispose(); return; } if (!IsValid()){ return; } if (e.IsMainButton){ if (ZoomType == AxisZoomType.None){ return; } switch (MouseMode){ case AxisMouseMode.Zoom: SetZoomFromView((int) GetMinIndicator(GetLength(e.Width, e.Height)), (int) GetMaxIndicator(GetLength(e.Width, e.Height)), GetLength(e.Width, e.Height)); break; case AxisMouseMode.Move: switch (ZoomType){ case AxisZoomType.Indicate: if (IsFullZoom()){ return; } FireZoomChanged(); break; case AxisZoomType.Zoom: if (IsFullZoom()){ return; } if (indicator1 == indicator2){ Center(e); FireZoomChanged(); break; } Invalidate(); FireZoomChanged(); break; } break; } indicator1 = -1; indicator2 = -1; } }