- Timestamp:
- 07/22/10 02:26:37 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Core.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.Designer.cs
r3407 r4069 55 55 this.components = new System.ComponentModel.Container(); 56 56 this.splitContainer = new System.Windows.Forms.SplitContainer(); 57 this.showDetailsCheckBox = new System.Windows.Forms.CheckBox(); 57 58 this.removeButton = new System.Windows.Forms.Button(); 58 59 this.moveUpButton = new System.Windows.Forms.Button(); 59 60 this.moveDownButton = new System.Windows.Forms.Button(); 60 61 this.itemsListView = new System.Windows.Forms.ListView(); 61 this.listViewColumnHeader = new System.Windows.Forms.ColumnHeader();62 this.listViewColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 62 63 this.imageList = new System.Windows.Forms.ImageList(this.components); 63 64 this.addButton = new System.Windows.Forms.Button(); … … 82 83 // splitContainer.Panel1 83 84 // 85 this.splitContainer.Panel1.Controls.Add(this.showDetailsCheckBox); 84 86 this.splitContainer.Panel1.Controls.Add(this.removeButton); 85 87 this.splitContainer.Panel1.Controls.Add(this.moveUpButton); … … 94 96 this.splitContainer.SplitterDistance = 200; 95 97 this.splitContainer.TabIndex = 0; 98 // 99 // showDetailsCheckBox 100 // 101 this.showDetailsCheckBox.Appearance = System.Windows.Forms.Appearance.Button; 102 this.showDetailsCheckBox.Checked = true; 103 this.showDetailsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 104 this.showDetailsCheckBox.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Properties; 105 this.showDetailsCheckBox.Location = new System.Drawing.Point(123, 3); 106 this.showDetailsCheckBox.Name = "showDetailsCheckBox"; 107 this.showDetailsCheckBox.Size = new System.Drawing.Size(24, 24); 108 this.showDetailsCheckBox.TabIndex = 5; 109 this.toolTip.SetToolTip(this.showDetailsCheckBox, "Show/Hide Details"); 110 this.showDetailsCheckBox.UseVisualStyleBackColor = true; 111 this.showDetailsCheckBox.CheckedChanged += new System.EventHandler(this.showDetailsCheckBox_CheckedChanged); 96 112 // 97 113 // removeButton … … 149 165 this.itemsListView.UseCompatibleStateImageBehavior = false; 150 166 this.itemsListView.View = System.Windows.Forms.View.Details; 167 this.itemsListView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.itemsListView_ItemDrag); 151 168 this.itemsListView.SelectedIndexChanged += new System.EventHandler(this.itemsListView_SelectedIndexChanged); 152 this.itemsListView.DoubleClick += new System.EventHandler(this.itemsListView_DoubleClick);153 169 this.itemsListView.DragDrop += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragDrop); 154 170 this.itemsListView.DragEnter += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragEnterOver); 171 this.itemsListView.DragOver += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragEnterOver); 172 this.itemsListView.DoubleClick += new System.EventHandler(this.itemsListView_DoubleClick); 155 173 this.itemsListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.itemsListView_KeyDown); 156 this.itemsListView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.itemsListView_ItemDrag);157 this.itemsListView.DragOver += new System.Windows.Forms.DragEventHandler(this.itemsListView_DragEnterOver);158 174 // 159 175 // imageList … … 192 208 | System.Windows.Forms.AnchorStyles.Left) 193 209 | System.Windows.Forms.AnchorStyles.Right))); 210 this.viewHost.Caption = "View"; 194 211 this.viewHost.Content = null; 195 212 this.viewHost.Location = new System.Drawing.Point(6, 19); 196 213 this.viewHost.Name = "viewHost"; 214 this.viewHost.ReadOnly = false; 197 215 this.viewHost.Size = new System.Drawing.Size(271, 269); 198 216 this.viewHost.TabIndex = 0; 217 this.viewHost.ViewType = null; 199 218 // 200 219 // itemsGroupBox … … 238 257 protected ImageList imageList; 239 258 protected HeuristicLab.MainForm.WindowsForms.ViewHost viewHost; 259 protected CheckBox showDetailsCheckBox; 240 260 } 241 261 } -
trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.cs
r3904 r4069 197 197 AdjustListViewColumnSizes(); 198 198 199 if (itemsListView.SelectedItems.Count == 1) { 200 T item = (T)itemsListView.SelectedItems[0].Tag; 201 detailsGroupBox.Enabled = true; 202 viewHost.Content = item; 203 } else { 204 viewHost.Content = null; 205 detailsGroupBox.Enabled = false; 199 if (showDetailsCheckBox.Checked) { 200 if (itemsListView.SelectedItems.Count == 1) { 201 T item = (T)itemsListView.SelectedItems[0].Tag; 202 detailsGroupBox.Enabled = true; 203 viewHost.Content = item; 204 } else { 205 viewHost.Content = null; 206 detailsGroupBox.Enabled = false; 207 } 206 208 } 207 209 } … … 301 303 #endregion 302 304 305 #region CheckBox Events 306 private class DummyContent : HeuristicLab.Common.IContent { } 307 protected void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) { 308 if (showDetailsCheckBox.Checked) { 309 splitContainer.Panel2Collapsed = false; 310 detailsGroupBox.Enabled = itemsListView.SelectedItems.Count == 1; 311 viewHost.Content = itemsListView.SelectedItems.Count == 1 ? (T)itemsListView.SelectedItems[0].Tag : null; 312 } else { 313 splitContainer.Panel2Collapsed = true; 314 viewHost.Content = new DummyContent(); 315 } 316 } 317 #endregion 318 303 319 #region Content Events 304 320 protected virtual void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<T>> e) {
Note: See TracChangeset
for help on using the changeset viewer.