Class PanningTool
- Namespace
- Northwoods.Go.Tools
- Assembly
- Northwoods.GoDiagram.WinForms.dll
The PanningTool supports manual panning, where the user can shift the Position by dragging the mouse.
public class PanningTool : Tool
- Inheritance
-
PanningTool
- Inherited Members
Remarks
This tool is a standard mouse-move tool, the PanningTool. Although the DragSelectingTool takes precedence over this tool, the DragSelectingTool only starts if there is a delay after a mouse-down event. If it does not start, then this PanningTool gets a chance to start.
This tool does not utilize any Adornments or tool handles. This tool does not modify the model or conduct any transaction.
If you want to programmatically "pan" the diagram, you can just set Position or call methods such as Scroll(string, string, double), ScrollToRect(Rect), or CenterRect(Rect).
Constructors
PanningTool()
You do not normally need to create an instance of this tool because one already exists as the PanningTool.
The Name of this tool is "Panning".
public PanningTool()
Properties
Bubbles
Gets or sets whether panning actions will allow events to bubble instead of panning in the diagram.
public bool Bubbles { get; set; }
Property Value
Remarks
Set this to true to allow mobile devices to scroll the page with panning gestures on the diagram. Otherwise, the panning events will be captured and used to pan inside of the diagram.
The default value is false.
OriginalPosition
This read-only property returns the Point that was the original value of Position when the panning operation started.
public Point OriginalPosition { get; }
Property Value
Methods
CanStart()
This tool can run when the diagram allows scrolling and the mouse has been dragged with the left button far enough away from the mouse-down point to avoid being a click.
public override bool CanStart()
Returns
Remarks
This method may be overridden. Please read the Introduction page on Extensions for how to override methods and how to call this base method.
DoActivate()
Capture the mouse, change the diagram cursor to "move", and remember the Position.
public override void DoActivate()
DoCancel()
Restore the Position to what it was when this tool activated.
public override void DoCancel()
DoDeactivate()
Release the mouse and restore the default diagram cursor.
public override void DoDeactivate()
DoMouseMove()
Modify the Position according to how much the mouse has moved.
public override void DoMouseMove()
DoMouseUp()
Modify the Position according to how much the mouse has moved.
public override void DoMouseUp()