Profile Picture

NDataCursorTool doesn't move when NDataZoomTool is active

Posted By Lance Levendowski 8 Years Ago

NDataCursorTool doesn't move when NDataZoomTool is active

Author
Message
Lance Levendowski
Posted 8 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 6 days ago @ 1:19 PM
Posts: 59, Visits: 155
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?

Nevron Support
Posted 8 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
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);


Best Regards,
Nevron Support Team



Lance Levendowski
Posted 8 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 6 days ago @ 1:19 PM
Posts: 59, Visits: 155
CaptureMouseWhenActive allowed me to implement the desired behavior.  Thanks!




Similar Topics


Reading This Topic