Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/30/10 13:07:31 (15 years ago)
Author:
mkommend
Message:

added Sidebar class and adapted Clipboard and OperatorSidebar (ticket #972)

Location:
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CloseAllMenuItem.cs

    r3498 r3571  
    2525using System.Windows.Forms;
    2626using HeuristicLab.MainForm;
     27using HeuristicLab.MainForm.WindowsForms;
    2728
    2829namespace HeuristicLab.Optimizer.MenuItems {
     
    4243    }
    4344    protected override void OnActiveViewChanged(object sender, EventArgs e) {
    44       ToolStripItem.Enabled = MainFormManager.MainForm.Views.Any<IView>(v => v.IsShown);
     45      ToolStripItem.Enabled = MainFormManager.MainForm.Views.Any<IView>(v => v.IsShown && !(v is Sidebar));
    4546    }
    4647
    4748    public override void Execute() {
    48       MainFormManager.MainForm.CloseAllViews();
     49      foreach (IView view in MainFormManager.MainForm.Views)
     50        if (!(view is Sidebar))
     51          view.Close();
    4952    }
    5053  }
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CloseMenuItem.cs

    r3498 r3571  
    2424using System.Windows.Forms;
    2525using HeuristicLab.MainForm;
     26using HeuristicLab.MainForm.WindowsForms;
    2627
    2728namespace HeuristicLab.Optimizer.MenuItems {
     
    4142    }
    4243    protected override void OnActiveViewChanged(object sender, EventArgs e) {
    43       ToolStripItem.Enabled = MainFormManager.MainForm.ActiveView != null;
     44      IView view = MainFormManager.MainForm.ActiveView;
     45      ToolStripItem.Enabled = !(view is Sidebar);
    4446    }
    4547
    4648    public override void Execute() {
    47       MainFormManager.MainForm.ActiveView.Close();
     49      IView view = MainFormManager.MainForm.ActiveView;
     50      if (!(view is Sidebar))
     51        view.Close();
    4852    }
    4953  }
Note: See TracChangeset for help on using the changeset viewer.