예제 #1
0
        bool msGraphControl_MouseMoveEvent(ZedGraphControl sender, MouseEventArgs e)
        {
            MSGraphPane hoverPane = sender.MasterPane.FindPane(e.Location) as MSGraphPane;

            if (hoverPane == null)
            {
                return(false);
            }

            CurveItem nearestCurve;
            int       nearestIndex;

            //change the cursor if the mouse is sufficiently close to a point
            if (hoverPane.FindNearestPoint(e.Location, out nearestCurve, out nearestIndex))
            {
                msGraphControl.Cursor = Cursors.Cross;
            }
            else
            {
                msGraphControl.Cursor = Cursors.Default;
            }
            return(false);
        }
예제 #2
0
파일: GraphForm.cs 프로젝트: zjjyyang/ftdr
        bool msGraphControl_MouseDownEvent(ZedGraphControl sender, MouseEventArgs e)
        {
            // keep track of MSGraphItem nearest the last left click
            Point pos = MousePosition;

            focusedPane = sender.MasterPane.FindPane(e.Location) as MSGraphPane;
            if (focusedPane == null)
            {
                return(false);
            }

            CurveItem nearestCurve; int nearestIndex;

            focusedPane.FindNearestPoint(e.Location, out nearestCurve, out nearestIndex);
            if (nearestCurve == null)
            {
                setFocusedItem(sender.MasterPane[0].CurveList[0]);
            }
            else
            {
                setFocusedItem(nearestCurve);
            }
            return(false);
        }