Exemple #1
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public FormDerivationCalculator()
 {
     InitializeComponent();
     panelBase    = panelDesktopCenter;
     panel        = new FormulaEditorPanel();
     panel.Left   = 0;
     panel.Top    = 0;
     panel.Width  = 1200;
     panel.Height = 300;
     panelBase.Controls.Add(panel);
     panel.Prepare();
     openFileDialogEditor.InitialDirectory =
         ResourceService.Resources.CurrentDirectory + "\\Functions";
     saveFileDialogEditor.InitialDirectory = openFileDialogEditor.InitialDirectory;
 }
Exemple #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="s">String representation of derivation</param>
        public FormDerivationCalculator(string s)
        {
            InitializeComponent();
            panelBase = panelDesktopCenter;

            this.LoadResources();
            panel       = new FormulaEditorPanel();
            panel.Left  = 0;
            panel.Top   = 0;
            panel.Width = 1200;

            panel.Height = 300;

            panelDeriv.Top    = panel.Top + panel.Height + 20;
            panelDeriv.Left   = panel.Left;
            panelDeriv.Width  = panel.Width;
            panelDeriv.Height = 300;//nel.Height;
            derivRect         = new Rectangle(80, 20, 1100, panelDeriv.Height - 40);
            pointDeriv        = new Point(derivRect.Left + 20, derivRect.Top + derivRect.Height / 2);
            derivImage        = new Bitmap(panelDeriv.Width, panelDeriv.Height);
            Graphics g = Graphics.FromImage(derivImage);

            g.FillRectangle(new SolidBrush(Color.LightGray), 0, 0, derivImage.Width, derivImage.Height);
            g.DrawRectangle(new Pen(Color.Black), 0, 0, derivImage.Width - 1, derivImage.Height - 1);
            Font  f      = new Font("Serif", MathSymbolFactory.Sizes[0], FontStyle.Bold | FontStyle.Italic);
            int   delta  = 15;
            Brush bBrush = new SolidBrush(Color.Black);

            g.DrawString("f' = ", f, bBrush, 10, pointDeriv.Y + delta);
            g.Dispose();
            textBoxDerivType.Left = 20;
            textBoxDerivType.Top  = pointDeriv.Y + 35;
            panelBase.Controls.Add(panel);
            string[] symbols = new string[] { "abcdefghijklmnopqrstuvwxyz" };
            panel.Prepare(s, 4, null, null);
            openFileDialogEditor.InitialDirectory =
                ResourceService.Resources.CurrentDirectory + "\\Functions";
            saveFileDialogEditor.InitialDirectory = openFileDialogEditor.InitialDirectory;
        }