Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/02/14 14:07:32 (11 years ago)
Author:
sbreuer
Message:
  • start with search at the beginning when reached the end
Location:
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataGridContentView.cs

    r10705 r10706  
    3737    private IFindPreprocessingItemsIterator searchIterator;
    3838    private string currentSearchText;
     39    private Tuple<int, int> currentCell;
    3940
    4041    public new IDataGridContent Content {
     
    6970      _highlightedCells = new Dictionary<int, IList<int>>();
    7071      _highlightedRowIndices = new List<int>();
     72      currentCell = null;
    7173    }
    7274
     
    160162      if (searchIterator != null && searchIterator.GetCurrent() != null)
    161163      {
    162         Replace(TransformToDictionary(searchIterator.GetCurrent()));
     164        Replace(TransformToDictionary(currentCell));
    163165      }
    164166    }
     
    166168    void findAndReplaceDialog_ReplaceAllEvent(object sender, EventArgs e) {
    167169      Replace(FindAll(findAndReplaceDialog.GetSearchText()));
    168       findAndReplaceDialog.SetEndReached(false);
    169170    }
    170171
     
    173174        searchIterator = new FindPreprocessingItemsIterator(FindAll(findAndReplaceDialog.GetSearchText()));
    174175        currentSearchText = findAndReplaceDialog.GetSearchText();
    175         findAndReplaceDialog.SetEndReached(false);
    176176      }
    177177     
    178       Tuple<int, int> currentCell = null;
    179178      bool moreOccurences = false;
    180179      do {
     
    183182      } while (moreOccurences && (currentCell == null || !Content.GetValue(currentCell.Item2, currentCell.Item1).Equals(currentSearchText)));
    184183
    185       if (!moreOccurences) {
    186         findAndReplaceDialog.SetEndReached(true);
    187       }
    188 
    189184      if (currentCell != null) {
    190185        HightlightedCells = TransformToDictionary(currentCell);
     
    192187        ResetHighlightedCells();
    193188      }
     189
     190      if (!moreOccurences) {
     191        searchIterator.Reset();
     192        ResetHighlightedCells();
     193      }
    194194    }
    195195
    196196    void findAndReplaceDialog_FindAllEvent(object sender, EventArgs e) {
    197197      HightlightedCells = FindAll(findAndReplaceDialog.GetSearchText());
    198       findAndReplaceDialog.SetEndReached(false);
    199198    }
    200199
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/FindAndReplaceDialog.Designer.cs

    r10705 r10706  
    3737      this.txtValue = new System.Windows.Forms.TextBox();
    3838      this.label1 = new System.Windows.Forms.Label();
    39       this.lblEndReached = new System.Windows.Forms.Label();
    4039      this.tabSearchReplace.SuspendLayout();
    4140      this.tabReplace.SuspendLayout();
     
    5251      this.tabSearchReplace.Name = "tabSearchReplace";
    5352      this.tabSearchReplace.SelectedIndex = 0;
    54       this.tabSearchReplace.Size = new System.Drawing.Size(564, 143);
     53      this.tabSearchReplace.Size = new System.Drawing.Size(564, 132);
    5554      this.tabSearchReplace.TabIndex = 0;
    5655      this.tabSearchReplace.SelectedIndexChanged += new System.EventHandler(this.tabSearchReplace_SelectedIndexChanged);
     
    6160      this.tabSearch.Name = "tabSearch";
    6261      this.tabSearch.Padding = new System.Windows.Forms.Padding(3);
    63       this.tabSearch.Size = new System.Drawing.Size(556, 109);
     62      this.tabSearch.Size = new System.Drawing.Size(556, 117);
    6463      this.tabSearch.TabIndex = 0;
    6564      this.tabSearch.Text = "Search";
     
    6867      // tabReplace
    6968      //
    70       this.tabReplace.Controls.Add(this.lblEndReached);
    7169      this.tabReplace.Controls.Add(this.txtSearchString);
    7270      this.tabReplace.Controls.Add(this.lblSearch);
     
    8280      this.tabReplace.Name = "tabReplace";
    8381      this.tabReplace.Padding = new System.Windows.Forms.Padding(3);
    84       this.tabReplace.Size = new System.Drawing.Size(556, 117);
     82      this.tabReplace.Size = new System.Drawing.Size(556, 106);
    8583      this.tabReplace.TabIndex = 1;
    8684      this.tabReplace.Text = "Replace";
     
    174172      this.label1.Text = "Replace with";
    175173      //
    176       // lblEndReached
    177       //
    178       this.lblEndReached.AutoSize = true;
    179       this.lblEndReached.Location = new System.Drawing.Point(218, 100);
    180       this.lblEndReached.Name = "lblEndReached";
    181       this.lblEndReached.Size = new System.Drawing.Size(139, 13);
    182       this.lblEndReached.TabIndex = 24;
    183       this.lblEndReached.Text = "No more occurences found.";
    184       //
    185174      // FindAndReplaceDialog
    186175      //
    187176      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    188177      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    189       this.ClientSize = new System.Drawing.Size(588, 167);
     178      this.ClientSize = new System.Drawing.Size(588, 156);
    190179      this.Controls.Add(this.tabSearchReplace);
    191180      this.Name = "FindAndReplaceDialog";
     
    213202    private System.Windows.Forms.TextBox txtValue;
    214203    private System.Windows.Forms.Label label1;
    215     private System.Windows.Forms.Label lblEndReached;
    216204  }
    217205}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/FindAndReplaceDialog.cs

    r10705 r10706  
    2020      cmbReplaceWith.Items.AddRange(cmbItemsText);
    2121      cmbReplaceWith.SelectedIndex = (int)ReplaceAction.Value;
    22       SetEndReached(false);
    2322    }
    2423
     
    3130      tabReplace.Focus();
    3231      AddControlsToCurrentTab();
    33     }
    34 
    35     public void SetEndReached(bool endReached) {
    36       lblEndReached.Visible = endReached;
    3732    }
    3833
     
    5045      tabSearchReplace.SelectedTab.Controls.Add(lblSearch);
    5146      tabSearchReplace.SelectedTab.Controls.Add(txtSearchString);
    52       tabSearchReplace.SelectedTab.Controls.Add(lblEndReached);
    5347    }
    5448
Note: See TracChangeset for help on using the changeset viewer.