Changeset 2546 for trunk/sources/HeuristicLab.Optimizer
- Timestamp:
- 12/07/09 02:44:23 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimizer/3.3
- Files:
-
- 3 added
- 1 deleted
- 16 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimizer/3.3/HeuristicLab.Optimizer-3.3.csproj
r2520 r2546 51 51 </ItemGroup> 52 52 <ItemGroup> 53 <Compile Include="Actions\SaveAsAction.cs" /> 54 <Compile Include="Actions\SaveAllAction.cs" /> 55 <Compile Include="Actions\SaveAction.cs" /> 56 <Compile Include="Actions\OpenAction.cs" /> 57 <Compile Include="Actions\NewAction.cs" /> 53 <Compile Include="FileManager.cs" /> 58 54 <Compile Include="MenuItems\CloseMenuItem.cs" /> 59 55 <Compile Include="MenuItems\CloseAllMenuItem.cs" /> … … 68 64 <Compile Include="MenuItems\NewMenuItem.cs" /> 69 65 <Compile Include="MenuItems\Separators.cs" /> 70 <Compile Include="New Dialog.cs">66 <Compile Include="NewItemDialog.cs"> 71 67 <SubType>Form</SubType> 72 68 </Compile> 73 <Compile Include="New Dialog.Designer.cs">74 <DependentUpon>New Dialog.cs</DependentUpon>69 <Compile Include="NewItemDialog.Designer.cs"> 70 <DependentUpon>NewItemDialog.cs</DependentUpon> 75 71 </Compile> 76 72 <Compile Include="Properties\AssemblyInfo.cs" /> 73 <Compile Include="Properties\Resources.Designer.cs"> 74 <AutoGen>True</AutoGen> 75 <DesignTime>True</DesignTime> 76 <DependentUpon>Resources.resx</DependentUpon> 77 </Compile> 77 78 <Compile Include="ToolBarItems\SaveAllToolBarItem.cs" /> 78 79 <Compile Include="ToolBarItems\SaveToolBarItem.cs" /> … … 89 90 <Name>HeuristicLab.Common.Resources-3.2</Name> 90 91 </ProjectReference> 92 <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj"> 93 <Project>{E226881D-315F-423D-B419-A766FE0D8685}</Project> 94 <Name>HeuristicLab.Core.Views-3.3</Name> 95 </ProjectReference> 96 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj"> 97 <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project> 98 <Name>HeuristicLab.Core-3.3</Name> 99 </ProjectReference> 91 100 <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.2\HeuristicLab.MainForm.WindowsForms-3.2.csproj"> 92 101 <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project> … … 97 106 <Name>HeuristicLab.MainForm-3.2</Name> 98 107 </ProjectReference> 108 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj"> 109 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project> 110 <Name>HeuristicLab.Persistence-3.3</Name> 111 </ProjectReference> 99 112 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj"> 100 113 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> … … 103 116 </ItemGroup> 104 117 <ItemGroup> 105 <EmbeddedResource Include="NewDialog.resx"> 106 <DependentUpon>NewDialog.cs</DependentUpon> 118 <EmbeddedResource Include="NewItemDialog.resx"> 119 <DependentUpon>NewItemDialog.cs</DependentUpon> 120 </EmbeddedResource> 121 <EmbeddedResource Include="Properties\Resources.resx"> 122 <Generator>ResXFileCodeGenerator</Generator> 123 <LastGenOutput>Resources.Designer.cs</LastGenOutput> 107 124 </EmbeddedResource> 108 125 </ItemGroup> -
trunk/sources/HeuristicLab.Optimizer/3.3/HeuristicLabOptimizerApplication.cs
r2520 r2546 31 31 namespace HeuristicLab.Optimizer { 32 32 [ClassInfo(Name = "Optimizer 3.3", Description="Next generation heuristic optimization environment.")] 33 class HeuristicLabOptimizerApplication : ApplicationBase {33 internal class HeuristicLabOptimizerApplication : ApplicationBase { 34 34 public override void Run() { 35 35 DockingMainForm mainForm = new DockingMainForm(typeof(IOptimizerUserInterfaceItemProvider)); -
trunk/sources/HeuristicLab.Optimizer/3.3/HeuristicLabOptimizerPlugin.cs
r2501 r2546 28 28 [ClassInfo(Name = "HeuristicLab.Optimizer-3.3")] 29 29 [PluginFile(Filename = "HeuristicLab.Optimizer-3.3.dll", Filetype = PluginFileType.Assembly)] 30 [Dependency(Dependency = "HeuristicLab.Persistence-3.3")] 30 31 [Dependency(Dependency = "HeuristicLab.Common.Resources-3.2")] 32 [Dependency(Dependency = "HeuristicLab.Core-3.3")] 33 [Dependency(Dependency = "HeuristicLab.Core.Views-3.3")] 31 34 [Dependency(Dependency = "HeuristicLab.MainForm-3.2")] 32 35 [Dependency(Dependency = "HeuristicLab.MainForm.WindowsForms-3.2")] -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CloseAllMenuItem.cs
r2520 r2546 10 10 11 11 namespace HeuristicLab.Optimizer.MenuItems { 12 publicclass CloseAllMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider {12 internal class CloseAllMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider { 13 13 public override string Name { 14 14 get { return "Clos&e All"; } 15 15 } 16 17 16 public override IEnumerable<string> Structure { 18 17 get { return new string[] { "&File" }; } 19 18 } 20 21 19 public override int Position { 22 20 get { return 1700; } 21 } 22 23 public override void MainFormInitialized(object sender, EventArgs e) { 24 ToolStripItem.Enabled = false; 25 } 26 public override void ActiveViewChanged(object sender, EventArgs e) { 27 ToolStripItem.Enabled = MainFormManager.MainForm.Views.FirstOrDefault() != null; 23 28 } 24 29 -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CloseMenuItem.cs
r2520 r2546 10 10 11 11 namespace HeuristicLab.Optimizer.MenuItems { 12 publicclass CloseMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider {12 internal class CloseMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider { 13 13 public override string Name { 14 14 get { return "&Close"; } 15 15 } 16 17 16 public override IEnumerable<string> Structure { 18 17 get { return new string[] { "&File" }; } 19 18 } 20 21 19 public override int Position { 22 20 get { return 1600; } 21 } 22 23 public override void MainFormInitialized(object sender, EventArgs e) { 24 ToolStripItem.Enabled = false; 25 } 26 public override void ActiveViewChanged(object sender, EventArgs e) { 27 ToolStripItem.Enabled = MainFormManager.MainForm.Views.FirstOrDefault() != null; 23 28 } 24 29 -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/ExitMenuItem.cs
r2520 r2546 10 10 11 11 namespace HeuristicLab.Optimizer.MenuItems { 12 publicclass ExitMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider {12 internal class ExitMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider { 13 13 public override IEnumerable<string> Structure { 14 14 get { return new string[] { "&File" }; } 15 15 } 16 17 16 public override string Name { 18 17 get { return "E&xit"; } 19 18 } 20 21 19 public override int Position { 22 20 get { return 1999; } 23 21 } 24 25 22 public override Keys ShortCutKeys { 26 23 get { return Keys.Control | Keys.X; } -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/NewMenuItem.cs
r2520 r2546 9 9 10 10 namespace HeuristicLab.Optimizer.MenuItems { 11 publicclass NewMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider {11 internal class NewMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider { 12 12 public override string Name { 13 13 get { return "&New..."; } 14 14 } 15 16 15 public override IEnumerable<string> Structure { 17 16 get { return new string[] { "&File" }; } 18 17 } 19 20 18 public override int Position { 21 19 get { return 1100; } 22 20 } 23 24 21 public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle { 25 22 get { return ToolStripItemDisplayStyle.ImageAndText; } 26 23 } 27 28 24 public override Image Image { 29 25 get { return Resources.NewIcon; } 30 26 } 31 32 27 public override Keys ShortCutKeys { 33 28 get { return Keys.Control | Keys.N; } … … 35 30 36 31 public override void Execute() { 37 Actions.NewAction.Execute();32 FileManager.New(); 38 33 } 39 34 } -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/OpenMenuItem.cs
r2520 r2546 9 9 10 10 namespace HeuristicLab.Optimizer.MenuItems { 11 publicclass OpenMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider {11 internal class OpenMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider { 12 12 public override string Name { 13 13 get { return "&Open..."; } 14 14 } 15 16 15 public override IEnumerable<string> Structure { 17 16 get { return new string[] { "&File" }; } 18 17 } 19 20 18 public override int Position { 21 19 get { return 1200; } 22 20 } 23 24 21 public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle { 25 22 get { return ToolStripItemDisplayStyle.ImageAndText; } 26 23 } 27 28 24 public override Image Image { 29 25 get { return Resources.OpenIcon; } 30 26 } 31 32 27 public override Keys ShortCutKeys { 33 28 get { return Keys.Control | Keys.O; } … … 35 30 36 31 public override void Execute() { 37 Actions.OpenAction.Execute();32 FileManager.Open(); 38 33 } 39 34 } -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAllMenuItem.cs
r2520 r2546 5 5 using System.Windows.Forms; 6 6 using System.Drawing; 7 using HeuristicLab.MainForm; 7 8 using HeuristicLab.MainForm.WindowsForms; 8 9 using HeuristicLab.Common.Resources; 9 10 10 11 namespace HeuristicLab.Optimizer.MenuItems { 11 publicclass SaveAllMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider {12 internal class SaveAllMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider { 12 13 public override string Name { 13 14 get { return "Save Al&l"; } 14 15 } 15 16 16 public override IEnumerable<string> Structure { 17 17 get { return new string[] { "&File" }; } 18 18 } 19 20 19 public override int Position { 21 20 get { return 1500; } 22 21 } 23 24 22 public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle { 25 23 get { return ToolStripItemDisplayStyle.ImageAndText; } 26 24 } 27 28 25 public override Image Image { 29 26 get { return Resources.SaveAllIcon; } 30 27 } 31 28 29 public override void MainFormInitialized(object sender, EventArgs e) { 30 ToolStripItem.Enabled = false; 31 } 32 public override void ActiveViewChanged(object sender, EventArgs e) { 33 ToolStripItem.Enabled = MainFormManager.MainForm.Views.FirstOrDefault() != null; 34 } 35 32 36 public override void Execute() { 33 Actions.SaveAllAction.Execute();37 FileManager.SaveAll(); 34 38 } 35 39 } -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAsMenuItem.cs
r2520 r2546 5 5 using System.Windows.Forms; 6 6 using System.Drawing; 7 using HeuristicLab.MainForm; 7 8 using HeuristicLab.MainForm.WindowsForms; 8 9 using HeuristicLab.Common.Resources; 10 using HeuristicLab.Core; 11 using HeuristicLab.Core.Views; 9 12 10 13 namespace HeuristicLab.Optimizer.MenuItems { 11 publicclass SaveAsMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider {14 internal class SaveAsMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider { 12 15 public override string Name { 13 16 get { return "Save &As..."; } 14 17 } 15 16 18 public override IEnumerable<string> Structure { 17 19 get { return new string[] { "&File" }; } 18 20 } 19 20 21 public override int Position { 21 22 get { return 1400; } 22 23 } 23 24 24 public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle { 25 25 get { return ToolStripItemDisplayStyle.ImageAndText; } 26 26 } 27 28 27 public override Keys ShortCutKeys { 29 28 get { return Keys.Control | Keys.Shift | Keys.S; } 30 29 } 31 30 31 public override void MainFormInitialized(object sender, EventArgs e) { 32 ToolStripItem.Enabled = false; 33 } 34 public override void ActiveViewChanged(object sender, EventArgs e) { 35 IItemView activeView = MainFormManager.MainForm.ActiveView as IItemView; 36 ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Item.GetType()))); 37 } 38 32 39 public override void Execute() { 33 Actions.SaveAsAction.Execute();40 FileManager.SaveAs(); 34 41 } 35 42 } -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveMenuItem.cs
r2520 r2546 5 5 using System.Windows.Forms; 6 6 using System.Drawing; 7 using HeuristicLab.MainForm; 7 8 using HeuristicLab.MainForm.WindowsForms; 8 9 using HeuristicLab.Common.Resources; 10 using HeuristicLab.Core; 11 using HeuristicLab.Core.Views; 9 12 10 13 namespace HeuristicLab.Optimizer.MenuItems { 11 publicclass SaveMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider {14 internal class SaveMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider { 12 15 public override string Name { 13 16 get { return "&Save"; } 14 17 } 15 16 18 public override IEnumerable<string> Structure { 17 19 get { return new string[] { "&File" }; } 18 20 } 19 20 21 public override int Position { 21 22 get { return 1300; } 22 23 } 23 24 24 public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle { 25 25 get { return ToolStripItemDisplayStyle.ImageAndText; } 26 26 } 27 28 27 public override Image Image { 29 28 get { return Resources.SaveIcon; } 30 29 } 31 32 30 public override Keys ShortCutKeys { 33 31 get { return Keys.Control | Keys.S; } 34 32 } 35 33 34 public override void MainFormInitialized(object sender, EventArgs e) { 35 ToolStripItem.Enabled = false; 36 } 37 public override void ActiveViewChanged(object sender, EventArgs e) { 38 IItemView activeView = MainFormManager.MainForm.ActiveView as IItemView; 39 ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Item.GetType()))); 40 } 41 36 42 public override void Execute() { 37 Actions.SaveAction.Execute();43 FileManager.Save(); 38 44 } 39 45 } -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/Separators.cs
r2520 r2546 10 10 11 11 namespace HeuristicLab.Optimizer.MenuItems { 12 publicclass SeparatorMenuItem : MenuSeparatorItemBase, IOptimizerUserInterfaceItemProvider {12 internal class SeparatorMenuItem : MenuSeparatorItemBase, IOptimizerUserInterfaceItemProvider { 13 13 public override IEnumerable<string> Structure { 14 14 get { return new string[] { "&File" }; } -
trunk/sources/HeuristicLab.Optimizer/3.3/NewItemDialog.Designer.cs
r2537 r2546 1 1 namespace HeuristicLab.Optimizer { 2 partial class New Dialog {2 partial class NewItemDialog { 3 3 /// <summary> 4 4 /// Required designer variable. … … 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this.components = new System.ComponentModel.Container(); 27 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewItemDialog)); 26 28 this.okButton = new System.Windows.Forms.Button(); 27 29 this.cancelButton = new System.Windows.Forms.Button(); 30 this.itemsListView = new System.Windows.Forms.ListView(); 31 this.nameColumnHeader = new System.Windows.Forms.ColumnHeader(); 32 this.descriptioncolumnHeader = new System.Windows.Forms.ColumnHeader(); 33 this.itemsLabel = new System.Windows.Forms.Label(); 34 this.showIconsCheckBox = new System.Windows.Forms.CheckBox(); 35 this.showDetailsCheckBox = new System.Windows.Forms.CheckBox(); 36 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 28 37 this.SuspendLayout(); 29 38 // … … 33 42 this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; 34 43 this.okButton.Enabled = false; 35 this.okButton.Location = new System.Drawing.Point( 380, 315);44 this.okButton.Location = new System.Drawing.Point(456, 409); 36 45 this.okButton.Name = "okButton"; 37 46 this.okButton.Size = new System.Drawing.Size(75, 23); 38 this.okButton.TabIndex = 0;47 this.okButton.TabIndex = 2; 39 48 this.okButton.Text = "&OK"; 40 49 this.okButton.UseVisualStyleBackColor = true; 50 this.okButton.Click += new System.EventHandler(this.okButton_Click); 41 51 // 42 52 // cancelButton … … 44 54 this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 45 55 this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 46 this.cancelButton.Location = new System.Drawing.Point( 461, 315);56 this.cancelButton.Location = new System.Drawing.Point(537, 409); 47 57 this.cancelButton.Name = "cancelButton"; 48 58 this.cancelButton.Size = new System.Drawing.Size(75, 23); 49 this.cancelButton.TabIndex = 0;59 this.cancelButton.TabIndex = 3; 50 60 this.cancelButton.Text = "&Cancel"; 51 61 this.cancelButton.UseVisualStyleBackColor = true; 52 62 // 53 // NewDialog 63 // itemsListView 64 // 65 this.itemsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 66 | System.Windows.Forms.AnchorStyles.Left) 67 | System.Windows.Forms.AnchorStyles.Right))); 68 this.itemsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 69 this.nameColumnHeader, 70 this.descriptioncolumnHeader}); 71 this.itemsListView.HideSelection = false; 72 this.itemsListView.Location = new System.Drawing.Point(12, 33); 73 this.itemsListView.MultiSelect = false; 74 this.itemsListView.Name = "itemsListView"; 75 this.itemsListView.Size = new System.Drawing.Size(600, 370); 76 this.itemsListView.TabIndex = 1; 77 this.itemsListView.UseCompatibleStateImageBehavior = false; 78 this.itemsListView.View = System.Windows.Forms.View.SmallIcon; 79 this.itemsListView.SelectedIndexChanged += new System.EventHandler(this.itemTypesListView_SelectedIndexChanged); 80 this.itemsListView.DoubleClick += new System.EventHandler(this.itemTypesListView_DoubleClick); 81 // 82 // nameColumnHeader 83 // 84 this.nameColumnHeader.Text = "Name"; 85 // 86 // descriptioncolumnHeader 87 // 88 this.descriptioncolumnHeader.Text = "Description"; 89 // 90 // itemsLabel 91 // 92 this.itemsLabel.AutoSize = true; 93 this.itemsLabel.Location = new System.Drawing.Point(12, 9); 94 this.itemsLabel.Name = "itemsLabel"; 95 this.itemsLabel.Size = new System.Drawing.Size(35, 13); 96 this.itemsLabel.TabIndex = 0; 97 this.itemsLabel.Text = "&Items:"; 98 // 99 // showIconsCheckBox 100 // 101 this.showIconsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 102 this.showIconsCheckBox.Appearance = System.Windows.Forms.Appearance.Button; 103 this.showIconsCheckBox.Checked = true; 104 this.showIconsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 105 this.showIconsCheckBox.Image = ((System.Drawing.Image)(resources.GetObject("showIconsCheckBox.Image"))); 106 this.showIconsCheckBox.Location = new System.Drawing.Point(558, 3); 107 this.showIconsCheckBox.Name = "showIconsCheckBox"; 108 this.showIconsCheckBox.Size = new System.Drawing.Size(24, 24); 109 this.showIconsCheckBox.TabIndex = 4; 110 this.toolTip.SetToolTip(this.showIconsCheckBox, "Show Icons"); 111 this.showIconsCheckBox.UseVisualStyleBackColor = true; 112 this.showIconsCheckBox.Click += new System.EventHandler(this.showIconsCheckBox_Click); 113 // 114 // showDetailsCheckBox 115 // 116 this.showDetailsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 117 this.showDetailsCheckBox.Appearance = System.Windows.Forms.Appearance.Button; 118 this.showDetailsCheckBox.Image = ((System.Drawing.Image)(resources.GetObject("showDetailsCheckBox.Image"))); 119 this.showDetailsCheckBox.Location = new System.Drawing.Point(588, 3); 120 this.showDetailsCheckBox.Name = "showDetailsCheckBox"; 121 this.showDetailsCheckBox.Size = new System.Drawing.Size(24, 24); 122 this.showDetailsCheckBox.TabIndex = 5; 123 this.toolTip.SetToolTip(this.showDetailsCheckBox, "Show Details"); 124 this.showDetailsCheckBox.UseVisualStyleBackColor = true; 125 this.showDetailsCheckBox.Click += new System.EventHandler(this.showDetailsCheckBox_Click); 126 // 127 // NewItemDialog 54 128 // 55 129 this.AcceptButton = this.okButton; … … 57 131 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 58 132 this.CancelButton = this.cancelButton; 59 this.ClientSize = new System.Drawing.Size(548, 350); 133 this.ClientSize = new System.Drawing.Size(624, 444); 134 this.Controls.Add(this.showDetailsCheckBox); 135 this.Controls.Add(this.showIconsCheckBox); 136 this.Controls.Add(this.itemsLabel); 137 this.Controls.Add(this.itemsListView); 60 138 this.Controls.Add(this.cancelButton); 61 139 this.Controls.Add(this.okButton); 62 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;63 140 this.MaximizeBox = false; 64 141 this.MinimizeBox = false; 65 this.Name = "NewDialog"; 142 this.Name = "NewItemDialog"; 143 this.ShowIcon = false; 66 144 this.ShowInTaskbar = false; 67 145 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 68 146 this.Text = "New Item"; 69 147 this.TopMost = true; 148 this.Load += new System.EventHandler(this.NewItemDialog_Load); 149 this.Shown += new System.EventHandler(this.NewItemDialog_Shown); 70 150 this.ResumeLayout(false); 151 this.PerformLayout(); 71 152 72 153 } … … 76 157 private System.Windows.Forms.Button okButton; 77 158 private System.Windows.Forms.Button cancelButton; 159 private System.Windows.Forms.ListView itemsListView; 160 private System.Windows.Forms.Label itemsLabel; 161 private System.Windows.Forms.CheckBox showIconsCheckBox; 162 private System.Windows.Forms.CheckBox showDetailsCheckBox; 163 private System.Windows.Forms.ToolTip toolTip; 164 private System.Windows.Forms.ColumnHeader nameColumnHeader; 165 private System.Windows.Forms.ColumnHeader descriptioncolumnHeader; 78 166 } 79 167 } -
trunk/sources/HeuristicLab.Optimizer/3.3/NewItemDialog.cs
r2537 r2546 7 7 using System.Text; 8 8 using System.Windows.Forms; 9 using HeuristicLab.PluginInfrastructure; 10 using HeuristicLab.Common.Resources; 11 using HeuristicLab.Core; 9 12 10 13 namespace HeuristicLab.Optimizer { 11 public partial class NewDialog : Form { 12 private Type newItemType; 13 public Type NewItemType { 14 get { return newItemType; } 14 internal partial class NewItemDialog : Form { 15 private bool initialized; 16 private List<IItem> items; 17 18 private IItem item; 19 public IItem Item { 20 get { return item; } 15 21 } 16 22 17 public NewDialog() { 23 public NewItemDialog() { 24 initialized = false; 25 items = new List<IItem>(); 26 item = null; 18 27 InitializeComponent(); 19 newItemType = null; 28 } 29 30 private void NewItemDialog_Load(object sender, EventArgs e) { 31 if (!initialized) { 32 SetListViewDisplayStyleCheckBoxes(); 33 34 DiscoveryService ds = new DiscoveryService(); 35 var categories = from t in ds.GetTypes(typeof(IItem)) 36 where CreatableAttribute.IsCreatable(t) 37 orderby CreatableAttribute.GetCategory(t), ItemAttribute.GetName(t) ascending 38 group t by CreatableAttribute.GetCategory(t) into c 39 select c; 40 41 itemsListView.SmallImageList = new ImageList(); 42 foreach (var category in categories) { 43 ListViewGroup group = new ListViewGroup(category.Key); 44 itemsListView.Groups.Add(group); 45 foreach (var creatable in category) { 46 IItem i = (IItem)Activator.CreateInstance(creatable); 47 items.Add(i); 48 ListViewItem item = new ListViewItem(new string[] { i.Name, i.Description}, group); 49 itemsListView.SmallImageList.Images.Add(i.Image); 50 item.ImageIndex = itemsListView.SmallImageList.Images.Count - 1; 51 item.Tag = i; 52 itemsListView.Items.Add(item); 53 } 54 } 55 initialized = true; 56 } 57 } 58 59 private void NewItemDialog_Shown(object sender, EventArgs e) { 60 item = null; 61 } 62 63 private void itemTypesListView_SelectedIndexChanged(object sender, EventArgs e) { 64 okButton.Enabled = itemsListView.SelectedItems.Count == 1; 65 } 66 67 private void okButton_Click(object sender, EventArgs e) { 68 if (itemsListView.SelectedItems.Count == 1) { 69 item = (IItem)((IItem)itemsListView.SelectedItems[0].Tag).Clone(); 70 DialogResult = DialogResult.OK; 71 Close(); 72 } 73 } 74 private void itemTypesListView_DoubleClick(object sender, EventArgs e) { 75 if (itemsListView.SelectedItems.Count == 1) { 76 item = (IItem)((IItem)itemsListView.SelectedItems[0].Tag).Clone(); 77 DialogResult = DialogResult.OK; 78 Close(); 79 } 80 } 81 82 private void showIconsCheckBox_Click(object sender, EventArgs e) { 83 itemsListView.View = View.SmallIcon; 84 SetListViewDisplayStyleCheckBoxes(); 85 } 86 private void showDetailsCheckBox_Click(object sender, EventArgs e) { 87 itemsListView.View = View.Details; 88 SetListViewDisplayStyleCheckBoxes(); 89 for (int i = 0; i < itemsListView.Columns.Count; i++) 90 itemsListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 91 } 92 private void SetListViewDisplayStyleCheckBoxes() { 93 showIconsCheckBox.Checked = itemsListView.View == View.SmallIcon; 94 showDetailsCheckBox.Checked = itemsListView.View == View.Details; 20 95 } 21 96 } -
trunk/sources/HeuristicLab.Optimizer/3.3/NewItemDialog.resx
r2537 r2546 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 121 <data name="showIconsCheckBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> 122 <value> 123 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 124 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAHdJREFUOE9j/P// 125 PwOlAGQCJZjhP5dKFlkYajFFtoP9DwwG8gDcBTDtDAwNQBMhmBiA1QCQRmINwWkAzBBCLsPrBWRvwNjo 126 LsMwAJe/sRkGcSU4BhGxgJ6gsHkB1TA0A4gJeWQ1JHgBNbEhXEYtF1CUmUCBSQkGALV/aRnqsiFZAAAA 127 AElFTkSuQmCC 128 </value> 129 </data> 130 <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 131 <value>17, 17</value> 132 </metadata> 133 <data name="showDetailsCheckBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> 134 <value> 135 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 136 YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAF5JREFUOE9j/P// 137 PwOlAGQCJZjhP5dKFlkYajFFtoP9DwwG8gDcBdi0I4cLSB6djyRGRRcwMDQAbSKMYS7G6wViQgXDAJDt 138 aKaD/U7fMBhYFxATcMhqqJOUQYmMEgwAizNpEwxYZgUAAAAASUVORK5CYII= 139 </value> 140 </data> 120 141 </root> -
trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems/NewToolBarItem.cs
r2520 r2546 10 10 11 11 namespace HeuristicLab.Optimizer { 12 publicclass NewToolBarItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, IOptimizerUserInterfaceItemProvider {12 internal class NewToolBarItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, IOptimizerUserInterfaceItemProvider { 13 13 public override string Name { 14 14 get { return "New..."; } 15 15 } 16 17 16 public override string ToolTipText { 18 17 get { return "New Item (Ctrl + N)"; } 19 18 } 20 21 19 public override int Position { 22 20 get { return 10; } 23 21 } 24 25 22 public override Image Image { 26 23 get { return Resources.NewIcon; } … … 28 25 29 26 public override void Execute() { 30 Actions.NewAction.Execute();27 FileManager.New(); 31 28 } 32 29 } -
trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems/OpenToolBarItem.cs
r2520 r2546 10 10 11 11 namespace HeuristicLab.Optimizer { 12 publicclass OpenToolBarItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, IOptimizerUserInterfaceItemProvider {12 internal class OpenToolBarItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, IOptimizerUserInterfaceItemProvider { 13 13 public override string Name { 14 14 get { return "Open..."; } 15 15 } 16 17 16 public override string ToolTipText { 18 17 get { return "Open File (Ctrl + O)"; } 19 18 } 20 21 19 public override int Position { 22 20 get { return 20; } 23 21 } 24 25 22 public override Image Image { 26 23 get { return Resources.OpenIcon; } … … 28 25 29 26 public override void Execute() { 30 Actions.OpenAction.Execute();27 FileManager.Open(); 31 28 } 32 29 } -
trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems/SaveAllToolBarItem.cs
r2520 r2546 10 10 11 11 namespace HeuristicLab.Optimizer { 12 publicclass SaveAllToolBarItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, IOptimizerUserInterfaceItemProvider {12 internal class SaveAllToolBarItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, IOptimizerUserInterfaceItemProvider { 13 13 public override string Name { 14 14 get { return "Save All"; } 15 15 } 16 17 16 public override string ToolTipText { 18 17 get { return "Save All Files"; } 19 18 } 20 21 19 public override int Position { 22 20 get { return 40; } 23 21 } 24 25 22 public override Image Image { 26 23 get { return Resources.SaveAllIcon; } 27 24 } 28 25 26 public override void MainFormInitialized(object sender, EventArgs e) { 27 ToolStripItem.Enabled = false; 28 } 29 public override void ActiveViewChanged(object sender, EventArgs e) { 30 ToolStripItem.Enabled = MainFormManager.MainForm.Views.FirstOrDefault() != null; 31 } 32 29 33 public override void Execute() { 30 Actions.SaveAllAction.Execute();34 FileManager.SaveAll(); 31 35 } 32 36 } -
trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems/SaveToolBarItem.cs
r2520 r2546 8 8 using HeuristicLab.MainForm.WindowsForms; 9 9 using HeuristicLab.Common.Resources; 10 using HeuristicLab.Core; 11 using HeuristicLab.Core.Views; 10 12 11 13 namespace HeuristicLab.Optimizer { 12 publicclass SaveToolBarItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, IOptimizerUserInterfaceItemProvider {14 internal class SaveToolBarItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, IOptimizerUserInterfaceItemProvider { 13 15 public override string Name { 14 16 get { return "Save"; } 15 17 } 16 17 18 public override string ToolTipText { 18 19 get { return "Save File (Ctrl + S)"; } 19 20 } 20 21 21 public override int Position { 22 22 get { return 30; } 23 23 } 24 25 24 public override Image Image { 26 25 get { return Resources.SaveIcon; } 27 26 } 28 27 28 public override void MainFormInitialized(object sender, EventArgs e) { 29 ToolStripItem.Enabled = false; 30 } 31 public override void ActiveViewChanged(object sender, EventArgs e) { 32 IItemView activeView = MainFormManager.MainForm.ActiveView as IItemView; 33 ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Item.GetType()))); 34 } 35 29 36 public override void Execute() { 30 Actions.SaveAction.Execute();37 FileManager.Save(); 31 38 } 32 39 }
Note: See TracChangeset
for help on using the changeset viewer.