Changeset 2790 for trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems
- Timestamp:
- 02/13/10 04:37:49 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CloseAllMenuItem.cs
r2713 r2790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; 4 using System.Text;5 25 using System.Windows.Forms; 6 using System.Drawing;7 26 using HeuristicLab.MainForm; 8 using HeuristicLab.MainForm.WindowsForms;9 using HeuristicLab.Common.Resources;10 27 11 28 namespace HeuristicLab.Optimizer.MenuItems { -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CloseMenuItem.cs
r2713 r2790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 using System.Linq;4 using System.Text;5 24 using System.Windows.Forms; 6 using System.Drawing;7 25 using HeuristicLab.MainForm; 8 using HeuristicLab.MainForm.WindowsForms;9 using HeuristicLab.Common.Resources;10 26 11 27 namespace HeuristicLab.Optimizer.MenuItems { -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/ExitMenuItem.cs
r2713 r2790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 2 22 using System.Collections.Generic; 3 using System.Linq;4 using System.Text;5 23 using System.Windows.Forms; 6 using System.Drawing;7 24 using HeuristicLab.MainForm; 8 using HeuristicLab.MainForm.WindowsForms;9 using HeuristicLab.Common.Resources;10 25 11 26 namespace HeuristicLab.Optimizer.MenuItems { -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/NewMenuItem.cs
r2713 r2790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 2 22 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 23 using System.Drawing; 5 24 using System.Windows.Forms; 6 using System.Drawing;7 using HeuristicLab.MainForm.WindowsForms;8 25 using HeuristicLab.Common.Resources; 9 26 -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/OpenMenuItem.cs
r2713 r2790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 2 22 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 23 using System.Drawing; 5 24 using System.Windows.Forms; 6 using System.Drawing;7 using HeuristicLab.MainForm.WindowsForms;8 25 using HeuristicLab.Common.Resources; 9 26 -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/OperatorsMenuItem.cs
r2713 r2790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; 4 using System.Text;5 25 using System.Windows.Forms; 6 using System.Drawing;26 using HeuristicLab.Core.Views; 7 27 using HeuristicLab.MainForm; 8 using HeuristicLab.MainForm.WindowsForms;9 using HeuristicLab.Common.Resources;10 using HeuristicLab.Core;11 using HeuristicLab.Core.Views;12 28 13 29 namespace HeuristicLab.Optimizer.MenuItems { 14 30 internal class OperatorsMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider { 15 private OperatorsSidebar view;16 31 private ToolStripMenuItem menuItem; 17 32 … … 27 42 28 43 protected override void OnToolStripItemSet(EventArgs e) { 29 view = new OperatorsSidebar(); 30 view.Dock = DockStyle.Left; 44 MainFormManager.MainForm.ViewShown += new EventHandler<ViewShownEventArgs>(MainForm_ViewShown); 31 45 MainFormManager.MainForm.ViewHidden += new EventHandler<ViewEventArgs>(MainForm_ViewHidden); 32 46 33 47 menuItem = ToolStripItem as ToolStripMenuItem; 34 if (menuItem != null) { 35 menuItem.Checked = true; 48 if (menuItem != null) 36 49 menuItem.CheckOnClick = true; 37 }38 view.Show();39 50 } 40 51 52 private void MainForm_ViewShown(object sender, ViewShownEventArgs e) { 53 if ((e.View is OperatorsSidebar) && (menuItem != null)) 54 menuItem.Checked = true; 55 } 41 56 private void MainForm_ViewHidden(object sender, ViewEventArgs e) { 42 if ((e.View == view) && (menuItem != null))57 if ((e.View is OperatorsSidebar) && (menuItem != null)) 43 58 menuItem.Checked = false; 44 59 } 45 60 46 61 public override void Execute() { 47 if (menuItem != null) {48 if (menuItem.Checked)49 view.Show();50 else51 52 } else {62 var view = (from v in MainFormManager.MainForm.Views 63 where v is OperatorsSidebar 64 select v as OperatorsSidebar).FirstOrDefault(); 65 if (view.IsShown) 66 view.Hide(); 67 else 53 68 view.Show(); 54 }55 69 } 56 70 } -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAllMenuItem.cs
r2713 r2790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 24 using System.Drawing; 3 25 using System.Linq; 4 using System.Text;5 26 using System.Windows.Forms; 6 using System.Drawing;7 using HeuristicLab.MainForm;8 using HeuristicLab.MainForm.WindowsForms;9 27 using HeuristicLab.Common.Resources; 10 28 using HeuristicLab.Core; 11 using HeuristicLab. Core.Views;29 using HeuristicLab.MainForm; 12 30 13 31 namespace HeuristicLab.Optimizer.MenuItems { -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAsMenuItem.cs
r2713 r2790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 using System.Linq;4 using System.Text;5 24 using System.Windows.Forms; 6 using System.Drawing;25 using HeuristicLab.Core; 7 26 using HeuristicLab.MainForm; 8 using HeuristicLab.MainForm.WindowsForms;9 using HeuristicLab.Common.Resources;10 using HeuristicLab.Core;11 using HeuristicLab.Core.Views;12 27 13 28 namespace HeuristicLab.Optimizer.MenuItems { -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveMenuItem.cs
r2713 r2790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 24 using System.Drawing; 5 25 using System.Windows.Forms; 6 using System.Drawing;7 using HeuristicLab.MainForm;8 using HeuristicLab.MainForm.WindowsForms;9 26 using HeuristicLab.Common.Resources; 10 27 using HeuristicLab.Core; 11 using HeuristicLab. Core.Views;28 using HeuristicLab.MainForm; 12 29 13 30 namespace HeuristicLab.Optimizer.MenuItems { -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/Separators.cs
r2708 r2790 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 2 22 using System.Collections.Generic; 3 using System.Linq;4 using System.Text;5 using System.Windows.Forms;6 using System.Drawing;7 23 using HeuristicLab.MainForm; 8 using HeuristicLab.MainForm.WindowsForms;9 using HeuristicLab.Common.Resources;10 24 11 25 namespace HeuristicLab.Optimizer.MenuItems {
Note: See TracChangeset
for help on using the changeset viewer.