Changeset 2458 for trunk/sources/HeuristicLab.MainForm.Test
- Timestamp:
- 10/30/09 17:17:53 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.MainForm.Test/3.2
- Files:
-
- 2 deleted
- 22 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.Test/3.2/Actions/NewEditorAction.cs
r2252 r2458 6 6 7 7 namespace HeuristicLab.MainForm.Test { 8 public class NewEditorAction : IAction{ 9 #region IAction Members 10 11 public void Execute(IMainForm mainform) { 12 mainform.StatusStripText = "New Editor action called"; 13 EditorView x = new EditorView(); 14 x.Caption = "Editor View"; 15 mainform.ShowView(x); 8 public static class NewEditorAction{ 9 private static IView view; 10 public static void Execute(IMainForm mainform) { 11 if (view == null) 12 view = new EditorView(); 13 view.Caption = "Editor View"; 14 mainform.ShowView(view); 16 15 } 17 18 #endregion19 16 } 20 17 -
trunk/sources/HeuristicLab.MainForm.Test/3.2/Actions/NewFormAction.cs
r2252 r2458 6 6 7 7 namespace HeuristicLab.MainForm.Test { 8 public class NewFormAction : IAction{ 9 #region IAction Members 10 8 public class NewFormAction { 11 9 public void Execute(IMainForm mainform) { 12 mainform.StatusStripText = "New form called"; 13 FormView x = new FormView(); 10 FormView1 x = new FormView1(); 14 11 x.Caption = "FormView"; 15 12 mainform.ShowView(x); 16 13 } 17 18 #endregion19 14 } 20 15 -
trunk/sources/HeuristicLab.MainForm.Test/3.2/Actions/OpenAction.cs
r2249 r2458 6 6 7 7 namespace HeuristicLab.MainForm.Test { 8 public class OpenAction : IAction { 9 #region IAction Members 10 8 public class OpenAction { 11 9 public void Execute(IMainForm mainform) { 12 mainform.StatusStripText = "Open action called";10 MessageBox.Show("Open action called"); 13 11 } 14 15 #endregion16 12 } 17 13 } -
trunk/sources/HeuristicLab.MainForm.Test/3.2/Actions/SaveAction.cs
r2249 r2458 6 6 7 7 namespace HeuristicLab.MainForm.Test { 8 public class SaveAction : IAction{ 9 #region IAction Members 8 public class SaveAction { 10 9 public void Execute(IMainForm mainform) { 11 mainform.StatusStripText = "Save action called";10 MessageBox.Show("Save action called"); 12 11 } 13 #endregion14 12 } 15 13 } -
trunk/sources/HeuristicLab.MainForm.Test/3.2/ButtonItems/NewEditorToolStripButtonItem.cs
r2249 r2458 3 3 using System.Linq; 4 4 using System.Text; 5 using HeuristicLab.MainForm.WindowsForms; 5 6 6 7 namespace HeuristicLab.MainForm.Test { 7 public class NewEditorToolStripButtonItem : ToolStripButtonItemBase, ITestUserInterfaceItemProvider {8 public class NewEditorToolStripButtonItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, ITestUserInterfaceItemProvider { 8 9 public override int Position { 9 10 get { return 12; } … … 14 15 } 15 16 16 public override stringStructure {17 get { return "New"; }17 public override IEnumerable<string> Structure { 18 get { return new string []{"New"}; } 18 19 } 19 20 20 public override void Execute(IMainForm mainform) { 21 new NewEditorAction().Execute(mainform); 21 public override System.Windows.Forms.ToolStripItemDisplayStyle ToolStripItemDisplayStyle { 22 get { return System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText; } 23 } 24 25 public override void Execute() { 26 NewEditorAction.Execute(MainFormManager.MainForm); 22 27 } 23 28 } -
trunk/sources/HeuristicLab.MainForm.Test/3.2/ButtonItems/NewFormToolStripButtonItem.cs
r2249 r2458 3 3 using System.Linq; 4 4 using System.Text; 5 using HeuristicLab.MainForm.WindowsForms; 5 6 6 7 namespace HeuristicLab.MainForm.Test { 7 public class NewFormToolStripButtonItem : ToolStripButtonItemBase, ITestUserInterfaceItemProvider {8 public class NewFormToolStripButtonItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, ITestUserInterfaceItemProvider { 8 9 public override int Position { 9 10 get { return 11; } … … 14 15 } 15 16 16 public override stringStructure {17 get { return "New"; }17 public override IEnumerable<string> Structure { 18 get { return new string[] { "New" }; } 18 19 } 19 20 20 public override void Execute(IMainForm mainform) { 21 new NewFormAction().Execute(mainform); 21 public override System.Windows.Forms.ToolStripItemDisplayStyle ToolStripItemDisplayStyle { 22 get { return System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText; } 23 } 24 25 public override void Execute() { 26 new NewFormAction().Execute(MainFormManager.MainForm); 22 27 } 23 28 } -
trunk/sources/HeuristicLab.MainForm.Test/3.2/ButtonItems/NewToolStripButtonItem.cs
r2249 r2458 3 3 using System.Linq; 4 4 using System.Text; 5 using HeuristicLab.MainForm.WindowsForms; 5 6 6 7 namespace HeuristicLab.MainForm.Test { 7 public class NewToolStripButtonItem : ToolStripButtonItemBase, ITestUserInterfaceItemProvider {8 public class NewToolStripButtonItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, ITestUserInterfaceItemProvider { 8 9 public override int Position { 9 10 get { return 10; } … … 22 23 } 23 24 24 public override void Execute( IMainForm mainform) {25 public override void Execute() { 25 26 } 26 27 } -
trunk/sources/HeuristicLab.MainForm.Test/3.2/ButtonItems/OpenToolStripButtonItem.cs
r2249 r2458 3 3 using System.Linq; 4 4 using System.Text; 5 using HeuristicLab.MainForm.WindowsForms; 5 6 6 7 namespace HeuristicLab.MainForm.Test { 7 public class OpenToolStripButtonItem : Tool StripButtonItemBase, ITestUserInterfaceItemProvider {8 public class OpenToolStripButtonItem : ToolBarItemBase, ITestUserInterfaceItemProvider { 8 9 public override int Position { 9 10 get { return 20; } … … 18 19 } 19 20 20 public override void Execute( IMainForm mainform) {21 new OpenAction().Execute( mainform);21 public override void Execute() { 22 new OpenAction().Execute(MainFormManager.MainForm); 22 23 } 23 24 } -
trunk/sources/HeuristicLab.MainForm.Test/3.2/ButtonItems/SaveToolStripButtonItem.cs
r2269 r2458 3 3 using System.Linq; 4 4 using System.Text; 5 using HeuristicLab.MainForm.WindowsForms; 5 6 6 7 namespace HeuristicLab.MainForm.Test { 7 public class SaveToolStripButtonItem : ToolStripButtonItemBase, ITestUserInterfaceItemProvider {8 public class SaveToolStripButtonItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, ITestUserInterfaceItemProvider { 8 9 public override int Position { 9 10 get { return 30; } … … 18 19 } 19 20 20 public override void Execute( IMainForm mainform) {21 new SaveAction().Execute( mainform);21 public override void Execute() { 22 new SaveAction().Execute(MainFormManager.MainForm); 22 23 } 23 24 24 25 public override void ActiveViewChanged(object sender, EventArgs e) { 25 IMainForm mainform = (IMainForm)sender;26 IMainForm mainform = MainFormManager.MainForm; 26 27 if (mainform.ActiveView == null) 27 28 this.ToolStripItem.Enabled = false; 28 29 else 29 this.ToolStripItem.Enabled = !(mainform.ActiveView is FormView );30 this.ToolStripItem.Enabled = !(mainform.ActiveView is FormView1); 30 31 } 31 32 -
trunk/sources/HeuristicLab.MainForm.Test/3.2/EditorView.cs
r2266 r2458 7 7 using System.Text; 8 8 using System.Windows.Forms; 9 using HeuristicLab.MainForm.WindowsForms; 10 using System.Collections; 9 11 10 12 namespace HeuristicLab.MainForm.Test { 11 public partial class EditorView : ViewBase { 13 [DefaultViewAttribute] 14 public partial class EditorView : ViewBase<ArrayList> { 12 15 public EditorView() { 13 16 InitializeComponent(); 14 17 } 15 18 16 public EditorView(IMainForm mainform) 17 : base(mainform) { 19 private void ChangeStateButton_Click(object sender, EventArgs e) { 20 IEnumerable<Type> views = MainFormManager.GetViewTypes(typeof(ArrayList)); 21 views.ToString(); 22 IEnumerable<Type> views1 = MainFormManager.GetViewTypes(typeof(IList)); 23 views1.ToString(); 24 //IEnumerable<Type> views2 = MainFormManager.GetViewTypes(typeof(object)); 25 //views2.ToString(); 26 Type def2 = MainFormManager.GetDefaultViewType(typeof(IList)); 27 def2.ToString(); 28 Type def1 = MainFormManager.GetDefaultViewType(typeof(ArrayList)); 29 def1.ToString(); 30 //Type def3 = MainFormManager.GetDefaultViewType(typeof(object)); 31 //def3.ToString(); 32 33 MainFormManager.MainForm.HideView(this); 34 this.OnChanged(); 18 35 } 19 36 20 private void ChangeStateButton_Click(object sender, EventArgs e) { 21 this.OnStateChanged(); 22 } 23 24 public override void FormClosing(object sender, FormClosingEventArgs e) { 37 public override void OnClosing(object sender, CancelEventArgs e) { 25 38 if (DialogResult.Yes != MessageBox.Show( 26 39 "Recent changes have not been saved. Close the editor anyway?", "Close editor?", -
trunk/sources/HeuristicLab.MainForm.Test/3.2/FormView.Designer.cs
r2250 r2458 1 1 namespace HeuristicLab.MainForm.Test { 2 partial class FormView {2 partial class FormView1 { 3 3 /// <summary> 4 4 /// Required designer variable. -
trunk/sources/HeuristicLab.MainForm.Test/3.2/FormView.cs
r2252 r2458 7 7 using System.Text; 8 8 using System.Windows.Forms; 9 using HeuristicLab.MainForm.WindowsForms; 10 using System.Collections; 9 11 10 12 namespace HeuristicLab.MainForm.Test { 11 public partial class FormView : ViewBase { 13 [DefaultViewAttribute] 14 public partial class FormView1 : ViewBase<ICollection> { 12 15 private int[] array; 13 public FormView () {16 public FormView1() { 14 17 InitializeComponent(); 15 }16 17 public FormView(IMainForm mainform)18 : base(mainform) {19 18 } 20 19 } -
trunk/sources/HeuristicLab.MainForm.Test/3.2/HeuristicLab.MainForm.Test-3.2.csproj
r2276 r2458 87 87 <Compile Include="ButtonItems\SaveToolStripButtonItem.cs" /> 88 88 <Compile Include="ButtonItems\OpenToolStripButtonItem.cs" /> 89 <Compile Include="FormView2.cs"> 90 <SubType>UserControl</SubType> 91 </Compile> 92 <Compile Include="FormView2.Designer.cs"> 93 <DependentUpon>FormView2.cs</DependentUpon> 94 </Compile> 89 95 <Compile Include="HeuristicLabSingleDocumentMainFormTestApplication.cs" /> 90 96 <Compile Include="HeuristicLabMultipleDocumentMainFormTestApplication.cs" /> … … 104 110 <Compile Include="MenuItems\NewFormToolStripMenuItem.cs" /> 105 111 <Compile Include="MenuItems\NewEditorToolStripMenuItem.cs" /> 106 <Compile Include="MenuItems\FileToolStripMenuItem.cs" />107 <Compile Include="MenuItems\NewToolStripMenuItem.cs" />108 112 <Compile Include="Actions\NewFormAction.cs" /> 109 113 <Compile Include="Actions\OpenAction.cs" /> … … 125 129 <Name>HeuristicLab.Common.Resources-3.2</Name> 126 130 </ProjectReference> 131 <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.2\HeuristicLab.MainForm.WindowsForms.csproj"> 132 <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project> 133 <Name>HeuristicLab.MainForm.WindowsForms</Name> 134 </ProjectReference> 127 135 <ProjectReference Include="..\..\HeuristicLab.MainForm\3.2\HeuristicLab.MainForm-3.2.csproj"> 128 136 <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project> … … 138 146 </ItemGroup> 139 147 <ItemGroup> 148 <EmbeddedResource Include="FormView2.resx"> 149 <DependentUpon>FormView2.cs</DependentUpon> 150 </EmbeddedResource> 140 151 <EmbeddedResource Include="EditorView.resx"> 141 152 <DependentUpon>EditorView.cs</DependentUpon> -
trunk/sources/HeuristicLab.MainForm.Test/3.2/HeuristicLabDockingMainFormTestApplication.cs
r2253 r2458 25 25 using System.Windows.Forms; 26 26 using HeuristicLab.PluginInfrastructure; 27 using HeuristicLab.MainForm ;27 using HeuristicLab.MainForm.WindowsForms; 28 28 29 29 namespace HeuristicLab.MainForm.Test { -
trunk/sources/HeuristicLab.MainForm.Test/3.2/HeuristicLabMainFormTestPlugin.cs
r2247 r2458 25 25 using HeuristicLab.PluginInfrastructure; 26 26 27 namespace HeuristicLab.M odeling.Database{27 namespace HeuristicLab.MainForm.Test { 28 28 [ClassInfo(Name = "HeuristicLab.MainForm.Test-3.2")] 29 [PluginFile(Filename = "HeuristicLab.MainForm.Test-3.2.dll", Filetype = PluginFileType.Assembly)] 30 [Dependency(Dependency = "HeuristicLab.MainForm -3.2")]29 [PluginFile(Filename = "HeuristicLab.MainForm.Test-3.2.dll", Filetype = PluginFileType.Assembly)] 30 [Dependency(Dependency = "HeuristicLab.MainForm.WindowsForms-3.2")] 31 31 [Dependency(Dependency = "HeuristicLab.Common.Resources-3.2")] 32 32 public class HeuristicLabMainFormTestPlugin : PluginBase { -
trunk/sources/HeuristicLab.MainForm.Test/3.2/HeuristicLabMultipleDocumentMainFormTestApplication.cs
r2253 r2458 25 25 using System.Windows.Forms; 26 26 using HeuristicLab.PluginInfrastructure; 27 using HeuristicLab.MainForm ;27 using HeuristicLab.MainForm.WindowsForms; 28 28 29 29 namespace HeuristicLab.MainForm.Test { -
trunk/sources/HeuristicLab.MainForm.Test/3.2/HeuristicLabSingleDocumentMainFormTestApplication.cs
r2268 r2458 25 25 using System.Windows.Forms; 26 26 using HeuristicLab.PluginInfrastructure; 27 using HeuristicLab.MainForm ;27 using HeuristicLab.MainForm.WindowsForms; 28 28 29 29 namespace HeuristicLab.MainForm.Test { -
trunk/sources/HeuristicLab.MainForm.Test/3.2/MenuItems/ExitToolStripMenuItem.cs
r2256 r2458 5 5 using System.Windows.Forms; 6 6 7 using HeuristicLab.MainForm ;7 using HeuristicLab.MainForm.WindowsForms; 8 8 using HeuristicLab.Common.Resources; 9 9 10 10 namespace HeuristicLab.MainForm.Test { 11 public class CloseToolStripMenuItem : ToolStripMenuItemBase, ITestUserInterfaceItemProvider {11 public class CloseToolStripMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, ITestUserInterfaceItemProvider { 12 12 public override string Name { 13 13 get { return "Exit"; } 14 14 } 15 15 16 public override stringStructure {17 get { return "File"; }16 public override IEnumerable<string> Structure { 17 get { return new string[] { "File" }; } 18 18 } 19 19 … … 22 22 } 23 23 24 public override void Execute( IMainForm mainform) {25 mainform.Close();24 public override void Execute() { 25 MainFormManager.MainForm.Close(); 26 26 } 27 27 } -
trunk/sources/HeuristicLab.MainForm.Test/3.2/MenuItems/NewEditorToolStripMenuItem.cs
r2249 r2458 5 5 using System.Windows.Forms; 6 6 7 using HeuristicLab.MainForm;8 7 using HeuristicLab.Common.Resources; 8 using HeuristicLab.MainForm.WindowsForms; 9 9 10 10 namespace HeuristicLab.MainForm.Test { 11 public class NewEditorToolStripMenuItem : ToolStripMenuItemBase, ITestUserInterfaceItemProvider {11 public class NewEditorToolStripMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, ITestUserInterfaceItemProvider { 12 12 public override string Name { 13 13 get { return "Editor"; } 14 14 } 15 15 16 public override stringStructure {17 get { return "File/New" ; }16 public override IEnumerable<string> Structure { 17 get { return "File/New".Split('/'); } 18 18 } 19 19 … … 22 22 } 23 23 24 public override void Execute( IMainForm mainform) {25 new NewEditorAction().Execute(mainform);24 public override void Execute() { 25 NewEditorAction.Execute(MainFormManager.MainForm); 26 26 } 27 27 } -
trunk/sources/HeuristicLab.MainForm.Test/3.2/MenuItems/NewFormToolStripMenuItem.cs
r2249 r2458 5 5 using System.Windows.Forms; 6 6 7 using HeuristicLab.MainForm ;7 using HeuristicLab.MainForm.WindowsForms; 8 8 using HeuristicLab.Common.Resources; 9 9 10 10 namespace HeuristicLab.MainForm.Test { 11 public class NewFormToolStripMenuItem : ToolStripMenuItemBase, ITestUserInterfaceItemProvider {11 public class NewFormToolStripMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, ITestUserInterfaceItemProvider { 12 12 public override string Name { 13 13 get { return "Form"; } 14 14 } 15 15 16 public override stringStructure {17 get { return "File/New" ; }16 public override IEnumerable<string> Structure { 17 get { return "File/New".Split('/'); } 18 18 } 19 19 20 20 public override int Position { 21 21 get { return 1110; } 22 22 23 } 23 24 24 public override void Execute( IMainForm mainform) {25 new NewFormAction().Execute( mainform);25 public override void Execute() { 26 new NewFormAction().Execute(MainFormManager.MainForm); 26 27 } 27 28 } -
trunk/sources/HeuristicLab.MainForm.Test/3.2/MenuItems/OpenToolStripMenuItem.cs
r2249 r2458 4 4 using System.Text; 5 5 using System.Windows.Forms; 6 using HeuristicLab.MainForm ;6 using HeuristicLab.MainForm.WindowsForms; 7 7 using HeuristicLab.Common.Resources; 8 8 9 9 namespace HeuristicLab.MainForm.Test { 10 public class OpenToolStripMenuItem : ToolStripMenuItemBase, ITestUserInterfaceItemProvider {10 public class OpenToolStripMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, ITestUserInterfaceItemProvider { 11 11 public override string Name { 12 12 get { return "Open"; } 13 } 13 } 14 14 15 public override stringStructure {16 get { return "File"; }15 public override IEnumerable<string> Structure { 16 get { return new string[] { "File" }; } 17 17 } 18 18 … … 29 29 } 30 30 31 public override void Execute( IMainForm mainform) {32 new OpenAction().Execute( mainform);31 public override void Execute() { 32 new OpenAction().Execute(MainFormManager.MainForm); 33 33 } 34 34 } -
trunk/sources/HeuristicLab.MainForm.Test/3.2/MenuItems/SaveToolStripMenuItem.cs
r2249 r2458 5 5 using System.Windows.Forms; 6 6 7 using HeuristicLab.MainForm ;7 using HeuristicLab.MainForm.WindowsForms; 8 8 using HeuristicLab.Common.Resources; 9 9 10 10 namespace HeuristicLab.MainForm.Test { 11 public class SaveToolStripMenuItem : ToolStripMenuItemBase, ITestUserInterfaceItemProvider {11 public class SaveToolStripMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, ITestUserInterfaceItemProvider { 12 12 public override string Name { 13 13 get { return "Save"; } 14 14 } 15 15 16 public override stringStructure {17 get { return "File"; }16 public override IEnumerable<string> Structure { 17 get { return new string[]{"File"}; } 18 18 } 19 19 … … 30 30 } 31 31 32 public override void Execute( IMainForm mainform) {33 new SaveAction().Execute( mainform);32 public override void Execute() { 33 new SaveAction().Execute(MainFormManager.MainForm); 34 34 } 35 35 }
Note: See TracChangeset
for help on using the changeset viewer.