Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12201


Ignore:
Timestamp:
03/16/15 10:38:33 (10 years ago)
Author:
pfleck
Message:

#2025

  • Added expand all and collapse all buttons.
  • Improved search.
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  
    5252      this.searchLabel = new System.Windows.Forms.Label();
    5353      this.splitContainer = new System.Windows.Forms.SplitContainer();
     54      this.expandAllButton = new System.Windows.Forms.Button();
     55      this.collapseAllButton = new System.Windows.Forms.Button();
    5456      this.searchTextBox = new System.Windows.Forms.TextBox();
    5557      this.typesTreeView = new System.Windows.Forms.TreeView();
     
    8991      //
    9092      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);
    9294      this.searchLabel.Name = "searchLabel";
    9395      this.searchLabel.Size = new System.Drawing.Size(20, 20);
     
    106108      // splitContainer.Panel1
    107109      //
     110      this.splitContainer.Panel1.Controls.Add(this.expandAllButton);
     111      this.splitContainer.Panel1.Controls.Add(this.collapseAllButton);
    108112      this.splitContainer.Panel1.Controls.Add(this.searchLabel);
    109113      this.splitContainer.Panel1.Controls.Add(this.searchTextBox);
     
    117121      this.splitContainer.TabIndex = 0;
    118122      //
     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      //
    119143      // searchTextBox
    120144      //
    121145      this.searchTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    122146            | 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);
    124148      this.searchTextBox.Name = "searchTextBox";
    125       this.searchTextBox.Size = new System.Drawing.Size(568, 20);
     149      this.searchTextBox.Size = new System.Drawing.Size(514, 20);
    126150      this.searchTextBox.TabIndex = 1;
    127151      this.searchTextBox.TextChanged += new System.EventHandler(this.searchTextBox_TextChanged);
     
    202226    private System.Windows.Forms.TreeView typesTreeView;
    203227    private System.Windows.Forms.ImageList imageList;
     228    private System.Windows.Forms.Button expandAllButton;
     229    private System.Windows.Forms.Button collapseAllButton;
    204230  }
    205231}
  • branches/NewItemDialog/HeuristicLab.Optimizer/3.3/NewItemDialog.cs

    r12200 r12201  
    136136        typesTreeView.BeginUpdate();
    137137        int i = 0;
     138        var searchTokens = searchString.Split(' ');
    138139        while (i < typesTreeView.Nodes.Count) {
    139140          int j = 0;
    140141          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))) {
    142143              if ((typesTreeView.Nodes[i].Nodes[j].Tag as Type).Equals(SelectedType))
    143144                SelectedType = null;
     
    200201
    201202    #region Control Events
    202     protected virtual void searchTextBox_TextChanged(object sender, System.EventArgs e) {
     203    protected virtual void searchTextBox_TextChanged(object sender, EventArgs e) {
    203204      Filter(searchTextBox.Text);
    204205    }
     
    257258      okButton.Enabled = SelectedType != null;
    258259    }
     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    }
    259267  }
    260268}
Note: See TracChangeset for help on using the changeset viewer.