Changeset 3571


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

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

Location:
trunk/sources
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/Clipboard.cs

    r3557 r3571  
    3131namespace HeuristicLab.Core.Views {
    3232  [View("Clipboard")]
    33   public sealed partial class Clipboard<T> : HeuristicLab.MainForm.WindowsForms.View where T : class, IItem {
     33  public sealed partial class Clipboard<T> : HeuristicLab.MainForm.WindowsForms.Sidebar where T : class, IItem {
    3434    private TypeSelectorDialog typeSelectorDialog;
    3535    private Dictionary<T, ListViewItem> itemListViewItemTable;
     
    8282      SetEnabledStateOfControls();
    8383    }
    84     protected override void OnClosing(FormClosingEventArgs e) {
    85       base.OnClosing(e);
    86       if (e.CloseReason == CloseReason.UserClosing) {
    87         e.Cancel = true;
    88         this.Hide();
    89       }
    90     }
    9184
    9285    private void SetEnabledStateOfControls() {
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorsSidebar.cs

    r3190 r3571  
    2626namespace HeuristicLab.Core.Views {
    2727  [View("Operators Sidebar")]
    28   public partial class OperatorsSidebar : HeuristicLab.MainForm.WindowsForms.View {
     28  public partial class OperatorsSidebar : HeuristicLab.MainForm.WindowsForms.Sidebar {
    2929    public OperatorsSidebar() {
    3030      InitializeComponent();
     
    3535      typeSelector.Configure(typeof(IOperator), false, false);
    3636    }
    37     protected override void OnClosing(FormClosingEventArgs e) {
    38       base.OnClosing(e);
    39       if (e.CloseReason == CloseReason.UserClosing) {
    40         e.Cancel = true;
    41         this.Hide();
    42       }
    43     }
    4437  }
    4538}
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/DockForm.cs

    r3437 r3571  
    5353              break;
    5454          }
     55          if (view is Sidebar)
     56            this.DockAreas = DockAreas.DockLeft | DockAreas.DockRight;
     57
    5558          Type viewType = view.GetType();
    5659          Control control = (Control)view;
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/HeuristicLab.MainForm.WindowsForms-3.3.csproj

    r3477 r3571  
    112112      <DependentUpon>DockingMainForm.cs</DependentUpon>
    113113    </Compile>
     114    <Compile Include="Sidebar.cs">
     115      <SubType>UserControl</SubType>
     116    </Compile>
     117    <Compile Include="Sidebar.Designer.cs">
     118      <DependentUpon>Sidebar.cs</DependentUpon>
     119    </Compile>
    114120    <Compile Include="DocumentForm.cs">
    115121      <SubType>Form</SubType>
  • 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.