Ejemplo n.º 1
0
        /**
         * ******************************************************
         */

        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }