private MapViewer.DragAction mapViewer_OnMouseEvent(object sender, MouseAction action, int buttonNumber, bool[] whichButtonsDown, PointF location, PointF locationStart) { if (action == MouseAction.Down && buttonNumber == MapViewer.RightMouseButton) { return(MapViewer.DragAction.DelayedDrag); } if (action == MouseAction.Drag && buttonNumber == MapViewer.RightMouseButton) { RectangleF rect = new RectangleF(Math.Min(location.X, locationStart.X), Math.Min(location.Y, locationStart.Y), Math.Abs(locationStart.X - location.X), Math.Abs(locationStart.Y - location.Y)); highlight = new RectangleHighlight(rect); mapViewer.ChangeHighlight(new IMapViewerHighlight[] { highlight }); return(MapViewer.DragAction.DelayedDrag); } // Allow the left mouse button to drag. if (action == MouseAction.Down && buttonNumber == MapViewer.LeftMouseButton) { return(MapViewer.DragAction.MapDrag); } else { return(MapViewer.DragAction.None); } }
private MapViewer.DragAction mapViewer_OnMouseEvent(object sender, MouseAction action, int buttonNumber, bool[] whichButtonsDown, PointF location, PointF locationStart) { if (action == MouseAction.Down && buttonNumber == MapViewer.RightMouseButton) return MapViewer.DragAction.DelayedDrag; if (action == MouseAction.Drag && buttonNumber == MapViewer.RightMouseButton) { RectangleF rect = new RectangleF(Math.Min(location.X, locationStart.X), Math.Min(location.Y, locationStart.Y), Math.Abs(locationStart.X - location.X), Math.Abs(locationStart.Y - location.Y)); highlight = new RectangleHighlight(rect); mapViewer.ChangeHighlight(new IMapViewerHighlight[] { highlight }); return MapViewer.DragAction.DelayedDrag; } // Allow the left mouse button to drag. if (action == MouseAction.Down && buttonNumber == MapViewer.LeftMouseButton) return MapViewer.DragAction.MapDrag; else return MapViewer.DragAction.None; }
bool isLeg; // adding to a leg? #endregion Fields #region Constructors public AddCornerMode(Controller controller, bool isLeg, IMapViewerHighlight[] highlights) { this.controller = controller; this.highlights = highlights; this.isLeg = isLeg; }