Example #1
0
 private void FuncTextDone(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         PlottingPanel.Invalidate();
     }
 }
Example #2
0
 private void PlottingPanel_MouseWheel(object sender, MouseEventArgs e)
 {
     if (CRB.Checked)
     {
         double x = ForPlot.conv.XX(e.X), y = ForPlot.conv.YY(e.Y);
         double changeCoeff = e.Delta > 0 ? 0.75 : 1.25;
         ForPlot.conv.X1 = x - (x - ForPlot.conv.X1) * changeCoeff;
         ForPlot.conv.Y1 = y - (y - ForPlot.conv.Y1) * changeCoeff;
         ForPlot.conv.X2 = x + (ForPlot.conv.X2 - x) * changeCoeff;
         ForPlot.conv.Y2 = y + (ForPlot.conv.Y2 - y) * changeCoeff;
     }
     else
     if (ForPlot.conv.X2 - ForPlot.conv.ScreenWidth * e.Delta / 300 > 0
         &&
         ForPlot.conv.Y2 - ForPlot.conv.ScreenHeight * e.Delta / 300 > 0
         ||
         e.Delta < 0)
     {
         ForPlot.conv.X1 += ForPlot.conv.ScreenWidth * e.Delta / 300;
         ForPlot.conv.X2 -= ForPlot.conv.ScreenWidth * e.Delta / 300;
         ForPlot.conv.Y1 += ForPlot.conv.ScreenHeight * e.Delta / 300;
         ForPlot.conv.Y2 -= ForPlot.conv.ScreenHeight * e.Delta / 300;
     }
     PlottingPanel.Invalidate();
 }
Example #3
0
 private void NetColorButton_Click(object sender, EventArgs e)
 {
     if (MyColorDialog.ShowDialog() != DialogResult.Cancel)
     {
         ForPlot.NC = MyColorDialog.Color;
         PlottingPanel.Invalidate();
     }
     else
     {
         return;
     }
 }
Example #4
0
        private void PlottingPanel_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                double t = ForPlot.SearchForT(e.X, e.Y, Xtext.Text, Ytext.Text);
                if (t > 3000)
                {
                    TLabel.Text = "t is undefined around here";
                }
                else
                {
                    TLabel.Text = "t ≈ " + Math.Round(t, 3).ToString();
                }

                PlottingPanel.Invalidate();
            }
        }
Example #5
0
        private void PlottingPanel_MouseMove(object sender, MouseEventArgs e)
        {
            PlottingPanel.Focus();
            PointF temp = ForPlot.GetPointF(e.X, e.Y);

            XYLabel.Text = "(x, y) = (" + Math.Round(temp.X, 2).ToString() + "; " + Math.Round(temp.Y, 2).ToString() + ")";


            if (dragging)
            {
                double deltaX = ForPlot.conv.XX(e.X) - ForPlot.conv.XX(lastPoint.X),
                       deltaY = ForPlot.conv.YY(e.Y) - ForPlot.conv.YY(lastPoint.Y);
                ForPlot.conv.X1 -= deltaX;
                ForPlot.conv.X2 -= deltaX;
                ForPlot.conv.Y1 -= deltaY;
                ForPlot.conv.Y2 -= deltaY;

                PlottingPanel.Invalidate();
                lastPoint = e.Location;
            }
        }
Example #6
0
 private void TParams_Changed(object sender, EventArgs e)
 {
     PlottingPanel.Invalidate();
 }
Example #7
0
        //private void MainForm_ResizeEnd(object sender, EventArgs e)
        //{
        //if ((PlottingPanel.Width / 2) % 70 != 0)
        //    Width += 70 - ((PlottingPanel.Width / 2) % 70);
        //if ((PlottingPanel.Height / 2) % 70 != 0)
        //    Height += 70 - ((PlottingPanel.Height / 2) % 70);
        //ForPlot.conv = new Converter(PlottingPanel.Width, PlottingPanel.Height);
        //PlottingPanel.Invalidate();
        //}

        private void MainForm_Resize(object sender, EventArgs e)
        {
            ForPlot.conv = new Converter(PlottingPanel.Width, PlottingPanel.Height);
            PlottingPanel.Invalidate();
        }