Profile Picture

Changing pan tool to operate on Shift + Left Mouse Click

Posted By Kevin Harrison 13 Years Ago

Changing pan tool to operate on Shift + Left Mouse Click

Author
Message
Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

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
Posted 13 Years Ago
View Quick Profile
Forum Guru

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
Last Active: 12 Years Ago
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





Similar Topics


Reading This Topic