Free cookie consent management tool by TermsFeed Policy Generator

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/HeuristicLab.Core.Views/3.3
Files:
6 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    }
Note: See TracChangeset for help on using the changeset viewer.