private void btnVisualize_Click(object sender, EventArgs e) { try { n = parser.ParseExpression(tbxInput.Text); } catch (Exception ex) { DirectMessage.ShowError(ex.Message); } this.pictureBoxGraph.Paint -= new System.Windows.Forms.PaintEventHandler(graphDrawer.DrawCoordinateSystem); graphDrawer = new GraphDrawer(n, chbHorizontalLabels.Checked, chbVerticalLabels.Checked, chbAxes.Checked, chbXY.Checked, chbFunction.Checked, chbInverseFunction.Checked, chbFunctionDerivative.Checked, chbFunctionIntegral.Checked, chbFunctionMaclaurin.Checked); this.pictureBoxGraph.Paint += new System.Windows.Forms.PaintEventHandler(graphDrawer.DrawCoordinateSystem); graphDrawer.OnIntegralPrompted += new GraphDrawer.FunctionDomainPrompt(HideFunctionIntegral); graphDrawer.OnMaclaurinPrompted += new GraphDrawer.FunctionDomainPrompt(HideFunctionMaclaurin); pictureBoxGraph.Refresh(); cm.MenuItems.Clear(); cm.MenuItems.Add("Export", new EventHandler(graphDrawer.ExportToPNG)); if (settingsForm != null) { if (IsSettingsFormOpened()) { settingsForm.Close(); settingsForm = null; OpenSettingsForm(); } } chbPolynomial.Checked = false; graphDrawer.DisablePolynomialMode(); ActiveControl = null; }
public Settings(ref GraphDrawer graphDrawer) { InitializeComponent(); this.graphDrawer = graphDrawer; trackBarPrecision.Value = Convert.ToInt32(-this.graphDrawer.GetPrecision()); InitValues(); }
public MainInterface() { InitializeComponent(); parser = new Parser(); graphDrawer = new GraphDrawer(); this.pictureBoxGraph.Paint += new System.Windows.Forms.PaintEventHandler(graphDrawer.DrawCoordinateSystem); UpdateUnitScale(); cm = new ContextMenu(); pictureBoxGraph.ContextMenu = cm; cm.MenuItems.Add("Export", new EventHandler(graphDrawer.ExportToPNG)); }