void OnCanvasMouseMove(NMouseEventArgs arg) { if (m_LogMoveEventsCheck.Checked) { m_EventsLog.LogEvent("Mouse Move"); } }
public override void OnMouseMove(object sender, NMouseEventArgs e) { m_SelectedSeries = null; NHitTestCacheService hitTestService = GetView().GetServiceOfType(typeof(NHitTestCacheService)) as NHitTestCacheService; if (hitTestService == null) { return; } INNode node = hitTestService.HitTest(new NPointF(e.X, e.Y)); if (node == null) { return; } NDataPoint dataPoint = node as NDataPoint; if (dataPoint != null) { m_SelectedSeries = dataPoint.ParentNode as NSeries; } }
/// <summary> /// Overriden to perform dragging /// </summary> /// <param name=`$:7` ></param> /// <param name=`$:8` ></param> public override void OnDoDrag(object sender, NMouseEventArgs e) { NChart chart = this.GetDocument().Charts[0]; NViewToScale2DTransformation viewToScale = new NViewToScale2DTransformation(this.GetChartControlView().Context, chart, (int)StandardAxis.PrimaryX, (int)StandardAxis.PrimaryY); NVector2DD pointScale = new NVector2DD(); if (viewToScale.Transform(new NPointF(e.X, e.Y), ref pointScale)) { // clamp y value to ruler range double yValue = chart.Axis(StandardAxis.PrimaryX).Scale.RulerRange.GetValueInRange(pointScale.X); m_ConstLine.Value = yValue; chart.Refresh(); Repaint(); } }
/// <summary> /// /// </summary> /// <param name="e"></param> public override void OnMouseDown(NMouseEventArgs e) { // handle only the left mouse down single click on the check box if (e.Button == MouseButtons.Left || e.Clicks == 1) { NExpandCollapseCheck check = GetExpandCollapseCheck(); // check to see if the hit was on some of the check box children if (NSceneTree.IsAncestorOfNode(check, e.HitNode)) { Expand(!Expanded); // mark as processed and return (stops event bubbling) e.Processed = true; return; } } // bubble event to previous mouse event handler base.OnMouseDown(e); }