GoToolPanning behaviour


I use this code to use GoPanningTool:

Northwoods.Go.GoToolPanning panningtool = new Northwoods.Go.GoToolPanning(goView);
panningtool.AutoPan = false;

When I click on background of my graph, panning works. But if I click at edge, only selection occurs with no panning. Is it possible to do panning too? (Only for edges, but not for vertexes, in this case I’d like to do selection only)

Sometimes graphs have very much edges so it is difficult to find background to click for panning in some segments of graph.

Only a minimum of testing, but try this:

view.ReplaceMouseTool(typeof(GoToolPanning), new ToolPanningNoLinks(view));

public class ToolPanningNoLinks : GoToolPanning {
public ToolPanningNoLinks(GoView v) : base(v)
this.AutoPan = false;
public override bool CanStart() {
GoInputEventArgs e = this.LastInput;
if (e.Alt || e.Control || e.Shift) return false;
if (this.AutoPan) {
return e.Buttons == MouseButtons.Middle;
} else { // !AutoPan: manual
if (e.Buttons != MouseButtons.Left) return false;
// can’t start if we’re over an object in the document
// – unless it is a link.
GoObject obj = this.View.PickObject(true, true, e.DocPoint, true);
return (obj == null || obj is IGoLink);