Exemple #1
0
 public void Refresh()
 {
     if (parent != null)
     {
         parent.Invalidate(this.BoundingRectangle);
     }
 }
Exemple #2
0
        private void DrawingTimer_Tick(object sender, EventArgs e)
        {
            bool isLive      = ((SignalDocument)document).DataIsLive;
            int  signalCount = ((SignalDocument)document).Signals.Count;

            if (isLive && prevSignalCount != signalCount)
            {
                GraphPanel.Invalidate();
            }
        }
Exemple #3
0
 public Form1()
 {
     InitializeComponent();
     DoubleBuffered = true;
     LowX           = LowY = -5;
     HighX          = HighY = 5;
     sizeX          = 800;
     sizeY          = 600;
     DoubleBuffered = true;
     Trans          = new Translator()
     {
         Lx = LowX, Ly = LowY, Tx = HighX, Ty = HighY, h = sizeY, w = sizeX
     };
     GraphPanel.Invalidate();
 }
Exemple #4
0
        private void MW(object sender, MouseEventArgs e)
        {
            float inc = (float)Math.Pow(2, (e.Delta / 120));

            if (HighX * inc - LowX * inc != 0 && HighY * inc - LowY * inc != 0)
            {
                if (!(HighX * inc > float.MaxValue / 10 || HighY * inc > float.MaxValue / 10 || LowX * inc < float.MinValue / 10 || LowY * inc < float.MinValue / 10) &&
                    !(HighX * inc - LowX * inc < 1E-10 || HighY * inc - LowY * inc < 1E-10))
                {
                    LowX  -= (HighX - LowX) * (inc - 1) / 2;
                    LowY  -= (HighY - LowY) * (inc - 1) / 2;
                    HighY += (HighY - LowY) * (inc - 1) / 2;
                    HighX += (HighX - LowX) * (inc - 1) / 2;
                    Trans  = new Translator()
                    {
                        Lx = LowX, Ly = LowY, Tx = HighX, Ty = HighY, h = sizeY, w = sizeX
                    };
                    GraphPanel.Invalidate();
                }
            }
        }
Exemple #5
0
        private void Move(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (oldX == null)
                {
                    oldX = e.X;
                    oldY = e.Y;
                }
                else
                {
                    //Move Along based on distance in IS
                    PointIS trans = PointIS.FromPoint(new Point(e.X - (int)oldX, (e.Y - (int)oldY)), Trans);
                    if (!(float.IsInfinity(trans.X) || float.IsInfinity(trans.Y)))
                    {
                        if (!(HighX + trans.X > float.MaxValue / 10 || HighY + trans.Y > float.MaxValue / 10 || LowX - trans.X < float.MinValue / 10 || LowY - trans.Y < float.MinValue / 10))
                        {
                            LowX  += trans.X;
                            HighX += trans.X;
                            LowY  += trans.Y;
                            HighY += trans.Y;
                            oldY   = e.Y;
                            oldX   = e.X;
                            Trans  = new Translator()
                            {
                                Lx = LowX, Ly = LowY, Tx = HighX, Ty = HighY, h = sizeY, w = sizeX
                            };

                            GraphPanel.Invalidate();
                        }
                    }
                }
            }
            else
            {
                oldX = oldY = null;
            }
        }
Exemple #6
0
 private void trackBar1_Scroll(object sender, EventArgs e)
 {
     a = trackBar1.Value;
     GraphPanel.Invalidate();
 }
Exemple #7
0
 private void EquationIO_TextChanged(object sender, EventArgs e)
 {
     input = EquationIO.Text;
     GraphPanel.Invalidate();
 }
Exemple #8
0
 private void MinusButton_Click(object sender, EventArgs e)
 {
     scale /= 1.2f;
     GraphPanel.Invalidate();
 }