- Timestamp:
- 08/10/09 11:11:16 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 added
- 10 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.Test/3.2/HeuristicLab.MainForm.Test-3.2.csproj
r2256 r2268 87 87 <Compile Include="ButtonItems\SaveToolStripButtonItem.cs" /> 88 88 <Compile Include="ButtonItems\OpenToolStripButtonItem.cs" /> 89 <Compile Include="HeuristicLabSingleDocumentMainFormTestApplication.cs" /> 89 90 <Compile Include="HeuristicLabMultipleDocumentMainFormTestApplication.cs" /> 90 91 <Compile Include="EditorView.cs"> -
trunk/sources/HeuristicLab.MainForm.Test/3.2/HeuristicLabSingleDocumentMainFormTestApplication.cs
r2266 r2268 28 28 29 29 namespace HeuristicLab.MainForm.Test { 30 [ClassInfo(Name = " MultipleDocumentMainForm Test", Description="Test application for new mainform development.")]31 public class HeuristicLab MultipleDocumentMainFormTestApplication : ApplicationBase {30 [ClassInfo(Name = "SingleDocumentMainForm Test", Description="Test application for new mainform development.")] 31 public class HeuristicLabSingleDocumentMainFormTestApplication : ApplicationBase { 32 32 public override void Run() { 33 MultipleDocumentMainForm mainForm = new MultipleDocumentMainForm(typeof(ITestUserInterfaceItemProvider));33 SingleDocumentMainForm mainForm = new SingleDocumentMainForm(typeof(ITestUserInterfaceItemProvider)); 34 34 mainForm.Title = "Test new MAINFORM concept"; 35 35 Application.Run(mainForm); -
trunk/sources/HeuristicLab.MainForm/3.2/DockingMainForm.Designer.cs
r2233 r2268 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this.components = new System.ComponentModel.Container(); 26 WeifenLuo.WinFormsUI.Docking.DockPanelSkin dockPanelSkin1 = new WeifenLuo.WinFormsUI.Docking.DockPanelSkin(); 27 WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin autoHideStripSkin1 = new WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin(); 28 WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient(); 29 WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient1 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); 30 WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin dockPaneStripSkin1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin(); 31 WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient dockPaneStripGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient(); 32 WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient2 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); 33 WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient2 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient(); 34 WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient3 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); 35 WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient(); 36 WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient4 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); 37 WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient5 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); 38 WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient3 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient(); 39 WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient6 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); 40 WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient7 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); 41 this.dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel(); 42 this.SuspendLayout(); 43 // 44 // dockPanel 45 // 46 this.dockPanel.ActiveAutoHideContent = null; 47 this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill; 48 this.dockPanel.DockBackColor = System.Drawing.SystemColors.Control; 49 this.dockPanel.Location = new System.Drawing.Point(0, 49); 50 this.dockPanel.Name = "dockPanel"; 51 this.dockPanel.Size = new System.Drawing.Size(624, 341); 52 dockPanelGradient1.EndColor = System.Drawing.SystemColors.ControlLight; 53 dockPanelGradient1.StartColor = System.Drawing.SystemColors.ControlLight; 54 autoHideStripSkin1.DockStripGradient = dockPanelGradient1; 55 tabGradient1.EndColor = System.Drawing.SystemColors.Control; 56 tabGradient1.StartColor = System.Drawing.SystemColors.Control; 57 tabGradient1.TextColor = System.Drawing.SystemColors.ControlDarkDark; 58 autoHideStripSkin1.TabGradient = tabGradient1; 59 dockPanelSkin1.AutoHideStripSkin = autoHideStripSkin1; 60 tabGradient2.EndColor = System.Drawing.SystemColors.ControlLightLight; 61 tabGradient2.StartColor = System.Drawing.SystemColors.ControlLightLight; 62 tabGradient2.TextColor = System.Drawing.SystemColors.ControlText; 63 dockPaneStripGradient1.ActiveTabGradient = tabGradient2; 64 dockPanelGradient2.EndColor = System.Drawing.SystemColors.Control; 65 dockPanelGradient2.StartColor = System.Drawing.SystemColors.Control; 66 dockPaneStripGradient1.DockStripGradient = dockPanelGradient2; 67 tabGradient3.EndColor = System.Drawing.SystemColors.ControlLight; 68 tabGradient3.StartColor = System.Drawing.SystemColors.ControlLight; 69 tabGradient3.TextColor = System.Drawing.SystemColors.ControlText; 70 dockPaneStripGradient1.InactiveTabGradient = tabGradient3; 71 dockPaneStripSkin1.DocumentGradient = dockPaneStripGradient1; 72 tabGradient4.EndColor = System.Drawing.SystemColors.ActiveCaption; 73 tabGradient4.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; 74 tabGradient4.StartColor = System.Drawing.SystemColors.GradientActiveCaption; 75 tabGradient4.TextColor = System.Drawing.SystemColors.ActiveCaptionText; 76 dockPaneStripToolWindowGradient1.ActiveCaptionGradient = tabGradient4; 77 tabGradient5.EndColor = System.Drawing.SystemColors.Control; 78 tabGradient5.StartColor = System.Drawing.SystemColors.Control; 79 tabGradient5.TextColor = System.Drawing.SystemColors.ControlText; 80 dockPaneStripToolWindowGradient1.ActiveTabGradient = tabGradient5; 81 dockPanelGradient3.EndColor = System.Drawing.SystemColors.ControlLight; 82 dockPanelGradient3.StartColor = System.Drawing.SystemColors.ControlLight; 83 dockPaneStripToolWindowGradient1.DockStripGradient = dockPanelGradient3; 84 tabGradient6.EndColor = System.Drawing.SystemColors.GradientInactiveCaption; 85 tabGradient6.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; 86 tabGradient6.StartColor = System.Drawing.SystemColors.GradientInactiveCaption; 87 tabGradient6.TextColor = System.Drawing.SystemColors.ControlText; 88 dockPaneStripToolWindowGradient1.InactiveCaptionGradient = tabGradient6; 89 tabGradient7.EndColor = System.Drawing.Color.Transparent; 90 tabGradient7.StartColor = System.Drawing.Color.Transparent; 91 tabGradient7.TextColor = System.Drawing.SystemColors.ControlDarkDark; 92 dockPaneStripToolWindowGradient1.InactiveTabGradient = tabGradient7; 93 dockPaneStripSkin1.ToolWindowGradient = dockPaneStripToolWindowGradient1; 94 dockPanelSkin1.DockPaneStripSkin = dockPaneStripSkin1; 95 this.dockPanel.Skin = dockPanelSkin1; 96 this.dockPanel.TabIndex = 3; 97 // 98 // DockingMainForm 99 // 100 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 27 101 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 102 this.ClientSize = new System.Drawing.Size(624, 412); 103 this.Controls.Add(this.dockPanel); 104 this.IsMdiContainer = true; 105 this.Name = "DockingMainForm"; 106 this.Controls.SetChildIndex(this.dockPanel, 0); 107 this.ResumeLayout(false); 108 this.PerformLayout(); 109 28 110 } 29 111 30 112 #endregion 113 114 private WeifenLuo.WinFormsUI.Docking.DockPanel dockPanel; 31 115 } 32 116 } -
trunk/sources/HeuristicLab.MainForm/3.2/DockingMainForm.cs
r2266 r2268 32 32 namespace HeuristicLab.MainForm { 33 33 public partial class DockingMainForm : MainFormBase { 34 public DockingMainForm() 35 : base() { 36 InitializeComponent(); 37 } 38 34 39 public DockingMainForm(Type userInterfaceItemType) 35 40 : base(userInterfaceItemType) { 36 41 InitializeComponent(); 37 dockPanel = new DockPanel();38 InitializeDockPanel();39 this.IsMdiContainer = true;40 this.Controls.Add(dockPanel);41 this.Controls.SetChildIndex(dockPanel, 0);42 42 } 43 43 44 private DockPanel dockPanel; 45 46 public override void ShowView(IView view) { 44 public override void ShowView(IView view) { 47 45 if (InvokeRequired) Invoke((Action<IView>)ShowView, view); 48 46 else { … … 74 72 base.StatusStripText = ((DockForm)sender).View.Caption; 75 73 } 76 77 private void InitializeDockPanel() {78 DockPanelSkin dockPanelSkin1 = new DockPanelSkin();79 AutoHideStripSkin autoHideStripSkin1 = new AutoHideStripSkin();80 DockPanelGradient dockPanelGradient1 = new DockPanelGradient();81 TabGradient tabGradient1 = new TabGradient();82 DockPaneStripSkin dockPaneStripSkin1 = new DockPaneStripSkin();83 DockPaneStripGradient dockPaneStripGradient1 = new DockPaneStripGradient();84 TabGradient tabGradient2 = new TabGradient();85 DockPanelGradient dockPanelGradient2 = new DockPanelGradient();86 TabGradient tabGradient3 = new TabGradient();87 DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient1 = new DockPaneStripToolWindowGradient();88 TabGradient tabGradient4 = new TabGradient();89 TabGradient tabGradient5 = new TabGradient();90 DockPanelGradient dockPanelGradient3 = new DockPanelGradient();91 TabGradient tabGradient6 = new TabGradient();92 TabGradient tabGradient7 = new TabGradient();93 94 this.dockPanel.ActiveAutoHideContent = null;95 this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;96 this.dockPanel.DockBackColor = SystemColors.Control;97 this.dockPanel.DockBottomPortion = 0.33;98 this.dockPanel.DockLeftPortion = 0.33;99 this.dockPanel.DockRightPortion = 0.33;100 this.dockPanel.DockTopPortion = 0.33;101 this.dockPanel.Location = new Point(0, 49);102 this.dockPanel.Name = "dockPanel";103 this.dockPanel.RightToLeftLayout = true;104 dockPanelGradient1.EndColor = SystemColors.ControlLight;105 dockPanelGradient1.StartColor = SystemColors.ControlLight;106 autoHideStripSkin1.DockStripGradient = dockPanelGradient1;107 tabGradient1.EndColor = SystemColors.Control;108 tabGradient1.StartColor = SystemColors.Control;109 tabGradient1.TextColor = SystemColors.ControlDarkDark;110 autoHideStripSkin1.TabGradient = tabGradient1;111 dockPanelSkin1.AutoHideStripSkin = autoHideStripSkin1;112 tabGradient2.EndColor = SystemColors.ControlLightLight;113 tabGradient2.StartColor = SystemColors.ControlLightLight;114 tabGradient2.TextColor = SystemColors.ControlText;115 dockPaneStripGradient1.ActiveTabGradient = tabGradient2;116 dockPanelGradient2.EndColor = SystemColors.Control;117 dockPanelGradient2.StartColor = SystemColors.Control;118 dockPaneStripGradient1.DockStripGradient = dockPanelGradient2;119 tabGradient3.EndColor = SystemColors.ControlLight;120 tabGradient3.StartColor = SystemColors.ControlLight;121 tabGradient3.TextColor = SystemColors.ControlText;122 dockPaneStripGradient1.InactiveTabGradient = tabGradient3;123 dockPaneStripSkin1.DocumentGradient = dockPaneStripGradient1;124 tabGradient4.EndColor = SystemColors.ActiveCaption;125 tabGradient4.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;126 tabGradient4.StartColor = SystemColors.GradientActiveCaption;127 tabGradient4.TextColor = SystemColors.ActiveCaptionText;128 dockPaneStripToolWindowGradient1.ActiveCaptionGradient = tabGradient4;129 tabGradient5.EndColor = SystemColors.Control;130 tabGradient5.StartColor = SystemColors.Control;131 tabGradient5.TextColor = SystemColors.ControlText;132 dockPaneStripToolWindowGradient1.ActiveTabGradient = tabGradient5;133 dockPanelGradient3.EndColor = SystemColors.ControlLight;134 dockPanelGradient3.StartColor = SystemColors.ControlLight;135 dockPaneStripToolWindowGradient1.DockStripGradient = dockPanelGradient3;136 tabGradient6.EndColor = SystemColors.GradientInactiveCaption;137 tabGradient6.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;138 tabGradient6.StartColor = SystemColors.GradientInactiveCaption;139 tabGradient6.TextColor = SystemColors.ControlText;140 dockPaneStripToolWindowGradient1.InactiveCaptionGradient = tabGradient6;141 tabGradient7.EndColor = Color.Transparent;142 tabGradient7.StartColor = Color.Transparent;143 tabGradient7.TextColor = SystemColors.ControlDarkDark;144 dockPaneStripToolWindowGradient1.InactiveTabGradient = tabGradient7;145 dockPaneStripSkin1.ToolWindowGradient = dockPaneStripToolWindowGradient1;146 dockPanelSkin1.DockPaneStripSkin = dockPaneStripSkin1;147 this.dockPanel.Skin = dockPanelSkin1;148 this.dockPanel.TabIndex = 2;149 }150 74 } 151 75 } -
trunk/sources/HeuristicLab.MainForm/3.2/HeuristicLab.MainForm-3.2.csproj
r2256 r2268 82 82 </ItemGroup> 83 83 <ItemGroup> 84 <Compile Include="SingleDocumentMainForm.cs"> 85 <SubType>Form</SubType> 86 </Compile> 87 <Compile Include="SingleDocumentMainForm.Designer.cs"> 88 <DependentUpon>SingleDocumentMainForm.cs</DependentUpon> 89 </Compile> 84 90 <Compile Include="Interfaces\IUserInterfaceItem.cs" /> 85 91 <Compile Include="MultipleDocumentMainForm.cs"> … … 147 153 </ItemGroup> 148 154 <ItemGroup> 155 <EmbeddedResource Include="SingleDocumentMainForm.resx"> 156 <DependentUpon>SingleDocumentMainForm.cs</DependentUpon> 157 </EmbeddedResource> 158 <EmbeddedResource Include="DockingMainForm.resx"> 159 <DependentUpon>DockingMainForm.cs</DependentUpon> 160 </EmbeddedResource> 149 161 <EmbeddedResource Include="MainFormBase.resx"> 150 162 <DependentUpon>MainFormBase.cs</DependentUpon> -
trunk/sources/HeuristicLab.MainForm/3.2/MainFormBase.Designer.cs
r2233 r2268 80 80 #endregion 81 81 82 private System.Windows.Forms.MenuStrip menuStrip;83 82 private System.Windows.Forms.ToolStrip toolStrip; 84 83 private System.Windows.Forms.StatusStrip statusStrip; 85 84 private System.Windows.Forms.ToolStripStatusLabel statusStripLabel; 85 protected System.Windows.Forms.MenuStrip menuStrip; 86 86 } 87 87 } -
trunk/sources/HeuristicLab.MainForm/3.2/MainFormBase.cs
r2256 r2268 32 32 33 33 namespace HeuristicLab.MainForm { 34 public abstractpartial class MainFormBase : Form, IMainForm {35 protected MainFormBase( Type userInterfaceItemType)34 public partial class MainFormBase : Form, IMainForm { 35 protected MainFormBase() 36 36 : base() { 37 37 InitializeComponent(); 38 38 views = new List<IView>(); 39 39 viewChangeToolStripItems = new List<IToolStripItem>(); 40 } 41 42 protected MainFormBase(Type userInterfaceItemType) 43 : this() { 40 44 this.userInterfaceItemType = userInterfaceItemType; 41 45 CreateGUI(); … … 59 63 set { 60 64 if (InvokeRequired) { 61 Action<string> action = delegate(string s) { this. statusStripLabel.Text = s; };65 Action<string> action = delegate(string s) { this.StatusStripText = s; }; 62 66 Invoke(action, new object[] { value }); 63 67 } else … … 107 111 108 112 #region create menu and toolbar 109 pr ivatevoid CreateGUI() {113 protected virtual void CreateGUI() { 110 114 DiscoveryService ds = new DiscoveryService(); 111 115 … … 152 156 } 153 157 154 private ToolStripDropDownItem FindParent(IToolStripItem item, ToolStripItemCollection parentItems) { 158 private ToolStripDropDownItem FindParent(IToolStripItem item, ToolStripItemCollection parentItems) { 159 if (String.IsNullOrEmpty(item.Structure)) 160 return null; 161 155 162 ToolStripDropDownItem parent = null; 156 163 foreach (string structure in item.Structure.Split(item.StructureSeparator)) { … … 158 165 parent = (ToolStripDropDownItem)parentItems[structure]; 159 166 else 160 break; 167 throw new ArgumentException("Structure string for item " + item.Name + 168 " is invalid. Could not find " + structure + " in toolstrip!"); 161 169 parentItems = parent.DropDownItems; 162 170 } -
trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentForm.Designer.cs
r2253 r2268 21 21 22 22 namespace HeuristicLab.MainForm { 23 partial class MultipleDocumentForm {23 partial class DocumentForm { 24 24 /// <summary> 25 25 /// Required designer variable. … … 47 47 /// </summary> 48 48 private void InitializeComponent() { 49 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof( MultipleDocumentForm));49 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DocumentForm)); 50 50 this.viewPanel = new System.Windows.Forms.Panel(); 51 51 this.SuspendLayout(); -
trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentForm.cs
r2253 r2268 29 29 30 30 namespace HeuristicLab.MainForm { 31 public partial class MultipleDocumentForm : Form {31 public partial class DocumentForm : Form { 32 32 private IView myView; 33 33 public IView View { … … 35 35 } 36 36 37 public MultipleDocumentForm() {37 public DocumentForm() { 38 38 InitializeComponent(); 39 39 } 40 public MultipleDocumentForm(IView view)40 public DocumentForm(IView view) 41 41 : this() { 42 42 myView = view; -
trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.Designer.cs
r2254 r2268 31 31 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 32 32 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 33 this.ClientSize = new System.Drawing.Size(284, 264); 33 this.ClientSize = new System.Drawing.Size(596, 407); 34 this.IsMdiContainer = true; 34 35 this.Name = "MultipleDocumentMainForm"; 35 36 this.ResumeLayout(false); 37 this.PerformLayout(); 38 36 39 } 37 40 -
trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.cs
r2267 r2268 31 31 namespace HeuristicLab.MainForm { 32 32 public partial class MultipleDocumentMainForm : MainFormBase { 33 public MultipleDocumentMainForm() 34 : base() { 35 InitializeComponent(); 36 } 37 33 38 public MultipleDocumentMainForm(Type userInterfaceType) 34 39 : base(userInterfaceType) { 35 40 InitializeComponent(); 36 this.IsMdiContainer = true; 41 } 42 43 protected override void CreateGUI() { 44 base.CreateGUI(); 45 ToolStripMenuItem window = new ToolStripMenuItem("Windows"); 46 base.menuStrip.MdiWindowListItem = window; 47 base.menuStrip.Items.Add(window); 37 48 } 38 49 … … 41 52 else { 42 53 base.ShowView(view); 43 MultipleDocumentForm form = new MultipleDocumentForm(view);54 DocumentForm form = new DocumentForm(view); 44 55 form.Activated += new EventHandler(MultipleDocumentFormActivated); 45 56 form.FormClosing += new FormClosingEventHandler(view.FormClosing); … … 53 64 54 65 private void MultipleDocumentFormActivated(object sender, EventArgs e) { 55 base.ActiveView = (( MultipleDocumentForm)sender).View;56 base.StatusStripText = (( MultipleDocumentForm)sender).View.Caption;66 base.ActiveView = ((DocumentForm)sender).View; 67 base.StatusStripText = ((DocumentForm)sender).View.Caption; 57 68 } 58 69 59 70 private void MultipleDocumentFormClosed(object sender, FormClosedEventArgs e) { 60 MultipleDocumentForm form = (MultipleDocumentForm)sender;71 DocumentForm form = (DocumentForm)sender; 61 72 views.Remove(form.View); 62 73 if (views.Count == 0) -
trunk/sources/HeuristicLab.MainForm/3.2/SingleDocumentMainForm.Designer.cs
r2266 r2268 1 1 namespace HeuristicLab.MainForm { 2 partial class DockingMainForm {2 partial class SingleDocumentMainForm { 3 3 /// <summary> 4 4 /// Required designer variable. … … 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this.components = new System.ComponentModel.Container(); 26 this.SuspendLayout(); 27 // 28 // SingleDocumentMainForm 29 // 30 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 27 31 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 32 this.ClientSize = new System.Drawing.Size(624, 412); 33 this.Name = "SingleDocumentMainForm"; 34 this.ResumeLayout(false); 35 this.PerformLayout(); 36 28 37 } 29 38 30 39 #endregion 40 31 41 } 32 42 } -
trunk/sources/HeuristicLab.MainForm/3.2/SingleDocumentMainForm.cs
r2266 r2268 31 31 32 32 namespace HeuristicLab.MainForm { 33 public partial class DockingMainForm : MainFormBase { 34 public DockingMainForm(Type userInterfaceItemType) 33 public partial class SingleDocumentMainForm : MainFormBase { 34 public SingleDocumentMainForm() 35 : base() { 36 InitializeComponent(); 37 } 38 39 public SingleDocumentMainForm(Type userInterfaceItemType) 35 40 : base(userInterfaceItemType) { 36 41 InitializeComponent(); 37 dockPanel = new DockPanel();38 InitializeDockPanel();39 this.IsMdiContainer = true;40 this.Controls.Add(dockPanel);41 this.Controls.SetChildIndex(dockPanel, 0);42 42 } 43 43 44 private DockPanel dockPanel; 45 46 public override void ShowView(IView view) { 44 public override void ShowView(IView view) { 47 45 if (InvokeRequired) Invoke((Action<IView>)ShowView, view); 48 46 else { 49 47 base.ShowView(view); 50 Doc kContent dockForm = new DockForm(view);51 dockForm.Activated += new EventHandler(DockFormActivated);52 dockForm.FormClosing += new FormClosingEventHandler(view.FormClosing);53 dockForm.FormClosed += new FormClosedEventHandler(DockFormClosed);48 DocumentForm form = new DocumentForm(view); 49 form.Activated += new EventHandler(DockFormActivated); 50 form.FormClosing += new FormClosingEventHandler(view.FormClosing); 51 form.FormClosed += new FormClosedEventHandler(DockFormClosed); 54 52 foreach (IToolStripItem item in ViewChangedToolStripItems) 55 53 view.StateChanged += new EventHandler(item.ViewChanged); 56 dockForm.Show(dockPanel);54 form.Show(this); 57 55 } 58 56 } 59 57 60 58 private void DockFormClosed(object sender, FormClosedEventArgs e) { 61 Doc kForm dockForm = (DockForm)sender;62 views.Remove( dockForm.View);59 DocumentForm form = (DocumentForm)sender; 60 views.Remove(form.View); 63 61 if (views.Count == 0) 64 62 ActiveView = null; 65 dockForm.Activated -= new EventHandler(DockFormActivated);66 dockForm.FormClosing -= new FormClosingEventHandler(dockForm.View.FormClosing);67 dockForm.FormClosed -= new FormClosedEventHandler(DockFormClosed);63 form.Activated -= new EventHandler(DockFormActivated); 64 form.FormClosing -= new FormClosingEventHandler(form.View.FormClosing); 65 form.FormClosed -= new FormClosedEventHandler(DockFormClosed); 68 66 foreach (IToolStripItem item in ViewChangedToolStripItems) 69 dockForm.View.StateChanged -= new EventHandler(item.ViewChanged);67 form.View.StateChanged -= new EventHandler(item.ViewChanged); 70 68 } 71 69 72 70 private void DockFormActivated(object sender, EventArgs e) { 73 base.ActiveView = ((DockForm)sender).View; 74 base.StatusStripText = ((DockForm)sender).View.Caption; 75 } 76 77 private void InitializeDockPanel() { 78 DockPanelSkin dockPanelSkin1 = new DockPanelSkin(); 79 AutoHideStripSkin autoHideStripSkin1 = new AutoHideStripSkin(); 80 DockPanelGradient dockPanelGradient1 = new DockPanelGradient(); 81 TabGradient tabGradient1 = new TabGradient(); 82 DockPaneStripSkin dockPaneStripSkin1 = new DockPaneStripSkin(); 83 DockPaneStripGradient dockPaneStripGradient1 = new DockPaneStripGradient(); 84 TabGradient tabGradient2 = new TabGradient(); 85 DockPanelGradient dockPanelGradient2 = new DockPanelGradient(); 86 TabGradient tabGradient3 = new TabGradient(); 87 DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient1 = new DockPaneStripToolWindowGradient(); 88 TabGradient tabGradient4 = new TabGradient(); 89 TabGradient tabGradient5 = new TabGradient(); 90 DockPanelGradient dockPanelGradient3 = new DockPanelGradient(); 91 TabGradient tabGradient6 = new TabGradient(); 92 TabGradient tabGradient7 = new TabGradient(); 93 94 this.dockPanel.ActiveAutoHideContent = null; 95 this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill; 96 this.dockPanel.DockBackColor = SystemColors.Control; 97 this.dockPanel.DockBottomPortion = 0.33; 98 this.dockPanel.DockLeftPortion = 0.33; 99 this.dockPanel.DockRightPortion = 0.33; 100 this.dockPanel.DockTopPortion = 0.33; 101 this.dockPanel.Location = new Point(0, 49); 102 this.dockPanel.Name = "dockPanel"; 103 this.dockPanel.RightToLeftLayout = true; 104 dockPanelGradient1.EndColor = SystemColors.ControlLight; 105 dockPanelGradient1.StartColor = SystemColors.ControlLight; 106 autoHideStripSkin1.DockStripGradient = dockPanelGradient1; 107 tabGradient1.EndColor = SystemColors.Control; 108 tabGradient1.StartColor = SystemColors.Control; 109 tabGradient1.TextColor = SystemColors.ControlDarkDark; 110 autoHideStripSkin1.TabGradient = tabGradient1; 111 dockPanelSkin1.AutoHideStripSkin = autoHideStripSkin1; 112 tabGradient2.EndColor = SystemColors.ControlLightLight; 113 tabGradient2.StartColor = SystemColors.ControlLightLight; 114 tabGradient2.TextColor = SystemColors.ControlText; 115 dockPaneStripGradient1.ActiveTabGradient = tabGradient2; 116 dockPanelGradient2.EndColor = SystemColors.Control; 117 dockPanelGradient2.StartColor = SystemColors.Control; 118 dockPaneStripGradient1.DockStripGradient = dockPanelGradient2; 119 tabGradient3.EndColor = SystemColors.ControlLight; 120 tabGradient3.StartColor = SystemColors.ControlLight; 121 tabGradient3.TextColor = SystemColors.ControlText; 122 dockPaneStripGradient1.InactiveTabGradient = tabGradient3; 123 dockPaneStripSkin1.DocumentGradient = dockPaneStripGradient1; 124 tabGradient4.EndColor = SystemColors.ActiveCaption; 125 tabGradient4.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; 126 tabGradient4.StartColor = SystemColors.GradientActiveCaption; 127 tabGradient4.TextColor = SystemColors.ActiveCaptionText; 128 dockPaneStripToolWindowGradient1.ActiveCaptionGradient = tabGradient4; 129 tabGradient5.EndColor = SystemColors.Control; 130 tabGradient5.StartColor = SystemColors.Control; 131 tabGradient5.TextColor = SystemColors.ControlText; 132 dockPaneStripToolWindowGradient1.ActiveTabGradient = tabGradient5; 133 dockPanelGradient3.EndColor = SystemColors.ControlLight; 134 dockPanelGradient3.StartColor = SystemColors.ControlLight; 135 dockPaneStripToolWindowGradient1.DockStripGradient = dockPanelGradient3; 136 tabGradient6.EndColor = SystemColors.GradientInactiveCaption; 137 tabGradient6.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; 138 tabGradient6.StartColor = SystemColors.GradientInactiveCaption; 139 tabGradient6.TextColor = SystemColors.ControlText; 140 dockPaneStripToolWindowGradient1.InactiveCaptionGradient = tabGradient6; 141 tabGradient7.EndColor = Color.Transparent; 142 tabGradient7.StartColor = Color.Transparent; 143 tabGradient7.TextColor = SystemColors.ControlDarkDark; 144 dockPaneStripToolWindowGradient1.InactiveTabGradient = tabGradient7; 145 dockPaneStripSkin1.ToolWindowGradient = dockPaneStripToolWindowGradient1; 146 dockPanelSkin1.DockPaneStripSkin = dockPaneStripSkin1; 147 this.dockPanel.Skin = dockPanelSkin1; 148 this.dockPanel.TabIndex = 2; 71 base.ActiveView = ((DocumentForm)sender).View; 72 base.StatusStripText = ((DocumentForm)sender).View.Caption; 149 73 } 150 74 }
Note: See TracChangeset
for help on using the changeset viewer.