// private void flow_panel_Paint(object sender, System.Windows.Forms.PaintEventArgs e) // This method is called anytime the flow panel is invalidated. // It will traverse the object tree once to calculate the sizes // and x,y needed to draw the objects. Drawing the actual objects // occurs on the second pass through the tree. private void flow_panel_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { int x1, y1; if (Start != null) { Start.footprint(e.Graphics); // calculate all sizes and needed x,y points Point pt1 = new Point(50, 50); Point pt2 = new Point(100, 100); // compute ink resolution x1 = (int)Start.FP.left + Visual_Flow_Form.flow_width; y1 = (int)Math.Round(form.scale * 30); form.my_layout(); if (Component.compiled_flowchart) { // redo X and Y b/c layout changes them x1 = (int)Start.FP.left + Visual_Flow_Form.flow_width; y1 = (int)Math.Round(form.scale * 30); } Start.draw(e.Graphics, x1, y1); // traverse the tree and draw if (selection_rectangle.Width > 0) { e.Graphics.DrawRectangle(PensBrushes.black_dash_pen, selection_rectangle); } } }
public static void Redo_Action(Visual_Flow_Form form) { Subchart current = form.selectedTabMaybeNull(); if (num_redo > 0 && current != null) { Action this_action = ((Action)Redo_array[num_redo - 1]); Action undo_action; undo_action = new Action(); undo_action.kind = this_action.kind; undo_action.chart = this_action.chart; switch (this_action.kind) { case Action_Kind.Rename_Tab: undo_action.old_name = this_action.old_name; undo_action.new_name = this_action.new_name; Add_Undo_Action(undo_action, form); this_action.chart.Text = this_action.new_name; form.Rename_Tab(this_action.old_name, this_action.new_name); form.carlisle.SelectedTab = this_action.chart; break; case Action_Kind.Add_Tab: Add_Undo_Action(undo_action, form); form.carlisle.TabPages.Add(this_action.chart); form.carlisle.SelectedTab = this_action.chart; break; case Action_Kind.Delete_Tab: Add_Undo_Action(undo_action, form); form.carlisle.TabPages.Remove(this_action.chart); break; case Action_Kind.Change_Tab: undo_action.clone = this_action.chart.Start.Clone(); bool was_enabled = true; if (!Component.BARTPE && !Component.VM && !Component.MONO) { was_enabled = this_action.chart.tab_overlay.Enabled; this_action.chart.tab_overlay.Enabled = false; undo_action.ink = this_action.chart.tab_overlay.Ink.Clone(); } Add_Undo_Action(undo_action, form); this_action.chart.Start = (Oval)this_action.clone.Clone(); if (!Component.BARTPE && !Component.VM && !Component.MONO) { this_action.chart.tab_overlay.Ink = this_action.ink.Clone(); this_action.chart.tab_overlay.Enabled = was_enabled; } this_action.chart.Start.scale = form.scale; this_action.chart.Start.Scale(form.scale); form.my_layout(); form.Current_Selection = current.Start.select(-1000, -1000); this_action.chart.flow_panel.Invalidate(); (this_action.chart.Parent as System.Windows.Forms.TabControl).SelectedTab = this_action.chart; if (this_action.chart.Parent != form.carlisle) { form.carlisle.SelectedTab = this_action.chart.Parent.Parent as System.Windows.Forms.TabPage; } //form.carlisle.SelectedTab=this_action.chart; break; } Decrement_Redoable(form); } }