public void Attach(IWorkbench workbench) { wbForm = (DefaultWorkbench)workbench; wbForm.SuspendLayout(); wbForm.Controls.Clear(); mainMenuContainer = new AutoHideMenuStripContainer(wbForm.TopMenu); mainMenuContainer.Dock = DockStyle.Top; statusStripContainer = new AutoHideStatusStripContainer((StatusStrip)StatusBarService.Control); statusStripContainer.Dock = DockStyle.Bottom; toolBarPanel = new ToolStripPanel(); if (wbForm.ToolBars != null) { toolBarPanel.Controls.AddRange(wbForm.ToolBars); } toolBarPanel.Dock = DockStyle.Top; dockPanel = new DockPanel(); dockPanel.Dock = DockStyle.Fill; dockPanel.RightToLeftLayout = true; // Known issues with certain DocumentStyles: // DockingMdi: // - this is the default value // - after switching between layouts, text editor tooltips sometimes do not show up anymore // DockingSdi: // - in this mode, the tab bar is not shown when there is only one open window // DockingWindow: // - SharpDevelop 2.x used this mode // - it was also the only mode supported by the early DockPanelSuite versions used by SharpDevelop 1.x dockPanel.DocumentStyle = DocumentStyle.DockingWindow; wbForm.Controls.Add(dockPanel); wbForm.Controls.Add(toolBarPanel); wbForm.Controls.Add(mainMenuContainer); wbForm.Controls.Add(statusStripContainer); wbForm.MainMenuStrip = wbForm.TopMenu; // dock panel has to be added to the form before LoadLayoutConfiguration is called to fix SD2-463 LoadLayoutConfiguration(); ShowPads(); ShowViewContents(); RedrawAllComponents(); dockPanel.ActiveDocumentChanged += new EventHandler(ActiveMdiChanged); dockPanel.ActiveContentChanged += new EventHandler(ActiveContentChanged); ActiveMdiChanged(this, EventArgs.Empty); wbForm.ResumeLayout(false); Properties fullscreenProperties = PropertyService.Get("ICSharpCode.SharpDevelop.Gui.FullscreenOptions", new Properties()); fullscreenProperties.PropertyChanged += TrackFullscreenPropertyChanges; }
public void Attach(IWorkbench workbench) { wbForm = (DefaultWorkbench)workbench; wbForm.SuspendLayout(); wbForm.Controls.Clear(); toolStripContainer = new ToolStripContainer(); toolStripContainer.SuspendLayout(); toolStripContainer.Dock = DockStyle.Fill; mainMenuContainer = new AutoHideMenuStripContainer(((DefaultWorkbench)wbForm).TopMenu); mainMenuContainer.Dock = DockStyle.Top; statusStripContainer = new AutoHideStatusStripContainer((StatusStrip)StatusBarService.Control); statusStripContainer.Dock = DockStyle.Bottom; dockPanel = new WeifenLuo.WinFormsUI.DockPanel(); dockPanel.DocumentStyle = DocumentStyles.DockingWindow; this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill; Panel helperPanel = new Panel(); helperPanel.Dock = DockStyle.Fill; helperPanel.Controls.Add(dockPanel); toolStripContainer.ContentPanel.Controls.Add(helperPanel); toolStripContainer.ContentPanel.Controls.Add(mainMenuContainer); toolStripContainer.ContentPanel.Controls.Add(statusStripContainer); wbForm.Controls.Add(toolStripContainer); // dock panel has to be added to the form before LoadLayoutConfiguration is called to fix SD2-463 LoadLayoutConfiguration(); ShowPads(); ShowViewContents(); RedrawAllComponents(); dockPanel.ActiveDocumentChanged += new EventHandler(ActiveMdiChanged); dockPanel.ActiveContentChanged += new EventHandler(ActiveContentChanged); ActiveMdiChanged(this, EventArgs.Empty); toolStripContainer.ResumeLayout(false); wbForm.ResumeLayout(false); Properties fullscreenProperties = PropertyService.Get("ICSharpCode.SharpDevelop.Gui.FullscreenOptions", new Properties()); fullscreenProperties.PropertyChanged += TrackFullscreenPropertyChanges; }
public void Attach(IWorkbench workbench) { string file = AppDomain.CurrentDomain.BaseDirectory + "logo.ico"; wbForm = (DefaultWorkbench)workbench; wbForm.Icon = IconService.GetIcon(file); wbForm.ShowIcon = true; wbForm.SuspendLayout(); wbForm.Controls.Clear(); mainMenuContainer = new AutoHideMenuStripContainer(wbForm.TopMenu); mainMenuContainer.Dock = DockStyle.Left; wbForm.TopMenu.LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow; statusStripContainer = new AutoHideStatusStripContainer((StatusStrip)StatusBarService.Control); statusStripContainer.Dock = DockStyle.Bottom; toolBarPanel = new ToolStripPanel(); if (wbForm.ToolBars != null) { toolBarPanel.Controls.AddRange(wbForm.ToolBars); } toolBarPanel.Dock = DockStyle.Top; dockPanel = new DockPanel(); dockPanel.Dock = DockStyle.Fill; dockPanel.RightToLeftLayout = false; //navbar MyMent myMent = new MyMent(wbForm.TopMenu); NavBarControl navBarControl = myMent.CreateControl(); navBarControl.Dock = DockStyle.Left; DockPaneStripSkin dockPaneSkin = new DockPaneStripSkin(); // 244,247,252 163, 186, 239 dockPaneSkin.DocumentGradient.DockStripGradient.StartColor = System.Drawing.Color.FromArgb(251, 248, 240); dockPaneSkin.DocumentGradient.DockStripGradient.EndColor = System.Drawing.Color.FromArgb(251, 248, 240); // RGB: 217,234,250 dockPaneSkin.DocumentGradient.ActiveTabGradient.StartColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.GradientActiveCaption); dockPaneSkin.DocumentGradient.ActiveTabGradient.EndColor = dockPaneSkin.DocumentGradient.ActiveTabGradient.StartColor; //RGB:221,234,244 dockPaneSkin.DocumentGradient.InactiveTabGradient.StartColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.GradientInactiveCaption); dockPaneSkin.DocumentGradient.InactiveTabGradient.StartColor = System.Drawing.Color.FromArgb(251, 248, 240); dockPaneSkin.DocumentGradient.InactiveTabGradient.EndColor = dockPaneSkin.DocumentGradient.InactiveTabGradient.StartColor; dockPaneSkin.TextFont = new System.Drawing.Font(dockPaneSkin.TextFont.FontFamily, DOCKPANEL_FONT_SIZE); dockPanel.Skin.DockPaneStripSkin = dockPaneSkin; //dockPanel.DocumentStyle = DocumentStyle.DockingWindow; dockPanel.DocumentStyle = DocumentStyle.DockingSdi; wbForm.Controls.Add(dockPanel); //wbForm.Controls.Add(toolBarPanel); wbForm.Controls.Add(navBarControl); //wbForm.Controls.Add(statusStripContainer); // TODO 状态栏 //wbForm.MainMenuStrip = wbForm.TopMenu; // dock panel has to be added to the form before LoadLayoutConfiguration is called to fix SD2-463 LoadLayoutConfiguration(); ShowPads(); ShowViewContents(); RedrawAllComponents(); dockPanel.ActiveDocumentChanged += new EventHandler(ActiveMdiChanged); dockPanel.ActiveContentChanged += new EventHandler(ActiveContentChanged); ActiveMdiChanged(this, EventArgs.Empty); wbForm.FormBorderStyle = FormBorderStyle.Fixed3D; wbForm.ResumeLayout(false); Core.Properties fullscreenProperties = PropertyService.Get("FanHai.Gui.Framework.Gui.FullscreenOptions", new Core.Properties()); fullscreenProperties.PropertyChanged += TrackFullscreenPropertyChanges; }