Changing pan tool to operate on Shift + Left Mouse Click


Author
Message
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,

In your case you should create a custom tool that overrides the behavior of the NMouseWheelScrollAndZoomTool. The following is a sample implementation:

 

public class NCustomScrollAndZoomTool : NMouseWheelScrollAndZoomTool

{

      public NCustomScrollAndZoomTool()

      {

            this.Name = "Custom Scroll and Zoom Tool";

            StartMouseEvent = MouseEvent.LeftButtonDown;

      }

 

      public override bool CanActivate()

      {

            if (base.CanActivate() == false)

                  return false;

 

            return Control.ModifierKeys == Keys.Control;

      }

}

 

 

When you want to use the tool you should add it to the drawing view controller’s collection of tools and enable it:

 

NCustomScrollAndZoomTool customTool = new NCustomScrollAndZoomTool();

view.Controller.Tools.Add(customTool);

view.Controller.Tools.EnableTools(new string[] { customTool.Name });

 

 

If you want to disable the standard mouse scroll and zoom tool, you can do so by using the following line of code:

 

view.Controller.Tools.DisableTools(new string[] { NDWFR.ToolMouseWheelScrollAndZoom });



Best Regards,
Nevron Support Team


Kevin Harrison
Kevin Harrison
Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)Forum Guru (52 reputation)
Group: Forum Members
Posts: 52, Visits: 1

Can you provide an example of how to change the Pan tool from operating on middle-mouse click to Shift + Left mouse click please? It was quite straightforward for Nevron Chart, but not so obvious to me at the moment for Diagram.

Thanks

Kevin


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