private void button3_Click(object sender, EventArgs e) { gr.Clear(Color.White); richTextBox1.AppendText("Calc: " + tree.calculate(source[0]) + "\n\n"); tree.Draw(gr, new Point(PB_graph.Width / 2, 10)); PB_graph.Invalidate(); PB_graph.Refresh(); PB_graph.Update(); label2.Text = (tree.TreeRoot.ToString() + "\n"); }
private void button1_Click(object sender, EventArgs e) { gr.Clear(Color.White); tree = genTree(); tree.Draw(gr, new Point(PB_graph.Width / 2, 10)); PB_graph.Invalidate(); PB_graph.Refresh(); PB_graph.Update(); }
private void button4_Click(object sender, EventArgs e) { if (currentTree == null) { currentTree = new Tree(source[0].Count); currentTree.TreeRoot.mutate('O'); currentTree.TreeRoot.n1.mutate('O'); currentTree.TreeRoot.n2.mutate('O'); } //currentTree.Draw(gr, new Point(PB_graph.Width/2, 200)); //PB_graph.Invalidate(); //PB_graph.Refresh(); //PB_graph.Update(); //MessageBox.Show("let's ROCK!"); gr.Clear(Color.White); int lal = 150; currentTree.Draw(gr, new Point(PB_graph.Width / 2, lal + 10)); tree.Draw(gr, new Point(PB_graph.Width / 2, 10)); Tree[] childs = functions.crossTrees(tree, currentTree); // Tree child = crossTrees(tree, currentTree); int t = 2; foreach (var child in childs) { child.Draw(gr, new Point(PB_graph.Width / 2, 10 + lal * (t++))); } PB_graph.Invalidate(); PB_graph.Refresh(); PB_graph.Update(); //tree = childs[0]; //currentTree = childs[1]; }