Changeset 12201
- Timestamp:
- 03/16/15 10:38:33 (10 years ago)
- Location:
- branches/NewItemDialog/HeuristicLab.Optimizer/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/NewItemDialog/HeuristicLab.Optimizer/3.3/NewItemDialog.Designer.cs
r12185 r12201 52 52 this.searchLabel = new System.Windows.Forms.Label(); 53 53 this.splitContainer = new System.Windows.Forms.SplitContainer(); 54 this.expandAllButton = new System.Windows.Forms.Button(); 55 this.collapseAllButton = new System.Windows.Forms.Button(); 54 56 this.searchTextBox = new System.Windows.Forms.TextBox(); 55 57 this.typesTreeView = new System.Windows.Forms.TreeView(); … … 89 91 // 90 92 this.searchLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Zoom; 91 this.searchLabel.Location = new System.Drawing.Point( 3, 3);93 this.searchLabel.Location = new System.Drawing.Point(57, 5); 92 94 this.searchLabel.Name = "searchLabel"; 93 95 this.searchLabel.Size = new System.Drawing.Size(20, 20); … … 106 108 // splitContainer.Panel1 107 109 // 110 this.splitContainer.Panel1.Controls.Add(this.expandAllButton); 111 this.splitContainer.Panel1.Controls.Add(this.collapseAllButton); 108 112 this.splitContainer.Panel1.Controls.Add(this.searchLabel); 109 113 this.splitContainer.Panel1.Controls.Add(this.searchTextBox); … … 117 121 this.splitContainer.TabIndex = 0; 118 122 // 123 // expandAllButton 124 // 125 this.expandAllButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.ZoomIn; 126 this.expandAllButton.Location = new System.Drawing.Point(3, 3); 127 this.expandAllButton.Name = "expandAllButton"; 128 this.expandAllButton.Size = new System.Drawing.Size(23, 23); 129 this.expandAllButton.TabIndex = 4; 130 this.expandAllButton.UseVisualStyleBackColor = true; 131 this.expandAllButton.Click += new System.EventHandler(this.expandAllButton_Click); 132 // 133 // collapseAllButton 134 // 135 this.collapseAllButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.ZoomOut; 136 this.collapseAllButton.Location = new System.Drawing.Point(26, 3); 137 this.collapseAllButton.Name = "collapseAllButton"; 138 this.collapseAllButton.Size = new System.Drawing.Size(23, 23); 139 this.collapseAllButton.TabIndex = 5; 140 this.collapseAllButton.UseVisualStyleBackColor = true; 141 this.collapseAllButton.Click += new System.EventHandler(this.collapseAllButton_Click); 142 // 119 143 // searchTextBox 120 144 // 121 145 this.searchTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 122 146 | System.Windows.Forms.AnchorStyles.Right))); 123 this.searchTextBox.Location = new System.Drawing.Point( 29, 3);147 this.searchTextBox.Location = new System.Drawing.Point(83, 5); 124 148 this.searchTextBox.Name = "searchTextBox"; 125 this.searchTextBox.Size = new System.Drawing.Size(5 68, 20);149 this.searchTextBox.Size = new System.Drawing.Size(514, 20); 126 150 this.searchTextBox.TabIndex = 1; 127 151 this.searchTextBox.TextChanged += new System.EventHandler(this.searchTextBox_TextChanged); … … 202 226 private System.Windows.Forms.TreeView typesTreeView; 203 227 private System.Windows.Forms.ImageList imageList; 228 private System.Windows.Forms.Button expandAllButton; 229 private System.Windows.Forms.Button collapseAllButton; 204 230 } 205 231 } -
branches/NewItemDialog/HeuristicLab.Optimizer/3.3/NewItemDialog.cs
r12200 r12201 136 136 typesTreeView.BeginUpdate(); 137 137 int i = 0; 138 var searchTokens = searchString.Split(' '); 138 139 while (i < typesTreeView.Nodes.Count) { 139 140 int j = 0; 140 141 while (j < typesTreeView.Nodes[i].Nodes.Count) { 141 if ( !typesTreeView.Nodes[i].Nodes[j].Text.ToLower().Contains(searchString)) {142 if (searchTokens.Any(searchToken => !typesTreeView.Nodes[i].Nodes[j].Text.ToLower().Contains(searchToken))) { 142 143 if ((typesTreeView.Nodes[i].Nodes[j].Tag as Type).Equals(SelectedType)) 143 144 SelectedType = null; … … 200 201 201 202 #region Control Events 202 protected virtual void searchTextBox_TextChanged(object sender, System.EventArgs e) {203 protected virtual void searchTextBox_TextChanged(object sender, EventArgs e) { 203 204 Filter(searchTextBox.Text); 204 205 } … … 257 258 okButton.Enabled = SelectedType != null; 258 259 } 260 261 private void expandAllButton_Click(object sender, EventArgs e) { 262 typesTreeView.ExpandAll(); 263 } 264 private void collapseAllButton_Click(object sender, EventArgs e) { 265 typesTreeView.CollapseAll(); 266 } 259 267 } 260 268 }
Note: See TracChangeset
for help on using the changeset viewer.