Changeset 12381
- Timestamp:
- 05/05/15 10:44:35 (10 years ago)
- Location:
- branches/BubbleChart/HeuristicLab.Optimization.BubbleChart/3.3
- Files:
-
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/BubbleChart/HeuristicLab.Optimization.BubbleChart/3.3/HeuristicLab.Optimization.BubbleChart-3.3.csproj
r12379 r12381 84 84 </ItemGroup> 85 85 <ItemGroup> 86 <Compile Include="RecursiveDataItemListView.cs">87 <SubType>UserControl</SubType>88 </Compile>89 <Compile Include="RecursiveDataItemListView.Designer.cs">90 <DependentUpon>RecursiveDataItemListView.cs</DependentUpon>91 </Compile>92 86 <Compile Include="RecursiveDataItemView.cs"> 93 87 <SubType>UserControl</SubType> -
branches/BubbleChart/HeuristicLab.Optimization.BubbleChart/3.3/RecursiveDataItemView.Designer.cs
r12379 r12381 48 48 this.listView = new System.Windows.Forms.ListView(); 49 49 this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 50 this.nameColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 51 this.valueColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 52 this.dataGroupBox = new System.Windows.Forms.GroupBox(); 53 this.detailsGroupBox = new System.Windows.Forms.GroupBox(); 54 this.dataChildrenSplitContainer = new System.Windows.Forms.SplitContainer(); 55 this.treeView = new System.Windows.Forms.TreeView(); 50 56 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 51 57 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); … … 53 59 this.splitContainer.Panel2.SuspendLayout(); 54 60 this.splitContainer.SuspendLayout(); 61 this.dataGroupBox.SuspendLayout(); 62 this.detailsGroupBox.SuspendLayout(); 63 ((System.ComponentModel.ISupportInitialize)(this.dataChildrenSplitContainer)).BeginInit(); 64 this.dataChildrenSplitContainer.Panel1.SuspendLayout(); 65 this.dataChildrenSplitContainer.Panel2.SuspendLayout(); 66 this.dataChildrenSplitContainer.SuspendLayout(); 55 67 this.SuspendLayout(); 56 68 // … … 59 71 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 60 72 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 73 this.nameTextBox.Size = new System.Drawing.Size(459, 20); 74 // 75 // infoLabel 76 // 77 this.infoLabel.Location = new System.Drawing.Point(523, 3); 61 78 // 62 79 // splitContainer 63 80 // 64 this.splitContainer.Location = new System.Drawing.Point(3, 26); 81 this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; 82 this.splitContainer.Location = new System.Drawing.Point(3, 16); 65 83 this.splitContainer.Name = "splitContainer"; 66 84 // 67 85 // splitContainer.Panel1 68 86 // 69 this.splitContainer.Panel1.Controls.Add(this. listView);87 this.splitContainer.Panel1.Controls.Add(this.dataChildrenSplitContainer); 70 88 // 71 89 // splitContainer.Panel2 72 90 // 73 this.splitContainer.Panel2.Controls.Add(this. viewHost);74 this.splitContainer.Size = new System.Drawing.Size( 345, 261);75 this.splitContainer.SplitterDistance = 1 15;91 this.splitContainer.Panel2.Controls.Add(this.detailsGroupBox); 92 this.splitContainer.Size = new System.Drawing.Size(527, 297); 93 this.splitContainer.SplitterDistance = 170; 76 94 this.splitContainer.TabIndex = 3; 77 95 // 78 96 // listView 79 97 // 80 this.listView.Dock = System.Windows.Forms.DockStyle.Fill; 81 this.listView.Location = new System.Drawing.Point(0, 0); 98 this.listView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 99 | System.Windows.Forms.AnchorStyles.Left) 100 | System.Windows.Forms.AnchorStyles.Right))); 101 this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 102 this.nameColumnHeader, 103 this.valueColumnHeader}); 104 this.listView.FullRowSelect = true; 105 this.listView.HideSelection = false; 106 this.listView.Location = new System.Drawing.Point(3, 3); 82 107 this.listView.MultiSelect = false; 83 108 this.listView.Name = "listView"; 84 this.listView.Size = new System.Drawing.Size(115, 261); 109 this.listView.Size = new System.Drawing.Size(160, 185); 110 this.listView.Sorting = System.Windows.Forms.SortOrder.Ascending; 85 111 this.listView.TabIndex = 0; 86 112 this.listView.UseCompatibleStateImageBehavior = false; 113 this.listView.View = System.Windows.Forms.View.Details; 87 114 this.listView.SelectedIndexChanged += new System.EventHandler(this.listView_SelectedIndexChanged); 88 115 // 89 116 // viewHost 90 117 // 118 this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 119 | System.Windows.Forms.AnchorStyles.Left) 120 | System.Windows.Forms.AnchorStyles.Right))); 91 121 this.viewHost.Caption = "View"; 92 122 this.viewHost.Content = null; 93 this.viewHost.Dock = System.Windows.Forms.DockStyle.Fill;94 123 this.viewHost.Enabled = false; 95 this.viewHost.Location = new System.Drawing.Point( 0, 0);124 this.viewHost.Location = new System.Drawing.Point(6, 19); 96 125 this.viewHost.Name = "viewHost"; 97 126 this.viewHost.ReadOnly = false; 98 this.viewHost.Size = new System.Drawing.Size( 226, 261);127 this.viewHost.Size = new System.Drawing.Size(334, 265); 99 128 this.viewHost.TabIndex = 0; 100 129 this.viewHost.ViewsLabelVisible = true; 101 130 this.viewHost.ViewType = null; 102 131 // 132 // nameColumnHeader 133 // 134 this.nameColumnHeader.Text = "Name"; 135 // 136 // valueColumnHeader 137 // 138 this.valueColumnHeader.Text = "Value"; 139 // 140 // dataGroupBox 141 // 142 this.dataGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 143 | System.Windows.Forms.AnchorStyles.Left) 144 | System.Windows.Forms.AnchorStyles.Right))); 145 this.dataGroupBox.Controls.Add(this.splitContainer); 146 this.dataGroupBox.Location = new System.Drawing.Point(6, 26); 147 this.dataGroupBox.Name = "dataGroupBox"; 148 this.dataGroupBox.Size = new System.Drawing.Size(533, 316); 149 this.dataGroupBox.TabIndex = 4; 150 this.dataGroupBox.TabStop = false; 151 this.dataGroupBox.Text = "Data && Children"; 152 // 153 // detailsGroupBox 154 // 155 this.detailsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 156 | System.Windows.Forms.AnchorStyles.Left) 157 | System.Windows.Forms.AnchorStyles.Right))); 158 this.detailsGroupBox.Controls.Add(this.viewHost); 159 this.detailsGroupBox.Location = new System.Drawing.Point(4, 4); 160 this.detailsGroupBox.Name = "detailsGroupBox"; 161 this.detailsGroupBox.Size = new System.Drawing.Size(346, 290); 162 this.detailsGroupBox.TabIndex = 1; 163 this.detailsGroupBox.TabStop = false; 164 this.detailsGroupBox.Text = "Details"; 165 // 166 // dataChildrenSplitContainer 167 // 168 this.dataChildrenSplitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 169 | System.Windows.Forms.AnchorStyles.Left) 170 | System.Windows.Forms.AnchorStyles.Right))); 171 this.dataChildrenSplitContainer.Location = new System.Drawing.Point(4, 4); 172 this.dataChildrenSplitContainer.Name = "dataChildrenSplitContainer"; 173 this.dataChildrenSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; 174 // 175 // dataChildrenSplitContainer.Panel1 176 // 177 this.dataChildrenSplitContainer.Panel1.Controls.Add(this.listView); 178 // 179 // dataChildrenSplitContainer.Panel2 180 // 181 this.dataChildrenSplitContainer.Panel2.Controls.Add(this.treeView); 182 this.dataChildrenSplitContainer.Size = new System.Drawing.Size(168, 290); 183 this.dataChildrenSplitContainer.SplitterDistance = 191; 184 this.dataChildrenSplitContainer.TabIndex = 1; 185 // 186 // treeView 187 // 188 this.treeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 189 | System.Windows.Forms.AnchorStyles.Left) 190 | System.Windows.Forms.AnchorStyles.Right))); 191 this.treeView.Location = new System.Drawing.Point(3, 3); 192 this.treeView.Name = "treeView"; 193 this.treeView.Size = new System.Drawing.Size(160, 89); 194 this.treeView.TabIndex = 0; 195 this.treeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_AfterSelect); 196 // 103 197 // RecursiveDataItemView 104 198 // 105 199 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 106 200 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 107 this.Controls.Add(this. splitContainer);201 this.Controls.Add(this.dataGroupBox); 108 202 this.Name = "RecursiveDataItemView"; 109 this.Size = new System.Drawing.Size( 351, 290);203 this.Size = new System.Drawing.Size(542, 345); 110 204 this.Controls.SetChildIndex(this.nameLabel, 0); 111 205 this.Controls.SetChildIndex(this.nameTextBox, 0); 112 206 this.Controls.SetChildIndex(this.infoLabel, 0); 113 this.Controls.SetChildIndex(this. splitContainer, 0);207 this.Controls.SetChildIndex(this.dataGroupBox, 0); 114 208 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 115 209 this.splitContainer.Panel1.ResumeLayout(false); … … 117 211 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 118 212 this.splitContainer.ResumeLayout(false); 213 this.dataGroupBox.ResumeLayout(false); 214 this.detailsGroupBox.ResumeLayout(false); 215 this.dataChildrenSplitContainer.Panel1.ResumeLayout(false); 216 this.dataChildrenSplitContainer.Panel2.ResumeLayout(false); 217 ((System.ComponentModel.ISupportInitialize)(this.dataChildrenSplitContainer)).EndInit(); 218 this.dataChildrenSplitContainer.ResumeLayout(false); 119 219 this.ResumeLayout(false); 120 220 this.PerformLayout(); … … 127 227 private System.Windows.Forms.ListView listView; 128 228 private HeuristicLab.MainForm.WindowsForms.ViewHost viewHost; 229 private System.Windows.Forms.ColumnHeader nameColumnHeader; 230 private System.Windows.Forms.ColumnHeader valueColumnHeader; 231 private System.Windows.Forms.GroupBox detailsGroupBox; 232 private System.Windows.Forms.GroupBox dataGroupBox; 233 private System.Windows.Forms.SplitContainer dataChildrenSplitContainer; 234 private System.Windows.Forms.TreeView treeView; 129 235 } 130 236 } -
branches/BubbleChart/HeuristicLab.Optimization.BubbleChart/3.3/RecursiveDataItemView.cs
r12379 r12381 28 28 namespace HeuristicLab.Optimization.BubbleChart { 29 29 [View("RecursiveDataItem View")] 30 [Content(typeof(RecursiveDataItem) )]30 [Content(typeof(RecursiveDataItem), true)] 31 31 public partial class RecursiveDataItemView : NamedItemView { 32 32 … … 41 41 42 42 protected override void OnContentChanged() { 43 listView.Clear(); 43 base.OnContentChanged(); 44 45 listView.Items.Clear(); 46 treeView.Nodes.Clear(); 44 47 viewHost.Content = null; 45 48 … … 47 50 foreach (var data in Content.Data) { 48 51 listView.Items.Add(CreateListViewItem(data)); 52 } 53 for (int i = 0; i < listView.Columns.Count; i++) 54 listView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 55 foreach (var dataItem in Content.Children) { 56 treeView.Nodes.Add(CreateTreeNode(dataItem)); 49 57 } 50 58 } … … 56 64 57 65 private ListViewItem CreateListViewItem(KeyValuePair<string, IItem> data) { 58 return new ListViewItem( data.Key) {66 return new ListViewItem(new[] { data.Key, data.Value != null ? data.Value.ToString() : "-" }) { 59 67 Tag = data.Value 60 68 }; 69 } 70 private TreeNode CreateTreeNode(RecursiveDataItem dataItem) { 71 var node = new TreeNode(dataItem.Name) { 72 Tag = dataItem 73 }; 74 foreach (var child in dataItem.Children) { 75 node.Nodes.Add(CreateTreeNode(child)); 76 } 77 return node; 61 78 } 62 79 … … 69 86 } 70 87 } 88 private void treeView_AfterSelect(object sender, TreeViewEventArgs e) { 89 var dataItem = (RecursiveDataItem)e.Node.Tag; 90 viewHost.Content = dataItem; 91 } 71 92 } 72 93 }
Note: See TracChangeset
for help on using the changeset viewer.