protected internal override void OnMouseIsUp(BasicMouseEventArgs e) { if (Configurable && !e.IsMainButton) { NumericAxisPropertiesForm f = new NumericAxisPropertiesForm(Text, ZoomMin, ZoomMax); f.ShowDialog(); if (f.Ok) { Text = f.Title; double newMin = f.MinValue; double newMax = f.MaxValue; if (!double.IsNaN(newMin) && !double.IsNaN(newMax) && newMin < newMax) { ZoomMin = newMin; TotalMin = Math.Min(TotalMin, ZoomMin); ZoomMax = newMax; TotalMax = Math.Max(TotalMax, ZoomMax); 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; } }
protected internal override void OnMouseIsUp(BasicMouseEventArgs e) { if (Configurable && !e.IsMainButton){ NumericAxisPropertiesForm f = new NumericAxisPropertiesForm(Text, ZoomMin, ZoomMax); f.ShowDialog(); if (f.Ok){ Text = f.Title; double newMin = f.MinValue; double newMax = f.MaxValue; if (!double.IsNaN(newMin) && !double.IsNaN(newMax) && newMin < newMax){ ZoomMin = newMin; TotalMin = Math.Min(TotalMin, ZoomMin); ZoomMax = newMax; TotalMax = Math.Max(TotalMax, ZoomMax); 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; } }