示例#1
0
    private void handleMouseMove(object sender, MouseEventArgs e)
    {
        if (p_LogicDisabled)
        {
            return;
        }

        //resolve mouse position relative to the window position
        //(we get a 0,0 for mouse in top, left corner of window
        Point mousePosition = PointToClient(Cursor.Position);

        if (p_EventHijacker != null)
        {
            p_EventHijacker.OnMouseMove(this, mousePosition, e);
        }

        /*handle mouse down IF the mouse is clicked, so whenever the
         * mouse moves and the mouse is down, the event is called.
         * Native MouseDown event does not have this behavior*/
        if (e.Button != MouseButtons.None)
        {
            handleMouseDown(sender, e);
            //return;
        }

        //fire mousemove for all ui elements
        int uiL = p_UIElements.Length;

        for (int c = 0; c < uiL; c++)
        {
            p_UIElements[c].OnMouseMove(this, mousePosition, e);
        }
    }