- Timestamp:
- 11/19/09 18:13:55 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 added
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.Test/3.2/ButtonItems/OpenToolStripButtonItem.cs
r2458 r2514 6 6 7 7 namespace HeuristicLab.MainForm.Test { 8 public class OpenToolStripButtonItem : ToolBarItemBase, ITestUserInterfaceItemProvider {8 public class OpenToolStripButtonItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, ITestUserInterfaceItemProvider { 9 9 public override int Position { 10 10 get { return 20; } -
trunk/sources/HeuristicLab.MainForm.Test/3.2/ButtonItems/SeparatorToolStripButtonItem.cs
r2504 r2514 6 6 7 7 namespace HeuristicLab.MainForm.Test { 8 public class NewToolStripButtonItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, ITestUserInterfaceItemProvider {8 public class SeparatorToolStripButtonItem : ToolBarSeparatorItemBase, ITestUserInterfaceItemProvider { 9 9 public override int Position { 10 get { return 10; } 11 } 12 13 public override string Name { 14 get { return "New"; } 15 } 16 17 public override bool IsDropDownButton { 18 get { return true; } 19 } 20 21 public override System.Drawing.Image Image { 22 get { return HeuristicLab.Common.Resources.Resources.NewIcon; } 23 } 24 25 public override void Execute() { 10 get { return 15; } 26 11 } 27 12 } -
trunk/sources/HeuristicLab.MainForm.Test/3.2/HeuristicLab.MainForm.Test-3.2.csproj
r2499 r2514 83 83 <ItemGroup> 84 84 <Compile Include="Actions\NewEditorAction.cs" /> 85 <Compile Include="ButtonItems\SeparatorToolStripButtonItem.cs" /> 85 86 <Compile Include="ButtonItems\NewEditorToolStripButtonItem.cs" /> 86 87 <Compile Include="ButtonItems\NewFormToolStripButtonItem.cs" /> … … 107 108 <DependentUpon>FormView.cs</DependentUpon> 108 109 </Compile> 110 <Compile Include="MenuItems\SeparatorMenuItem.cs" /> 109 111 <Compile Include="MenuItems\ExitToolStripMenuItem.cs" /> 110 112 <Compile Include="MenuItems\NewFormToolStripMenuItem.cs" /> -
trunk/sources/HeuristicLab.MainForm.Test/3.2/MenuItems/SeparatorMenuItem.cs
r2504 r2514 9 9 10 10 namespace HeuristicLab.MainForm.Test { 11 public class NewFormToolStripMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, ITestUserInterfaceItemProvider { 12 public override string Name { 13 get { return "Form"; } 14 } 15 11 public class SeparatorMenuItem : MenuSeparatorItemBase, ITestUserInterfaceItemProvider { 16 12 public override IEnumerable<string> Structure { 17 get { return "File/New".Split('/'); }13 get { return new string[] { "File" }; } 18 14 } 19 15 20 16 public override int Position { 21 get { return 1110; } 22 23 } 17 get { return 1120; } 24 18 25 public override void Execute() {26 new NewFormAction().Execute(MainFormManager.MainForm);27 19 } 28 20 } -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MainFormBase.cs
r2469 r2514 207 207 208 208 object[] items = ds.GetInstances(userInterfaceItemType); 209 IEnumerable< MenuItemBase> toolStripMenuItems =209 IEnumerable<IMenuItem> toolStripMenuItems = 210 210 from mi in items 211 where mi is MenuItemBase212 orderby (( MenuItemBase)mi).Position213 select ( MenuItemBase)mi;214 foreach ( MenuItemBasemenuItem in toolStripMenuItems)211 where mi is IMenuItem 212 orderby ((IMenuItem)mi).Position 213 select (IMenuItem)mi; 214 foreach (IMenuItem menuItem in toolStripMenuItems) 215 215 AddToolStripMenuItem(menuItem); 216 216 217 217 items = ds.GetInstances(userInterfaceItemType); 218 IEnumerable< ToolBarItemBase> toolStripButtonItems =218 IEnumerable<IToolBarItem> toolStripButtonItems = 219 219 from bi in items 220 where bi is ToolBarItemBase221 orderby (( ToolBarItemBase)bi).Position222 select ( ToolBarItemBase)bi;223 foreach ( ToolBarItemBasetoolStripButtonItem in toolStripButtonItems)220 where bi is IToolBarItem 221 orderby ((IToolBarItem)bi).Position 222 select (IToolBarItem)bi; 223 foreach (IToolBarItem toolStripButtonItem in toolStripButtonItems) 224 224 AddToolStripButtonItem(toolStripButtonItem); 225 225 } 226 226 227 private void AddToolStripMenuItem(MenuItemBase menuItem) { 228 ToolStripMenuItem item = new ToolStripMenuItem(); 229 SetToolStripItemProperties(item, menuItem); 230 menuItem.ToolStripItem = item; 231 item.ShortcutKeys = menuItem.ShortCutKeys; 232 item.DisplayStyle = menuItem.ToolStripItemDisplayStyle; 233 this.InsertItem(menuItem.Structure, typeof(ToolStripMenuItem), item, menuStrip.Items); 234 } 235 236 private void AddToolStripButtonItem(ToolBarItemBase buttonItem) { 237 ToolStripItem item; 238 if (buttonItem.IsDropDownButton) 239 item = new ToolStripDropDownButton(); 240 else 241 item = new ToolStripButton(); 242 243 SetToolStripItemProperties(item, buttonItem); 244 item.DisplayStyle = buttonItem.ToolStripItemDisplayStyle; 245 buttonItem.ToolStripItem = item; 227 private void AddToolStripMenuItem(IMenuItem menuItem) { 228 if (menuItem is MenuItemBase) { 229 ToolStripMenuItem item = new ToolStripMenuItem(); 230 SetToolStripItemProperties(item, menuItem); 231 ((MenuItemBase)menuItem).ToolStripItem = item; 232 item.ShortcutKeys = ((MenuItemBase)menuItem).ShortCutKeys; 233 item.DisplayStyle = ((MenuItemBase)menuItem).ToolStripItemDisplayStyle; 234 this.InsertItem(menuItem.Structure, typeof(ToolStripMenuItem), item, menuStrip.Items); 235 } else if (menuItem is MenuSeparatorItemBase) { 236 this.InsertItem(menuItem.Structure, typeof(ToolStripMenuItem), new ToolStripSeparator(), menuStrip.Items); 237 } 238 } 239 240 private void AddToolStripButtonItem(IToolBarItem buttonItem) { 241 ToolStripItem item = null; 242 243 if (buttonItem is ToolBarItemBase) { 244 if (((ToolBarItemBase)buttonItem).IsDropDownButton) 245 item = new ToolStripDropDownButton(); 246 else 247 item = new ToolStripButton(); 248 249 SetToolStripItemProperties(item, buttonItem); 250 item.DisplayStyle = ((ToolBarItemBase)buttonItem).ToolStripItemDisplayStyle; 251 ((ToolBarItemBase)buttonItem).ToolStripItem = item; 252 } else if (buttonItem is IToolBarSeparatorItem) 253 item = new ToolStripSeparator(); 254 246 255 this.InsertItem(buttonItem.Structure, typeof(ToolStripDropDownButton), item, toolStrip.Items); 247 256 } -
trunk/sources/HeuristicLab.MainForm/3.2/HeuristicLab.MainForm-3.2.csproj
r2466 r2514 81 81 </ItemGroup> 82 82 <ItemGroup> 83 <Compile Include="ToolBarSeparatorItemBase.cs" /> 84 <Compile Include="Interfaces\IToolBarSeparatorItem.cs" /> 83 85 <Compile Include="Interfaces\IMenuItem.cs" /> 86 <Compile Include="Interfaces\IMenuSeparatorItem.cs" /> 84 87 <Compile Include="Interfaces\IToolBarItem.cs" /> 85 88 <Compile Include="MainFormManager.cs" /> 86 89 <Compile Include="MenuItemBase.cs" /> 90 <Compile Include="MenuSeparatorItemBase.cs" /> 87 91 <Compile Include="ToolBarItemBase.cs" /> 88 92 <Compile Include="HeuristicLabMainFormPlugin.cs" />
Note: See TracChangeset
for help on using the changeset viewer.