NDataCursorTool doesn't move when NDataZoomTool is active


https://www.nevron.com/Forum/Topic10804.aspx
Print Topic | Close Window

By Lance Levendowski - 8 Years Ago
I want the NDataCursorTool to always track the current location of the mouse, but if NChartControl.Controller.Tools contains a NDataZoomTool then the NDataCursorTool doesn't move when the user clicks and holds the left mouse button.  The NDataCursorTool does move when the user clicks and holds the left mouse button (as desired) if I remove the NDataZoomTool.

I tried setting NAxisCursor.SynchronizeOnMouseAction = (Nevron.Chart.Windows.MouseAction.Down Or Nevron.Chart.Windows.MouseAction.Move) for the axis cursors that are associated with the NDataCursorTool, but that didn't fix the issue.

Is there a way for the NDataCursorTool to always track the current location of the mouse?
By Nevron Support - 8 Years Ago
We have just provided a new service pack (build version: 16.7.7.12). The new SP features a property (CaptureMouseWhenActive) that allows the developer to disable the mouse capture performed by the currently active tool so that other tools can also receive mouse messages. The test code is:

            NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];
            chart.RangeSelections.Add(new NRangeSelection());

            NBarSeries bar = new NBarSeries();

            for (int i = 0; i < 10; i++)
            {
                bar.Values.Add(i);
            }

            chart.Series.Add(bar);
           
            NAxisCursor xCursor = new NAxisCursor();
            xCursor.SynchronizeOnMouseAction = MouseAction.Move | MouseAction.Up;
            xCursor.BeginEndAxis = (int)StandardAxis.PrimaryY;
            chart.Axis(StandardAxis.PrimaryX).Cursors.Add(xCursor);

            NAxisCursor yCursor = new NAxisCursor();
            yCursor.SynchronizeOnMouseAction = MouseAction.Move | MouseAction.Up;
            yCursor.BeginEndAxis = (int)StandardAxis.PrimaryX;
            chart.Axis(StandardAxis.PrimaryY).Cursors.Add(yCursor);

            nChartControl1.Controller.Tools.Add(new NPanelSelectorTool());
            nChartControl1.Controller.Tools.Add(new NDataCursorTool());

            NDataZoomTool dzt = new NDataZoomTool();
            dzt.CaptureMouseWhenActive = false;
            nChartControl1.Controller.Tools.Add(dzt);
By Lance Levendowski - 8 Years Ago
CaptureMouseWhenActive allowed me to implement the desired behavior.  Thanks!