protected override void OnMouseUp(MouseEventArgs e) { this.is_dragging = false; this.imminentAction = this.ImminentAction(e); Cursor.Current = this.imminentAction.GetCursor(false); base.OnMouseUp(e); }
protected override void OnMouseDown(MouseEventArgs e) { this.is_dragging = true; this.drag_origin = new Point(e.X, e.Y); this.imminentAction = this.ImminentAction(e); Cursor.Current = this.imminentAction.GetCursor(true); base.OnMouseDown(e); }
private ViewerControl.MouseAction ImminentAction(MouseEventArgs e) { ViewerControl.MouseAction mouseAction = null; if (this.userRegionViewController != null) { mouseAction = this.userRegionViewController.ImminentAction(e); } if (mouseAction == null) { mouseAction = new ViewerControl.DragImageAction(this); } return(mouseAction); }
protected override void OnMouseMove(MouseEventArgs e) { if (this.baseLayer != null) { if (this.is_dragging) { Point diff = new Point(e.X - this.drag_origin.X, e.Y - this.drag_origin.Y); this.imminentAction.Dragged(diff); base.Invalidate(); this.drag_origin = new Point(e.X, e.Y); } else { this.imminentAction = this.ImminentAction(e); Cursor.Current = this.imminentAction.GetCursor(false); } } base.OnMouseMove(e); }
protected override void OnMouseLeave(EventArgs e) { this.is_dragging = false; this.imminentAction = new ViewerControl.NoAction(); base.OnMouseLeave(e); }