Ejemplo n.º 1
0
        private TrackerMouseEventArgs RiseMouseHandle(object sender, MouseEventArgs e, OnMouseEventHandler Roll, OnMouseEventHandler Title, OnMouseEventHandler Track)
        {
            TrackerMouseEventArgs pme = new TrackerMouseEventArgs(e);

            pme.CalcAxis(pprops, rconf, pme_cache);
            pme.Tag = null;
            OnMouseEventHandler Handle = null;

            switch (pme.Area)
            {
            case TrackerMouseEventArgs.AreaType.Roll: Handle = Roll; break;

            case TrackerMouseEventArgs.AreaType.Title: Handle = Title; break;

            case TrackerMouseEventArgs.AreaType.Track: Handle = Track; break;
            }
            if (pme.Area == TrackerMouseEventArgs.AreaType.Roll)
            {
                GridesMouseEventArgs pge = new GridesMouseEventArgs(e);
                pge.CalcArea(pprops, rconf, pge_cache);
                pme.Tag = pge;
            }
            if (Handle != null)
            {
                Handle(sender, pme);
            }
            return(pme);
        }
Ejemplo n.º 2
0
        private void d2DPainterBox1_MouseMove(object sender, MouseEventArgs e)
        {
            if (DisableMouse)
            {
                return;
            }
            if (isMMoving)
            {
                return;
            }
            isMMoving = true;
            d2DPainterBox1.Refresh();

            TrackerMouseEventArgs pme = new TrackerMouseEventArgs(e);

            pme.CalcAxis(pprops, rconf, pme_cache);
            pme.Tag = null;
            OnMouseEventHandler Handle      = null; //Move事件
            EventHandler        HandleEnter = null; //Enter事件
            EventHandler        HandleLeave = null; //Leave事件

            switch (pme.Area)
            {
            case TrackerMouseEventArgs.AreaType.Roll: Handle = GridsMouseMove; HandleEnter = GridsMouseEnter; break;

            case TrackerMouseEventArgs.AreaType.Title: Handle = TitleMouseMove; HandleEnter = TitleMouseEnter; break;

            case TrackerMouseEventArgs.AreaType.Track: Handle = PartsMouseMove; HandleEnter = PartsMouseEnter; break;
            }
            if (pme_sendEnterEvent)
            {
                if (HandleEnter != null)
                {
                    HandleEnter(sender, e);
                }
            }
            else if (pme_cache.Area != pme.Area)
            {
                switch (pme_cache.Area)
                {
                case TrackerMouseEventArgs.AreaType.Roll: HandleLeave = GridsMouseLeave; break;

                case TrackerMouseEventArgs.AreaType.Title: HandleLeave = TitleMouseLeave; break;

                case TrackerMouseEventArgs.AreaType.Track: HandleLeave = PartsMouseLeave; break;
                }
                if (HandleEnter != null)
                {
                    HandleEnter(sender, e);
                }
                if (HandleLeave != null)
                {
                    HandleLeave(sender, e);
                }
            }
            if (pme.Area == TrackerMouseEventArgs.AreaType.Roll)
            {
                GridesMouseEventArgs pge = new GridesMouseEventArgs(e);
                pge.CalcArea(pprops, rconf, pge_cache);
                pme.Tag = pge;
            }
            if (Handle != null)
            {
                Handle(sender, pme);                //发送Move
            }
            pme_cache          = pme;
            pme_sendEnterEvent = false;
            this.OnMouseMove(e);
            isMMoving = false;
        }