public void MouseDown(MouseEventArgs e) { if (e.Button == MouseButtons.Left) { downpoint = e.Location; curstatus = GetCurrStatus(downpoint); prepoint = curpoint = downpoint; } }
public void MouseUp(MouseEventArgs e) { curstatus = SizeChangeDirection.NA; modflag = 0; }
public SizeChangeDirection GetCurrStatus(Point p, bool bupdate = true) { SizeChangeDirection x = SizeChangeDirection.NA; if (Math.Abs(objectRectangle.Top - p.Y) < 3 && p.X > objectRectangle.Left && p.X < objectRectangle.Right) { if (bupdate) { modflag = 1; } return(SizeChangeDirection.TOP); } else if (Math.Abs(chipRectangle.Top - p.Y) < 3 && p.X > chipRectangle.Left && p.X < chipRectangle.Right) { if (bupdate) { modflag = 2; } return(SizeChangeDirection.TOP); } else if (Math.Abs(objectRectangle.Left - p.X) < 3 && p.Y > objectRectangle.Top && p.Y < objectRectangle.Bottom) { if (bupdate) { modflag = 1; } return(SizeChangeDirection.LEFT); } else if (Math.Abs(chipRectangle.Left - p.X) < 3 && p.Y > chipRectangle.Top && p.Y < chipRectangle.Bottom) { if (bupdate) { modflag = 2; } return(SizeChangeDirection.LEFT); } else if (Math.Abs(objectRectangle.Right - p.X) < 3 && p.Y > objectRectangle.Top && p.Y < objectRectangle.Bottom) { if (bupdate) { modflag = 1; } return(SizeChangeDirection.RIGHT); } else if (Math.Abs(chipRectangle.Right - p.X) < 3 && p.Y > chipRectangle.Top && p.Y < chipRectangle.Bottom) { if (bupdate) { modflag = 2; } return(SizeChangeDirection.RIGHT); } else if (Math.Abs(objectRectangle.Bottom - p.Y) < 3 && p.X > objectRectangle.Left && p.X < objectRectangle.Right) { if (bupdate) { modflag = 1; } return(SizeChangeDirection.BOTTOM); } else if (Math.Abs(chipRectangle.Bottom - p.Y) < 3 && p.X > chipRectangle.Left && p.X < chipRectangle.Right) { if (bupdate) { modflag = 2; } return(SizeChangeDirection.BOTTOM); } else if (objectRectangle.Contains(p)) { if (bupdate) { modflag = 1; } return(SizeChangeDirection.MOVE); } else if (chipRectangle.Contains(p)) { if (bupdate) { modflag = 2; } return(SizeChangeDirection.MOVE); } return(x); }