public void Attach(IWorkbench workbench) { wbForm = (DefaultWorkbench)workbench; wbForm.SuspendLayout(); wbForm.Controls.Clear(); ToolStripContainer tsc = new ToolStripContainer(); tsc.Dock = DockStyle.Fill; tsc.TopToolStripPanel.Controls.AddRange(wbForm.ToolBars); tsc.TopToolStripPanel.Controls.Add(wbForm.TopMenu); tsc.BottomToolStripPanel.Controls.Add(StatusBarService.Control); SplitContainer splitContainer = new SplitContainer(); splitContainer.Dock = DockStyle.Fill; documentTabs = new WorkbenchTabControl(this); documentTabs.Dock = DockStyle.Fill; splitContainer.Panel2.Controls.Add(documentTabs); padTabs = new TabControl(); padTabs.Multiline = true; padTabs.Dock = DockStyle.Fill; splitContainer.Panel1.Controls.Add(padTabs); tsc.ContentPanel.Controls.Add(splitContainer); wbForm.Controls.Add(tsc); wbForm.ResumeLayout(false); }
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; }