Beispiel #1
0
 private void graphViewer1_MouseDown(InteractiveGraphViewer sender, GraphMouseEventArgs e)
 {
     if (((Control.ModifierKeys & Keys.Control) != Keys.None) && checkBox4.Checked)
     {
         graphViewer1.PreviewRectangle.X1 = e.DataX;
         graphViewer1.PreviewRectangle.Y1 = e.DataY;
         graphViewer1.PreviewRectangle.X2 = e.DataX;
         graphViewer1.PreviewRectangle.Y2 = e.DataY;
         graphViewer1.PreviewRectangle.Visible = true;
     }
     if ((e.Button == MouseButtons.Middle) && checkBox6.Checked)
     {
         graphViewer1.CreateOrCloseFullscreenClone();
     }
 }
Beispiel #2
0
        private void graphViewer1_MouseMove(InteractiveGraphViewer sender, GraphMouseEventArgs e)
        {
            if (checkBox1.Checked)
            {
                m_MouseLocationTracker.X = e.DataX;
                m_MouseLocationTracker.Y = e.DataY;
                m_MouseLocationTracker.Hidden = false;
            }
            else
                m_MouseLocationTracker.Hidden = true;

            m_Hint.Hidden = true;
            if (m_HighlightedPoint != null)
                m_HighlightedPoint.MarkerStyle = GraphViewer.DisplayedGraph.PointMarkingStyle.Undefined;    //Default
            if (checkBox2.Checked)
            {
                int distanceSquare;
                var point = graphViewer1.FindNearestGraphPoint(e.DataX, e.DataY, false, out distanceSquare);
                if (point != null && distanceSquare <= 400)
                {
                    m_HighlightedPoint = point.NearestReferencePoint;
                    point.NearestReferencePoint.MarkerStyle = GraphViewer.DisplayedGraph.PointMarkingStyle.Square;

                    if (checkBox3.Checked && (point != null))
                    {
                        m_Hint.FillColor = Color.FromArgb(200, Color.LightGreen);
                        m_Hint.Show(e, string.Format("{2}\nNearest X = {0:f2}\nNearest Y = {1:f2}", m_HighlightedPoint.X, m_HighlightedPoint.Y, point.Graph.Hint));
                    }
                }
                else
                {
                    if (checkBox3.Checked && (point != null))
                    {
                        m_Hint.FillColor = Color.FromArgb(200, Color.LightYellow);
                        m_Hint.Show(e, string.Format("{2}\nX = {0:f2}\nY (interpolated)={1:f2}", point.X, point.Y, point.Graph.Hint));
                    }
                }
            }
            if (graphViewer1.PreviewRectangle.Visible)
            {
                graphViewer1.PreviewRectangle.X2 = e.DataX;
                graphViewer1.PreviewRectangle.Y2 = e.DataY;
            }
        }
Beispiel #3
0
 private void graphViewer1_MouseUp(InteractiveGraphViewer sender, GraphMouseEventArgs e)
 {
     if ((e.Button == MouseButtons.Left && graphViewer1.PreviewRectangle.Visible))
         graphViewer1.ForceNewBounds(graphViewer1.PreviewRectangle.MinX, graphViewer1.PreviewRectangle.MaxX, graphViewer1.PreviewRectangle.MinY, graphViewer1.PreviewRectangle.MaxY);
     else
         graphViewer1.ForceCustomBounds = false;
     graphViewer1.PreviewRectangle.Visible = false;
 }
 public void Show(GraphMouseEventArgs e, string text)
 {
     _Hidden = false;
     _X = e.DataX;
     _Y = e.DataY;
     _Text = text;
 }