/** * ****************************************************** */ private static bool CheckMouseMove(LayeredControl control, MouseEventArgs e) { var isMouseInside = control.IsPointInside(e.Location); if (isMouseInside & !control.Hovered) { control.Hovered = true; control.OnMouseEnter(e); } else if (!isMouseInside & control.Hovered) { control.Hovered = false; control.OnMouseLeave(); } else if (control.Hovered) { control.OnMouseMove(e); } if (e.Button == MouseButtons.None) { CheckMouseUp(control, e); } return(false); }
private static bool CheckDoubleClick(LayeredControl control, MouseEventArgs e) { bool isPointInside = control.IsPointInside(e.Location); if (isPointInside) { control.Pressed = false; _pressedControl = null; control.OnDoubleClick(); return(true); } return(false); }
private static bool CheckMouseDown(LayeredControl control, MouseEventArgs e) { bool isMouseInside = control.IsPointInside(e.Location); if (isMouseInside & !control.Pressed) { control.Pressed = true; control.OnMouseDown(e); _pressedControl = control; return(true); } return(false); }
private static bool CheckMouseUp(LayeredControl control, MouseEventArgs e) { bool isMouseInside = control.IsPointInside(e.Location); if (control.Pressed) { control.Pressed = false; control.OnMouseUp(e); if (isMouseInside) { control.OnClick(e); } _pressedControl = null; return(true); } return(false); }