private void InitUI() { #region Editor and Canvas Debug.WriteLine("Loading canvas..."); this.editor = new DefaultEditor(); this.toolStripContainer1.ContentPanel.Controls.Add((Control)this.editor); ICanvas canvas1 = new DefaultCanvas(); this.editor.AddCanvas(canvas1); this.undoRedoObj = new UndoRedo(canvas1); canvas1.setUndoRedoObj(this.undoRedoObj); canvas1.initUndoRedo(); #endregion #region Toolbox // Initializing toolbox Debug.WriteLine("Loading toolbox..."); this.toolbox = new DefaultToolbox(); this.toolStripContainer1.TopToolStripPanel.Controls.Add((Control)this.toolbox); this.editor.Toolbox = toolbox; #endregion #region Tools // Initializing tools Debug.WriteLine("Loading tools..."); this.toolbox.AddTool(new LineTool()); this.toolbox.AddTool(new RectangleTool()); this.toolbox.AddTool(new EllipseTool()); this.toolbox.AddTool(new ActorTool()); this.toolbox.AddSeparator(); this.toolbox.AddTool(new SelectionTool()); this.toolbox.AddTool(new DeletionTool()); this.toolbox.AddTool(new UndoTool()); this.toolbox.AddTool(new RedoTool()); this.toolbox.ToolSelected += Toolbox_ToolSelected; this.toolbox.ToolClicked += Toolbox_ToolClicked; #endregion }
public void setUndoRedoObj(UndoRedo undoRedoObj) { this.undoObject = undoRedoObj; }