/// <summary> /// Initialization /// </summary> /// <param name="owner"></param> /// <param name="docManager"></param> public void Initialize(MainForm owner, DocManager docManager) { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true); // Keep reference to owner form this.Owner = owner; this.DocManager = docManager; // set default tool activeTool = DrawToolType.Pointer; // create list of graphic objects graphicsList = new GraphicsList(); // Create undo manager undoManager = new UndoManager(graphicsList); // create array of drawing tools tools = new Tool[(int)DrawToolType.NumberOfDrawTools]; tools[(int)DrawToolType.Pointer] = new ToolPointer(); tools[(int)DrawToolType.Rectangle] = new ToolRectangle(); tools[(int)DrawToolType.Ellipse] = new ToolEllipse(); tools[(int)DrawToolType.Triangle] = new ToolTriangle(); tools[(int)DrawToolType.Line] = new ToolLine(); tools[(int)DrawToolType.Polygon] = new ToolPolygon(); }
private void tsmiNewTemplate_Click(object sender, EventArgs e) { MainForm frmTemplate = new MainForm(); frmTemplate.menuStrip1.Visible = false; frmTemplate.navMenu.Visible = false; frmTemplate.tsbNew.Visible = false; frmTemplate.tsbSave.Visible = false; frmTemplate.tsbSaveTemp.Visible = true; frmTemplate.toolStripStatus.Visible = false; frmTemplate.Text = "����ģ��"; frmTemplate.toolStrip1.LayoutStyle = ToolStripLayoutStyle.Flow; frmTemplate.tsbBackColor.DisplayStyle = ToolStripItemDisplayStyle.None; frmTemplate.drawArea.Dock = DockStyle.Fill; DevExpress.XtraEditors.SplitterControl scRight = new DevExpress.XtraEditors.SplitterControl(); frmTemplate.panelShow.Controls.Add(scRight); scRight.Dock = DockStyle.Right; DevExpress.XtraEditors.SplitterControl scBottom = new DevExpress.XtraEditors.SplitterControl(); frmTemplate.panelShow.Controls.Add(scBottom); scBottom.Dock = DockStyle.Bottom; frmTemplate.panelShow.Controls.Add(new Panel() { Dock = DockStyle.Right, Width = 0, Height = 0 }); frmTemplate.panelShow.Controls.Add(new Panel() { Dock = DockStyle.Bottom, Width = 0, Height = 0 }); frmTemplate.panelShow.Controls.Remove(frmTemplate.navMenu); frmTemplate.Refresh(); frmTemplate.Width = 500; frmTemplate.Height = 500; frmTemplate.ShowDialog(); string activeGroupName = navMenu.ActiveGroup.Name; navMenu.Groups.Clear(); navMenu.Items.Clear(); FillNavBarMenu(menuFilePath); navMenu.Groups[activeGroupName].Expanded = true; }