Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4096


Ignore:
Timestamp:
07/25/10 00:29:17 (14 years ago)
Author:
swagner
Message:

Enabled hiding details in all collection views (#1095)

Location:
trunk/sources
Files:
10 edited

Legend:

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

    r3407 r4096  
    5656      this.components = new System.ComponentModel.Container();
    5757      this.splitContainer = new System.Windows.Forms.SplitContainer();
     58      this.addButton = new System.Windows.Forms.Button();
    5859      this.moveUpButton = new System.Windows.Forms.Button();
     60      this.removeButton = new System.Windows.Forms.Button();
    5961      this.moveDownButton = new System.Windows.Forms.Button();
    6062      this.itemsListView = new System.Windows.Forms.ListView();
    61       this.listViewColumnHeader = new System.Windows.Forms.ColumnHeader();
     63      this.listViewColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
    6264      this.imageList = new System.Windows.Forms.ImageList(this.components);
    6365      this.detailsGroupBox = new System.Windows.Forms.GroupBox();
     
    6567      this.itemsGroupBox = new System.Windows.Forms.GroupBox();
    6668      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    67       this.removeButton = new System.Windows.Forms.Button();
    68       this.addButton = new System.Windows.Forms.Button();
     69      this.showDetailsCheckBox = new System.Windows.Forms.CheckBox();
    6970      this.splitContainer.Panel1.SuspendLayout();
    7071      this.splitContainer.Panel2.SuspendLayout();
     
    8384      // splitContainer.Panel1
    8485      //
     86      this.splitContainer.Panel1.Controls.Add(this.showDetailsCheckBox);
    8587      this.splitContainer.Panel1.Controls.Add(this.addButton);
    8688      this.splitContainer.Panel1.Controls.Add(this.moveUpButton);
     
    9597      this.splitContainer.SplitterDistance = 200;
    9698      this.splitContainer.TabIndex = 0;
     99      //
     100      // addButton
     101      //
     102      this.addButton.Enabled = false;
     103      this.addButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Add;
     104      this.addButton.Location = new System.Drawing.Point(3, 3);
     105      this.addButton.Name = "addButton";
     106      this.addButton.Size = new System.Drawing.Size(24, 24);
     107      this.addButton.TabIndex = 0;
     108      this.toolTip.SetToolTip(this.addButton, "Set");
     109      this.addButton.UseVisualStyleBackColor = true;
     110      this.addButton.Click += new System.EventHandler(this.addButton_Click);
    97111      //
    98112      // moveUpButton
     
    107121      this.moveUpButton.UseVisualStyleBackColor = true;
    108122      this.moveUpButton.Click += new System.EventHandler(this.moveUpButton_Click);
     123      //
     124      // removeButton
     125      //
     126      this.removeButton.Enabled = false;
     127      this.removeButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Remove;
     128      this.removeButton.Location = new System.Drawing.Point(93, 3);
     129      this.removeButton.Name = "removeButton";
     130      this.removeButton.Size = new System.Drawing.Size(24, 24);
     131      this.removeButton.TabIndex = 3;
     132      this.toolTip.SetToolTip(this.removeButton, "Clear");
     133      this.removeButton.UseVisualStyleBackColor = true;
     134      this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
    109135      //
    110136      // moveDownButton
     
    135161      this.itemsListView.Size = new System.Drawing.Size(194, 286);
    136162      this.itemsListView.SmallImageList = this.imageList;
    137       this.itemsListView.TabIndex = 4;
     163      this.itemsListView.TabIndex = 5;
    138164      this.itemsListView.UseCompatibleStateImageBehavior = false;
    139165      this.itemsListView.View = System.Windows.Forms.View.Details;
     166      this.itemsListView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.itemsListView_ItemDrag);
    140167      this.itemsListView.SelectedIndexChanged += new System.EventHandler(this.itemsListView_SelectedIndexChanged);
    141       this.itemsListView.DoubleClick += new System.EventHandler(this.itemsListView_DoubleClick);
    142168      this.itemsListView.DragDrop += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragDrop);
    143169      this.itemsListView.DragEnter += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragEnterOver);
     170      this.itemsListView.DragOver += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragEnterOver);
     171      this.itemsListView.DoubleClick += new System.EventHandler(this.itemsListView_DoubleClick);
    144172      this.itemsListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.itemsListView_KeyDown);
    145       this.itemsListView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.itemsListView_ItemDrag);
    146       this.itemsListView.DragOver += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragEnterOver);
    147173      //
    148174      // imageList
     
    170196                  | System.Windows.Forms.AnchorStyles.Left)
    171197                  | System.Windows.Forms.AnchorStyles.Right)));
     198      this.viewHost.Caption = "View";
    172199      this.viewHost.Content = null;
    173200      this.viewHost.Location = new System.Drawing.Point(6, 19);
    174201      this.viewHost.Name = "viewHost";
     202      this.viewHost.ReadOnly = false;
    175203      this.viewHost.Size = new System.Drawing.Size(271, 269);
    176204      this.viewHost.TabIndex = 0;
     
    188216      this.itemsGroupBox.Text = "Items";
    189217      //
    190       // removeButton
    191       //
    192       this.removeButton.Enabled = false;
    193       this.removeButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Remove;
    194       this.removeButton.Location = new System.Drawing.Point(93, 3);
    195       this.removeButton.Name = "removeButton";
    196       this.removeButton.Size = new System.Drawing.Size(24, 24);
    197       this.removeButton.TabIndex = 3;
    198       this.toolTip.SetToolTip(this.removeButton, "Clear");
    199       this.removeButton.UseVisualStyleBackColor = true;
    200       this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
    201       //
    202       // addButton
    203       //
    204       this.addButton.Enabled = false;
    205       this.addButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Add;
    206       this.addButton.Location = new System.Drawing.Point(3, 3);
    207       this.addButton.Name = "addButton";
    208       this.addButton.Size = new System.Drawing.Size(24, 24);
    209       this.addButton.TabIndex = 0;
    210       this.toolTip.SetToolTip(this.addButton, "Set");
    211       this.addButton.UseVisualStyleBackColor = true;
    212       this.addButton.Click += new System.EventHandler(this.addButton_Click);
     218      // showDetailsCheckBox
     219      //
     220      this.showDetailsCheckBox.Appearance = System.Windows.Forms.Appearance.Button;
     221      this.showDetailsCheckBox.Checked = true;
     222      this.showDetailsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
     223      this.showDetailsCheckBox.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Properties;
     224      this.showDetailsCheckBox.Location = new System.Drawing.Point(123, 3);
     225      this.showDetailsCheckBox.Name = "showDetailsCheckBox";
     226      this.showDetailsCheckBox.Size = new System.Drawing.Size(24, 24);
     227      this.showDetailsCheckBox.TabIndex = 4;
     228      this.toolTip.SetToolTip(this.showDetailsCheckBox, "Show/Hide Details");
     229      this.showDetailsCheckBox.UseVisualStyleBackColor = true;
     230      this.showDetailsCheckBox.CheckedChanged += new System.EventHandler(this.showDetailsCheckBox_CheckedChanged);
    213231      //
    214232      // ItemArrayView
     
    241259    protected Button removeButton;
    242260    protected Button addButton;
     261    protected CheckBox showDetailsCheckBox;
    243262  }
    244263}
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.cs

    r3904 r4096  
    202202      AdjustListViewColumnSizes();
    203203
    204       if (itemsListView.SelectedItems.Count == 1) {
    205         T item = itemsListView.SelectedItems[0].Tag as T;
    206         detailsGroupBox.Enabled = true;
    207         viewHost.Content = item;
    208       } else {
    209         viewHost.Content = null;
    210         detailsGroupBox.Enabled = false;
     204      if (showDetailsCheckBox.Checked) {
     205        if (itemsListView.SelectedItems.Count == 1) {
     206          T item = itemsListView.SelectedItems[0].Tag as T;
     207          detailsGroupBox.Enabled = true;
     208          viewHost.Content = item;
     209        } else {
     210          viewHost.Content = null;
     211          detailsGroupBox.Enabled = false;
     212        }
    211213      }
    212214    }
     
    317319    #endregion
    318320
     321    #region CheckBox Events
     322    protected virtual void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) {
     323      if (showDetailsCheckBox.Checked) {
     324        splitContainer.Panel2Collapsed = false;
     325        detailsGroupBox.Enabled = itemsListView.SelectedItems.Count == 1;
     326        viewHost.Content = itemsListView.SelectedItems.Count == 1 ? (T)itemsListView.SelectedItems[0].Tag : null;
     327      } else {
     328        splitContainer.Panel2Collapsed = true;
     329        viewHost.Content = null;
     330        viewHost.ClearCache();
     331      }
     332    }
     333    #endregion
     334
    319335    #region Content Events
    320336    protected virtual void Content_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<T>> e) {
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.Designer.cs

    r4068 r4096  
    5656      this.splitContainer = new System.Windows.Forms.SplitContainer();
    5757      this.itemsListView = new System.Windows.Forms.ListView();
    58       this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
     58      this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
    5959      this.imageList = new System.Windows.Forms.ImageList(this.components);
    6060      this.sortDescendingButton = new System.Windows.Forms.Button();
     
    6666      this.itemsGroupBox = new System.Windows.Forms.GroupBox();
    6767      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     68      this.showDetailsCheckBox = new System.Windows.Forms.CheckBox();
    6869      this.splitContainer.Panel1.SuspendLayout();
    6970      this.splitContainer.Panel2.SuspendLayout();
     
    8283      // splitContainer.Panel1
    8384      //
     85      this.splitContainer.Panel1.Controls.Add(this.showDetailsCheckBox);
    8486      this.splitContainer.Panel1.Controls.Add(this.itemsListView);
    8587      this.splitContainer.Panel1.Controls.Add(this.sortDescendingButton);
     
    111113      this.itemsListView.Size = new System.Drawing.Size(244, 327);
    112114      this.itemsListView.SmallImageList = this.imageList;
    113       this.itemsListView.TabIndex = 4;
     115      this.itemsListView.TabIndex = 5;
    114116      this.itemsListView.UseCompatibleStateImageBehavior = false;
    115117      this.itemsListView.View = System.Windows.Forms.View.Details;
     118      this.itemsListView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.itemsListView_ItemDrag);
    116119      this.itemsListView.SelectedIndexChanged += new System.EventHandler(this.itemsListView_SelectedIndexChanged);
    117       this.itemsListView.DoubleClick += new System.EventHandler(this.itemsListView_DoubleClick);
    118120      this.itemsListView.DragDrop += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragDrop);
    119121      this.itemsListView.DragEnter += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragEnterOver);
     122      this.itemsListView.DragOver += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragEnterOver);
     123      this.itemsListView.DoubleClick += new System.EventHandler(this.itemsListView_DoubleClick);
    120124      this.itemsListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.itemsListView_KeyDown);
    121       this.itemsListView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.itemsListView_ItemDrag);
    122       this.itemsListView.DragOver += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragEnterOver);
    123125      //
    124126      // imageList
     
    193195                  | System.Windows.Forms.AnchorStyles.Left)
    194196                  | System.Windows.Forms.AnchorStyles.Right)));
     197      this.viewHost.Caption = "View";
    195198      this.viewHost.Content = null;
    196199      this.viewHost.Location = new System.Drawing.Point(6, 19);
    197200      this.viewHost.Name = "viewHost";
     201      this.viewHost.ReadOnly = false;
    198202      this.viewHost.Size = new System.Drawing.Size(254, 310);
    199203      this.viewHost.TabIndex = 0;
     204      this.viewHost.ViewType = null;
    200205      //
    201206      // itemsGroupBox
     
    209214      this.itemsGroupBox.TabStop = false;
    210215      this.itemsGroupBox.Text = "Items";
     216      //
     217      // showDetailsCheckBox
     218      //
     219      this.showDetailsCheckBox.Appearance = System.Windows.Forms.Appearance.Button;
     220      this.showDetailsCheckBox.Checked = true;
     221      this.showDetailsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
     222      this.showDetailsCheckBox.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Properties;
     223      this.showDetailsCheckBox.Location = new System.Drawing.Point(123, 3);
     224      this.showDetailsCheckBox.Name = "showDetailsCheckBox";
     225      this.showDetailsCheckBox.Size = new System.Drawing.Size(24, 24);
     226      this.showDetailsCheckBox.TabIndex = 4;
     227      this.toolTip.SetToolTip(this.showDetailsCheckBox, "Show/Hide Details");
     228      this.showDetailsCheckBox.UseVisualStyleBackColor = true;
     229      this.showDetailsCheckBox.CheckedChanged += new System.EventHandler(this.showDetailsCheckBox_CheckedChanged);
    211230      //
    212231      // ItemCollectionView
     
    239258    protected Button sortAscendingButton;
    240259    protected Button sortDescendingButton;
     260    protected CheckBox showDetailsCheckBox;
    241261  }
    242262}
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs

    r4068 r4096  
    158158      removeButton.Enabled = (Content != null) && !Content.IsReadOnly && !ReadOnly && itemsListView.SelectedItems.Count > 0;
    159159      AdjustListViewColumnSizes();
    160       if (itemsListView.SelectedItems.Count == 1) {
    161         T item = (T)itemsListView.SelectedItems[0].Tag;
    162         detailsGroupBox.Enabled = true;
    163         viewHost.Content = item;
    164       } else {
    165         viewHost.Content = null;
    166         detailsGroupBox.Enabled = false;
     160      if (showDetailsCheckBox.Checked) {
     161        if (itemsListView.SelectedItems.Count == 1) {
     162          T item = (T)itemsListView.SelectedItems[0].Tag;
     163          detailsGroupBox.Enabled = true;
     164          viewHost.Content = item;
     165        } else {
     166          viewHost.Content = null;
     167          detailsGroupBox.Enabled = false;
     168        }
    167169      }
    168170    }
     
    242244    #endregion
    243245
     246    #region CheckBox Events
     247    protected virtual void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) {
     248      if (showDetailsCheckBox.Checked) {
     249        splitContainer.Panel2Collapsed = false;
     250        detailsGroupBox.Enabled = itemsListView.SelectedItems.Count == 1;
     251        viewHost.Content = itemsListView.SelectedItems.Count == 1 ? (T)itemsListView.SelectedItems[0].Tag : null;
     252      } else {
     253        splitContainer.Panel2Collapsed = true;
     254        viewHost.Content = null;
     255        viewHost.ClearCache();
     256      }
     257    }
     258    #endregion
     259
    244260    #region Content Events
    245261    protected virtual void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<T> e) {
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.Designer.cs

    r4069 r4096  
    106106      this.showDetailsCheckBox.Name = "showDetailsCheckBox";
    107107      this.showDetailsCheckBox.Size = new System.Drawing.Size(24, 24);
    108       this.showDetailsCheckBox.TabIndex = 5;
     108      this.showDetailsCheckBox.TabIndex = 4;
    109109      this.toolTip.SetToolTip(this.showDetailsCheckBox, "Show/Hide Details");
    110110      this.showDetailsCheckBox.UseVisualStyleBackColor = true;
     
    162162      this.itemsListView.Size = new System.Drawing.Size(194, 286);
    163163      this.itemsListView.SmallImageList = this.imageList;
    164       this.itemsListView.TabIndex = 4;
     164      this.itemsListView.TabIndex = 5;
    165165      this.itemsListView.UseCompatibleStateImageBehavior = false;
    166166      this.itemsListView.View = System.Windows.Forms.View.Details;
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.cs

    r4069 r4096  
    304304
    305305    #region CheckBox Events
    306     private class DummyContent : HeuristicLab.Common.IContent { }
    307     protected void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) {
     306    protected virtual void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) {
    308307      if (showDetailsCheckBox.Checked) {
    309308        splitContainer.Panel2Collapsed = false;
     
    312311      } else {
    313312        splitContainer.Panel2Collapsed = true;
    314         viewHost.Content = new DummyContent();
     313        viewHost.Content = null;
     314        viewHost.ClearCache();
    315315      }
    316316    }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.Designer.cs

    r4068 r4096  
    5454      this.components = new System.ComponentModel.Container();
    5555      this.splitContainer = new System.Windows.Forms.SplitContainer();
     56      this.showDetailsCheckBox = new System.Windows.Forms.CheckBox();
     57      this.clearButton = new System.Windows.Forms.Button();
    5658      this.toolStrip = new System.Windows.Forms.ToolStrip();
    5759      this.analyzeRunsToolStripDropDownButton = new System.Windows.Forms.ToolStripDropDownButton();
    5860      this.itemsListView = new System.Windows.Forms.ListView();
    59       this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
     61      this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
    6062      this.imageList = new System.Windows.Forms.ImageList(this.components);
    6163      this.removeButton = new System.Windows.Forms.Button();
     
    6769      this.runPage = new System.Windows.Forms.TabPage();
    6870      this.constraintPage = new System.Windows.Forms.TabPage();
    69       this.runCollectionConstraintCollectionView = new RunCollectionConstraintCollectionView();
    70       this.clearButton = new System.Windows.Forms.Button();
     71      this.runCollectionConstraintCollectionView = new HeuristicLab.Optimization.Views.RunCollectionConstraintCollectionView();
    7172      this.splitContainer.Panel1.SuspendLayout();
    7273      this.splitContainer.Panel2.SuspendLayout();
     
    8990      // splitContainer.Panel1
    9091      //
     92      this.splitContainer.Panel1.Controls.Add(this.showDetailsCheckBox);
    9193      this.splitContainer.Panel1.Controls.Add(this.clearButton);
    9294      this.splitContainer.Panel1.Controls.Add(this.toolStrip);
     
    101103      this.splitContainer.SplitterDistance = 250;
    102104      this.splitContainer.TabIndex = 0;
     105      //
     106      // showDetailsCheckBox
     107      //
     108      this.showDetailsCheckBox.Appearance = System.Windows.Forms.Appearance.Button;
     109      this.showDetailsCheckBox.Checked = true;
     110      this.showDetailsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
     111      this.showDetailsCheckBox.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Properties;
     112      this.showDetailsCheckBox.Location = new System.Drawing.Point(87, 3);
     113      this.showDetailsCheckBox.Name = "showDetailsCheckBox";
     114      this.showDetailsCheckBox.Size = new System.Drawing.Size(24, 24);
     115      this.showDetailsCheckBox.TabIndex = 2;
     116      this.toolTip.SetToolTip(this.showDetailsCheckBox, "Show/Hide Details");
     117      this.showDetailsCheckBox.UseVisualStyleBackColor = true;
     118      this.showDetailsCheckBox.CheckedChanged += new System.EventHandler(this.showDetailsCheckBox_CheckedChanged);
     119      //
     120      // clearButton
     121      //
     122      this.clearButton.Enabled = false;
     123      this.clearButton.Location = new System.Drawing.Point(33, 3);
     124      this.clearButton.Name = "clearButton";
     125      this.clearButton.Size = new System.Drawing.Size(48, 24);
     126      this.clearButton.TabIndex = 1;
     127      this.clearButton.Text = "&Clear";
     128      this.toolTip.SetToolTip(this.clearButton, "Remove All Runs");
     129      this.clearButton.UseVisualStyleBackColor = true;
     130      this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
    103131      //
    104132      // toolStrip
     
    111139      this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
    112140            this.analyzeRunsToolStripDropDownButton});
    113       this.toolStrip.Location = new System.Drawing.Point(30, 3);
     141      this.toolStrip.Location = new System.Drawing.Point(114, 3);
    114142      this.toolStrip.Name = "toolStrip";
    115       this.toolStrip.Size = new System.Drawing.Size(166, 24);
    116       this.toolStrip.TabIndex = 1;
     143      this.toolStrip.Size = new System.Drawing.Size(133, 24);
     144      this.toolStrip.TabIndex = 3;
    117145      this.toolStrip.Text = "toolStrip1";
    118146      //
     
    141169      this.itemsListView.Size = new System.Drawing.Size(244, 295);
    142170      this.itemsListView.SmallImageList = this.imageList;
    143       this.itemsListView.TabIndex = 3;
     171      this.itemsListView.TabIndex = 4;
    144172      this.itemsListView.UseCompatibleStateImageBehavior = false;
    145173      this.itemsListView.View = System.Windows.Forms.View.Details;
     174      this.itemsListView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.itemsListView_ItemDrag);
    146175      this.itemsListView.SelectedIndexChanged += new System.EventHandler(this.itemsListView_SelectedIndexChanged);
    147       this.itemsListView.DoubleClick += new System.EventHandler(this.itemsListView_DoubleClick);
    148176      this.itemsListView.DragDrop += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragDrop);
    149177      this.itemsListView.DragEnter += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragEnterOver);
     178      this.itemsListView.DragOver += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragEnterOver);
     179      this.itemsListView.DoubleClick += new System.EventHandler(this.itemsListView_DoubleClick);
    150180      this.itemsListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.itemsListView_KeyDown);
    151       this.itemsListView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.itemsListView_ItemDrag);
    152       this.itemsListView.DragOver += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragEnterOver);
    153181      //
    154182      // imageList
     
    188216                  | System.Windows.Forms.AnchorStyles.Left)
    189217                  | System.Windows.Forms.AnchorStyles.Right)));
     218      this.viewHost.Caption = "View";
    190219      this.viewHost.Content = null;
    191220      this.viewHost.Location = new System.Drawing.Point(6, 19);
     
    242271      // runCollectionConstraintCollectionView
    243272      //
     273      this.runCollectionConstraintCollectionView.Caption = "ConstraintCollection View";
    244274      this.runCollectionConstraintCollectionView.Content = null;
    245275      this.runCollectionConstraintCollectionView.Dock = System.Windows.Forms.DockStyle.Fill;
     
    249279      this.runCollectionConstraintCollectionView.Size = new System.Drawing.Size(518, 351);
    250280      this.runCollectionConstraintCollectionView.TabIndex = 0;
    251       //
    252       // clearButton
    253       //
    254       this.clearButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    255       this.clearButton.Enabled = false;
    256       this.clearButton.Location = new System.Drawing.Point(199, 3);
    257       this.clearButton.Name = "clearButton";
    258       this.clearButton.Size = new System.Drawing.Size(48, 24);
    259       this.clearButton.TabIndex = 2;
    260       this.clearButton.Text = "&Clear";
    261       this.toolTip.SetToolTip(this.clearButton, "Remove All Runs");
    262       this.clearButton.UseVisualStyleBackColor = true;
    263       this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
    264281      //
    265282      // RunCollectionView
     
    301318    protected RunCollectionConstraintCollectionView runCollectionConstraintCollectionView;
    302319    protected Button clearButton;
     320    protected CheckBox showDetailsCheckBox;
    303321  }
    304322}
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs

    r4068 r4096  
    187187      removeButton.Enabled = itemsListView.SelectedItems.Count > 0 && (Content != null) && !Content.IsReadOnly && !ReadOnly;
    188188      AdjustListViewColumnSizes();
    189       if (itemsListView.SelectedItems.Count == 1) {
    190         IRun item = (IRun)itemsListView.SelectedItems[0].Tag;
    191         detailsGroupBox.Enabled = true;
    192         viewHost.Content = item;
    193       } else {
    194         viewHost.Content = null;
    195         detailsGroupBox.Enabled = false;
     189      if (showDetailsCheckBox.Checked) {
     190        if (itemsListView.SelectedItems.Count == 1) {
     191          IRun item = (IRun)itemsListView.SelectedItems[0].Tag;
     192          detailsGroupBox.Enabled = true;
     193          viewHost.Content = item;
     194        } else {
     195          viewHost.Content = null;
     196          detailsGroupBox.Enabled = false;
     197        }
    196198      }
    197199    }
     
    272274    #endregion
    273275
     276    #region CheckBox Events
     277    protected virtual void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) {
     278      if (showDetailsCheckBox.Checked) {
     279        splitContainer.Panel2Collapsed = false;
     280        detailsGroupBox.Enabled = itemsListView.SelectedItems.Count == 1;
     281        viewHost.Content = itemsListView.SelectedItems.Count == 1 ? (IRun)itemsListView.SelectedItems[0].Tag : null;
     282      } else {
     283        splitContainer.Panel2Collapsed = true;
     284        viewHost.Content = null;
     285        viewHost.ClearCache();
     286      }
     287    }
     288    #endregion
     289
    274290    #region Content Events
    275291    protected virtual void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRun> e) {
     
    375391  }
    376392}
    377 
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunView.Designer.cs

    r3766 r4096  
    4646    private void InitializeComponent() {
    4747      this.components = new System.ComponentModel.Container();
    48       System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("Results", System.Windows.Forms.HorizontalAlignment.Left);
    49       System.Windows.Forms.ListViewGroup listViewGroup4 = new System.Windows.Forms.ListViewGroup("Parameters", System.Windows.Forms.HorizontalAlignment.Left);
     48      System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Results", System.Windows.Forms.HorizontalAlignment.Left);
     49      System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Parameters", System.Windows.Forms.HorizontalAlignment.Left);
    5050      this.parametersResultsGroupBox = new System.Windows.Forms.GroupBox();
    5151      this.splitContainer = new System.Windows.Forms.SplitContainer();
    5252      this.listView = new System.Windows.Forms.ListView();
    53       this.nameColumnHeader = new System.Windows.Forms.ColumnHeader();
    54       this.valueColumnHeader = new System.Windows.Forms.ColumnHeader();
     53      this.nameColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     54      this.valueColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
    5555      this.imageList = new System.Windows.Forms.ImageList(this.components);
    5656      this.detailsGroupBox = new System.Windows.Forms.GroupBox();
     
    5959      this.changeColorButton = new System.Windows.Forms.Button();
    6060      this.colorLabel = new System.Windows.Forms.Label();
    61       this.colorPictureBox = new System.Windows.Forms.PictureBox();
    6261      this.colorDialog = new System.Windows.Forms.ColorDialog();
     62      this.showDetailsCheckBox = new System.Windows.Forms.CheckBox();
     63      this.colorArea = new System.Windows.Forms.Label();
    6364      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    6465      this.parametersResultsGroupBox.SuspendLayout();
     
    6768      this.splitContainer.SuspendLayout();
    6869      this.detailsGroupBox.SuspendLayout();
    69       ((System.ComponentModel.ISupportInitialize)(this.colorPictureBox)).BeginInit();
    7070      this.SuspendLayout();
    7171      //
     
    8686                  | System.Windows.Forms.AnchorStyles.Right)));
    8787      this.parametersResultsGroupBox.Controls.Add(this.splitContainer);
    88       this.parametersResultsGroupBox.Location = new System.Drawing.Point(0, 79);
     88      this.parametersResultsGroupBox.Location = new System.Drawing.Point(0, 82);
    8989      this.parametersResultsGroupBox.Name = "parametersResultsGroupBox";
    90       this.parametersResultsGroupBox.Size = new System.Drawing.Size(495, 245);
    91       this.parametersResultsGroupBox.TabIndex = 4;
     90      this.parametersResultsGroupBox.Size = new System.Drawing.Size(495, 242);
     91      this.parametersResultsGroupBox.TabIndex = 8;
    9292      this.parametersResultsGroupBox.TabStop = false;
    9393      this.parametersResultsGroupBox.Text = "Parameters && Results";
     
    106106      //
    107107      this.splitContainer.Panel2.Controls.Add(this.detailsGroupBox);
    108       this.splitContainer.Size = new System.Drawing.Size(489, 226);
     108      this.splitContainer.Size = new System.Drawing.Size(489, 223);
    109109      this.splitContainer.SplitterDistance = 177;
    110110      this.splitContainer.TabIndex = 0;
     
    119119            this.valueColumnHeader});
    120120      this.listView.FullRowSelect = true;
    121       listViewGroup3.Header = "Results";
    122       listViewGroup3.Name = "resultsGroup";
    123       listViewGroup4.Header = "Parameters";
    124       listViewGroup4.Name = "parametersGroup";
     121      listViewGroup1.Header = "Results";
     122      listViewGroup1.Name = "resultsGroup";
     123      listViewGroup2.Header = "Parameters";
     124      listViewGroup2.Name = "parametersGroup";
    125125      this.listView.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] {
    126             listViewGroup3,
    127             listViewGroup4});
     126            listViewGroup1,
     127            listViewGroup2});
    128128      this.listView.HideSelection = false;
    129129      this.listView.Location = new System.Drawing.Point(3, 3);
     
    131131      this.listView.Name = "listView";
    132132      this.listView.ShowItemToolTips = true;
    133       this.listView.Size = new System.Drawing.Size(171, 220);
     133      this.listView.Size = new System.Drawing.Size(171, 217);
    134134      this.listView.SmallImageList = this.imageList;
    135135      this.listView.Sorting = System.Windows.Forms.SortOrder.Ascending;
     
    137137      this.listView.UseCompatibleStateImageBehavior = false;
    138138      this.listView.View = System.Windows.Forms.View.Details;
     139      this.listView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.listView_ItemDrag);
    139140      this.listView.SelectedIndexChanged += new System.EventHandler(this.listView_SelectedIndexChanged);
    140141      this.listView.DoubleClick += new System.EventHandler(this.listView_DoubleClick);
    141       this.listView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.listView_ItemDrag);
    142142      //
    143143      // nameColumnHeader
     
    163163      this.detailsGroupBox.Location = new System.Drawing.Point(3, 3);
    164164      this.detailsGroupBox.Name = "detailsGroupBox";
    165       this.detailsGroupBox.Size = new System.Drawing.Size(302, 220);
     165      this.detailsGroupBox.Size = new System.Drawing.Size(302, 217);
    166166      this.detailsGroupBox.TabIndex = 0;
    167167      this.detailsGroupBox.TabStop = false;
     
    173173                  | System.Windows.Forms.AnchorStyles.Left)
    174174                  | System.Windows.Forms.AnchorStyles.Right)));
     175      this.viewHost.Caption = "View";
    175176      this.viewHost.Content = null;
    176177      this.viewHost.Location = new System.Drawing.Point(6, 19);
    177178      this.viewHost.Name = "viewHost";
    178179      this.viewHost.ReadOnly = true;
    179       this.viewHost.Size = new System.Drawing.Size(290, 195);
     180      this.viewHost.Size = new System.Drawing.Size(290, 192);
    180181      this.viewHost.TabIndex = 0;
    181182      this.viewHost.ViewType = null;
     
    188189      this.showAlgorithmButton.Name = "showAlgorithmButton";
    189190      this.showAlgorithmButton.Size = new System.Drawing.Size(495, 23);
    190       this.showAlgorithmButton.TabIndex = 5;
     191      this.showAlgorithmButton.TabIndex = 9;
    191192      this.showAlgorithmButton.Text = "&Show Algorithm";
    192193      this.toolTip.SetToolTip(this.showAlgorithmButton, "Show the algorithm which produced these results");
     
    200201      this.changeColorButton.Location = new System.Drawing.Point(94, 52);
    201202      this.changeColorButton.Name = "changeColorButton";
    202       this.changeColorButton.Size = new System.Drawing.Size(64, 21);
    203       this.changeColorButton.TabIndex = 21;
    204       this.changeColorButton.Text = "Change";
     203      this.changeColorButton.Size = new System.Drawing.Size(64, 24);
     204      this.changeColorButton.TabIndex = 6;
     205      this.changeColorButton.Text = "&Change...";
    205206      this.changeColorButton.UseVisualStyleBackColor = true;
    206207      this.changeColorButton.Click += new System.EventHandler(this.changeColorButton_Click);
     
    209210      //
    210211      this.colorLabel.AutoSize = true;
    211       this.colorLabel.Location = new System.Drawing.Point(3, 56);
     212      this.colorLabel.Location = new System.Drawing.Point(3, 58);
    212213      this.colorLabel.Name = "colorLabel";
    213214      this.colorLabel.Size = new System.Drawing.Size(34, 13);
    214       this.colorLabel.TabIndex = 22;
    215       this.colorLabel.Text = "Color:";
    216       //
    217       // colorPictureBox
    218       //
    219       this.colorPictureBox.Location = new System.Drawing.Point(73, 54);
    220       this.colorPictureBox.Name = "colorPictureBox";
    221       this.colorPictureBox.Size = new System.Drawing.Size(17, 17);
    222       this.colorPictureBox.TabIndex = 23;
    223       this.colorPictureBox.TabStop = false;
     215      this.colorLabel.TabIndex = 4;
     216      this.colorLabel.Text = "C&olor:";
     217      //
     218      // showDetailsCheckBox
     219      //
     220      this.showDetailsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     221      this.showDetailsCheckBox.Appearance = System.Windows.Forms.Appearance.Button;
     222      this.showDetailsCheckBox.Checked = true;
     223      this.showDetailsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
     224      this.showDetailsCheckBox.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Properties;
     225      this.showDetailsCheckBox.Location = new System.Drawing.Point(471, 52);
     226      this.showDetailsCheckBox.Name = "showDetailsCheckBox";
     227      this.showDetailsCheckBox.Size = new System.Drawing.Size(24, 24);
     228      this.showDetailsCheckBox.TabIndex = 7;
     229      this.toolTip.SetToolTip(this.showDetailsCheckBox, "Show/Hide Details");
     230      this.showDetailsCheckBox.UseVisualStyleBackColor = true;
     231      this.showDetailsCheckBox.CheckedChanged += new System.EventHandler(this.showDetailsCheckBox_CheckedChanged);
     232      //
     233      // colorArea
     234      //
     235      this.colorArea.BackColor = System.Drawing.Color.White;
     236      this.colorArea.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     237      this.colorArea.Location = new System.Drawing.Point(72, 56);
     238      this.colorArea.Name = "colorArea";
     239      this.colorArea.Size = new System.Drawing.Size(16, 16);
     240      this.colorArea.TabIndex = 5;
    224241      //
    225242      // RunView
     
    227244      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    228245      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    229       this.Controls.Add(this.colorPictureBox);
     246      this.Controls.Add(this.colorArea);
     247      this.Controls.Add(this.showDetailsCheckBox);
    230248      this.Controls.Add(this.colorLabel);
    231249      this.Controls.Add(this.changeColorButton);
     
    242260      this.Controls.SetChildIndex(this.changeColorButton, 0);
    243261      this.Controls.SetChildIndex(this.colorLabel, 0);
    244       this.Controls.SetChildIndex(this.colorPictureBox, 0);
     262      this.Controls.SetChildIndex(this.showDetailsCheckBox, 0);
     263      this.Controls.SetChildIndex(this.colorArea, 0);
    245264      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    246265      this.parametersResultsGroupBox.ResumeLayout(false);
     
    249268      this.splitContainer.ResumeLayout(false);
    250269      this.detailsGroupBox.ResumeLayout(false);
    251       ((System.ComponentModel.ISupportInitialize)(this.colorPictureBox)).EndInit();
    252270      this.ResumeLayout(false);
    253271      this.PerformLayout();
     
    268286    private System.Windows.Forms.Label colorLabel;
    269287    private System.Windows.Forms.Button changeColorButton;
    270     private System.Windows.Forms.PictureBox colorPictureBox;
    271288    private System.Windows.Forms.ColorDialog colorDialog;
     289    private System.Windows.Forms.CheckBox showDetailsCheckBox;
     290    private System.Windows.Forms.Label colorArea;
    272291
    273292  }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunView.cs

    r4068 r4096  
    2121
    2222using System;
    23 using System.Drawing;
    2423using System.Windows.Forms;
    2524using HeuristicLab.Common;
     
    6463        this.Invoke(new EventHandler(Content_Changed), sender, e);
    6564      else
    66         UpdateColorPictureBox();
     65        UpdateColor();
    6766    }
    6867
     
    7170      viewHost.Content = null;
    7271      if (Content != null)
    73         UpdateColorPictureBox();
     72        UpdateColor();
    7473      FillListView();
    7574    }
     
    8887      }
    8988    }
    90     private void UpdateColorPictureBox() {
     89    private void UpdateColor() {
    9190      this.colorDialog.Color = this.Content.Color;
    92       this.colorPictureBox.Image = this.GenerateImage(colorPictureBox.Width, colorPictureBox.Height, this.Content.Color);
    93     }
    94     private Image GenerateImage(int width, int height, Color fillColor) {
    95       Image colorImage = new Bitmap(width, height);
    96       using (Graphics gfx = Graphics.FromImage(colorImage)) {
    97         using (SolidBrush brush = new SolidBrush(fillColor)) {
    98           gfx.FillRectangle(brush, 0, 0, width, height);
    99         }
    100       }
    101       return colorImage;
     91      this.colorArea.BackColor = this.Content.Color;
    10292    }
    10393
     
    132122
    133123    private void listView_SelectedIndexChanged(object sender, EventArgs e) {
    134       if (listView.SelectedItems.Count == 1)
    135         viewHost.Content = (IContent)listView.SelectedItems[0].Tag;
    136       else
    137         viewHost.Content = null;
     124      if (showDetailsCheckBox.Checked) {
     125        if (listView.SelectedItems.Count == 1) {
     126          detailsGroupBox.Enabled = true;
     127          viewHost.Content = listView.SelectedItems[0].Tag as IContent;
     128        } else {
     129          viewHost.Content = null;
     130          detailsGroupBox.Enabled = false;
     131        }
     132      }
    138133    }
    139134    private void listView_DoubleClick(object sender, EventArgs e) {
     
    159154      }
    160155    }
     156    private void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) {
     157      if (showDetailsCheckBox.Checked) {
     158        splitContainer.Panel2Collapsed = false;
     159        detailsGroupBox.Enabled = listView.SelectedItems.Count == 1;
     160        viewHost.Content = listView.SelectedItems.Count == 1 ? (IContent)listView.SelectedItems[0].Tag : null;
     161      } else {
     162        splitContainer.Panel2Collapsed = true;
     163        viewHost.Content = null;
     164        viewHost.ClearCache();
     165      }
     166    }
    161167    private void showAlgorithmButton_Click(object sender, EventArgs e) {
    162168      if (!Locked) {
Note: See TracChangeset for help on using the changeset viewer.