private void btnNew_Click(object sender, System.EventArgs e)
        {
            FuncForm ff = new FuncForm(engine);

            if (ff.ShowDialog(this) == DialogResult.OK)
            {
                addNewFunction(ff.Code, ff.MinX, ff.MaxX, ff.NPts);
            }
        }
        private void btnEdit_Click(object sender, System.EventArgs e)
        {
            int index = lbFList.SelectedIndex;

            if (index >= 0)
            {
                C1.Win.C1Chart.ChartDataSeries s = c1Chart1.ChartGroups.Group0.ChartData.SeriesList[index];
                FuncForm ff = new FuncForm(engine);
                ff.Code = lbFList.SelectedItem.ToString();
                ff.MinX = (float)s.MinX;
                ff.MaxX = (float)s.MaxX;
                ff.NPts = s.Length;
                if (ff.ShowDialog(this) == DialogResult.OK)
                {
                    PointF[] pts = engine.Run(ff.Code, ff.MinX, ff.MaxX, ff.NPts);
                    s.PointData.CopyDataIn(pts);
                    s.Label = ff.Code;

                    lbFList.Items[index] = ff.Code;
                }
            }
        }