Drag select doesn't work with Pan in new version of Nevron Chart


Author
Message
Stuart Jones
Stuart Jones
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
Posts: 17, Visits: 338
Following an update from 18.4.26.12 to 18.7.18.12 drag select doesn't work for one of our charts.
We want to drag select when the left mouse button is down and pan when the middle mouse button is down.
It now also pans with the left mouse button down, you can't drag select.
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Stuart,
Can you post the code that you use to configure the control for review?

Best Regards,
Nevron Support Team


Stuart Jones
Stuart Jones
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
Posts: 17, Visits: 338
Hi,
We add the pan tool first, with MouseButton.Middle as a parameter. It seems to try to pan with the left / right buttons pressed too. I have just tried to work around the problem by subclassing NDataPanTool. It seems to work:

public class NDataPanTooFix : NDataPanTool
{
    public override bool CanBeginDrag(object sender, NMouseEventArgs e)
    {
          if ( e.Button != BeginDragMouseCommand.MouseButton )
              return false;
          return base.CanBeginDrag(sender, e);
    }
}

This is how we configure the tools:

var dataPanTool = new NDataPanTool();
 dataPanTool.BeginDragMouseCommand = new NMouseCommand(MouseAction.Down, MouseButton.Middle, 1);
 dataPanTool.EndDragMouseCommand = new NMouseCommand(MouseAction.Up, MouseButton.Middle, 1);
 dataPanTool.EndDrag -= dataZoomOrPanTool_EndDrag;
 dataPanTool.EndDrag += dataZoomOrPanTool_EndDrag;
_nWpfChartControl.Controller.Tools.Add(dataPanTool);

var boxSelectTool = new NDragSelectPointsTool();
    boxSelectTool.BeginDragMouseCommand = new NMouseCommand(MouseAction.Down, MouseButton.Left, 1);
    boxSelectTool.EndDragMouseCommand = new NMouseCommand(MouseAction.Up, MouseButton.Left, 1);
    boxSelectTool.EndDrag -= boxSelectTool_EndDrag;
    boxSelectTool.EndDrag += boxSelectTool_EndDrag;
_nWpfChartControl.Controller.Tools.Add(boxSelectTool);

Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Stuart,

Thank you for posting the code. We've been able to replicate the problem and will publish a SP today or tomorrow.

Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search