Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/19/14 16:09:47 (11 years ago)
Author:
sbreuer
Message:
  • further enhancements of FilterAndReplaceDialog
Location:
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3
Files:
4 edited

Legend:

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

    r10633 r10636  
    3333
    3434    private bool notOwnEvent = true;
     35    private FindAndReplaceDialog findAndReplaceDialog;
    3536
    3637    public new IDataGridContent Content {
     
    149150        });
    150151      } else if (e.Control && e.KeyCode == Keys.F) {
    151         FindAndReplaceDialog findAndReplaceDialog = new FindAndReplaceDialog();
    152         findAndReplaceDialog.Show();
     152        CreateFindAndReplaceDialog();
    153153        findAndReplaceDialog.ActivateSearch();
    154 
    155154      } else if (e.Control && e.KeyCode == Keys.R) {
    156         FindAndReplaceDialog findAndReplaceDialog = new FindAndReplaceDialog();
    157         findAndReplaceDialog.Show();
     155        CreateFindAndReplaceDialog();
    158156        findAndReplaceDialog.ActivateReplace();
    159157      }
     158    }
     159
     160    private void CreateFindAndReplaceDialog() {
     161      findAndReplaceDialog = new FindAndReplaceDialog();
     162      findAndReplaceDialog.Show();
     163      findAndReplaceDialog.FindAllEvent += findAndReplaceDialog_FindAllEvent;
     164      findAndReplaceDialog.FindNextEvent += findAndReplaceDialog_FindNextEvent;
     165      findAndReplaceDialog.ReplaceAllEvent += findAndReplaceDialog_ReplaceAllEvent;
     166      findAndReplaceDialog.ReplaceNextEvent += findAndReplaceDialog_ReplaceNextEvent;
     167    }
     168
     169    void findAndReplaceDialog_ReplaceNextEvent(object sender, EventArgs e) {
     170      throw new NotImplementedException();
     171    }
     172
     173    void findAndReplaceDialog_ReplaceAllEvent(object sender, EventArgs e) {
     174      throw new NotImplementedException();
     175    }
     176
     177    void findAndReplaceDialog_FindNextEvent(object sender, EventArgs e) {
     178      throw new NotImplementedException();
     179    }
     180
     181    void findAndReplaceDialog_FindAllEvent(object sender, EventArgs e) {
     182      throw new NotImplementedException();
    160183    }
    161184
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataPreprocessingView.cs

    r10625 r10636  
    5555
    5656        var viewShortcuts = new ItemCollection<IViewShortcut>() {
    57           new DataGridContent(dataGridLogic, manipulationLogic),
     57          new DataGridContent(dataGridLogic, manipulationLogic, filterLogic),
    5858          new StatisticsContent(statisticsLogic),
    5959          new FilterContent(filterLogic),
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/FindAndReplaceDialog.Designer.cs

    r10633 r10636  
    3131      this.btnFindNext = new System.Windows.Forms.Button();
    3232      this.tabReplace = new System.Windows.Forms.TabPage();
     33      this.lblValue = new System.Windows.Forms.Label();
     34      this.btnReplaceAll = new System.Windows.Forms.Button();
     35      this.btnReplaceNext = new System.Windows.Forms.Button();
     36      this.cmbReplaceWith = new System.Windows.Forms.ComboBox();
     37      this.txtValue = new System.Windows.Forms.TextBox();
     38      this.label1 = new System.Windows.Forms.Label();
    3339      this.tabSearchReplace.SuspendLayout();
    34       this.tabSearch.SuspendLayout();
     40      this.tabReplace.SuspendLayout();
    3541      this.SuspendLayout();
    3642      //
    3743      // tabSearchReplace
    3844      //
     45      this.tabSearchReplace.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     46            | System.Windows.Forms.AnchorStyles.Left)
     47            | System.Windows.Forms.AnchorStyles.Right)));
    3948      this.tabSearchReplace.Controls.Add(this.tabSearch);
    4049      this.tabSearchReplace.Controls.Add(this.tabReplace);
     
    4251      this.tabSearchReplace.Name = "tabSearchReplace";
    4352      this.tabSearchReplace.SelectedIndex = 0;
    44       this.tabSearchReplace.Size = new System.Drawing.Size(511, 174);
     53      this.tabSearchReplace.Size = new System.Drawing.Size(564, 135);
    4554      this.tabSearchReplace.TabIndex = 0;
    4655      //
    4756      // tabSearch
    4857      //
    49       this.tabSearch.Controls.Add(this.txtSearchString);
    50       this.tabSearch.Controls.Add(this.lblSearch);
    51       this.tabSearch.Controls.Add(this.btnFindAll);
    52       this.tabSearch.Controls.Add(this.btnFindNext);
    5358      this.tabSearch.Location = new System.Drawing.Point(4, 22);
    5459      this.tabSearch.Name = "tabSearch";
    5560      this.tabSearch.Padding = new System.Windows.Forms.Padding(3);
    56       this.tabSearch.Size = new System.Drawing.Size(503, 148);
     61      this.tabSearch.Size = new System.Drawing.Size(556, 148);
    5762      this.tabSearch.TabIndex = 0;
    5863      this.tabSearch.Text = "Search";
     
    6166      // txtSearchString
    6267      //
    63       this.txtSearchString.Location = new System.Drawing.Point(97, 27);
     68      this.txtSearchString.Location = new System.Drawing.Point(103, 20);
    6469      this.txtSearchString.Name = "txtSearchString";
    6570      this.txtSearchString.Size = new System.Drawing.Size(254, 20);
    66       this.txtSearchString.TabIndex = 3;
     71      this.txtSearchString.TabIndex = 23;
    6772      //
    6873      // lblSearch
    6974      //
    7075      this.lblSearch.AutoSize = true;
    71       this.lblSearch.Location = new System.Drawing.Point(32, 30);
     76      this.lblSearch.Location = new System.Drawing.Point(41, 26);
    7277      this.lblSearch.Name = "lblSearch";
    73       this.lblSearch.Size = new System.Drawing.Size(59, 13);
    74       this.lblSearch.TabIndex = 2;
    75       this.lblSearch.Text = "Search for:";
     78      this.lblSearch.Size = new System.Drawing.Size(56, 13);
     79      this.lblSearch.TabIndex = 22;
     80      this.lblSearch.Text = "Search for";
    7681      //
    7782      // btnFindAll
    7883      //
    79       this.btnFindAll.Location = new System.Drawing.Point(360, 96);
     84      this.btnFindAll.Location = new System.Drawing.Point(458, 20);
    8085      this.btnFindAll.Name = "btnFindAll";
    81       this.btnFindAll.Size = new System.Drawing.Size(75, 23);
    82       this.btnFindAll.TabIndex = 1;
     86      this.btnFindAll.Size = new System.Drawing.Size(80, 23);
     87      this.btnFindAll.TabIndex = 21;
    8388      this.btnFindAll.Text = "Find All";
    8489      this.btnFindAll.UseVisualStyleBackColor = true;
     
    8691      // btnFindNext
    8792      //
    88       this.btnFindNext.Location = new System.Drawing.Point(360, 67);
     93      this.btnFindNext.Location = new System.Drawing.Point(372, 20);
    8994      this.btnFindNext.Name = "btnFindNext";
    90       this.btnFindNext.Size = new System.Drawing.Size(75, 23);
    91       this.btnFindNext.TabIndex = 0;
     95      this.btnFindNext.Size = new System.Drawing.Size(80, 23);
     96      this.btnFindNext.TabIndex = 20;
    9297      this.btnFindNext.Text = "Find Next";
    9398      this.btnFindNext.UseVisualStyleBackColor = true;
     
    95100      // tabReplace
    96101      //
     102      this.tabReplace.Controls.Add(this.txtSearchString);
     103      this.tabReplace.Controls.Add(this.lblSearch);
     104      this.tabReplace.Controls.Add(this.btnFindAll);
     105      this.tabReplace.Controls.Add(this.btnFindNext);
     106      this.tabReplace.Controls.Add(this.lblValue);
     107      this.tabReplace.Controls.Add(this.btnReplaceAll);
     108      this.tabReplace.Controls.Add(this.btnReplaceNext);
     109      this.tabReplace.Controls.Add(this.cmbReplaceWith);
     110      this.tabReplace.Controls.Add(this.txtValue);
     111      this.tabReplace.Controls.Add(this.label1);
    97112      this.tabReplace.Location = new System.Drawing.Point(4, 22);
    98113      this.tabReplace.Name = "tabReplace";
    99114      this.tabReplace.Padding = new System.Windows.Forms.Padding(3);
    100       this.tabReplace.Size = new System.Drawing.Size(503, 148);
     115      this.tabReplace.Size = new System.Drawing.Size(556, 109);
    101116      this.tabReplace.TabIndex = 1;
    102117      this.tabReplace.Text = "Replace";
    103118      this.tabReplace.UseVisualStyleBackColor = true;
    104119      //
     120      // lblValue
     121      //
     122      this.lblValue.AutoSize = true;
     123      this.lblValue.Location = new System.Drawing.Point(64, 76);
     124      this.lblValue.Name = "lblValue";
     125      this.lblValue.Size = new System.Drawing.Size(34, 13);
     126      this.lblValue.TabIndex = 19;
     127      this.lblValue.Text = "Value";
     128      //
     129      // btnReplaceAll
     130      //
     131      this.btnReplaceAll.Location = new System.Drawing.Point(458, 47);
     132      this.btnReplaceAll.Name = "btnReplaceAll";
     133      this.btnReplaceAll.Size = new System.Drawing.Size(80, 23);
     134      this.btnReplaceAll.TabIndex = 18;
     135      this.btnReplaceAll.Text = "Replace All";
     136      this.btnReplaceAll.UseVisualStyleBackColor = true;
     137      //
     138      // btnReplaceNext
     139      //
     140      this.btnReplaceNext.Location = new System.Drawing.Point(372, 47);
     141      this.btnReplaceNext.Name = "btnReplaceNext";
     142      this.btnReplaceNext.Size = new System.Drawing.Size(80, 23);
     143      this.btnReplaceNext.TabIndex = 17;
     144      this.btnReplaceNext.Text = "Replace Next";
     145      this.btnReplaceNext.UseVisualStyleBackColor = true;
     146      //
     147      // cmbReplaceWith
     148      //
     149      this.cmbReplaceWith.FormattingEnabled = true;
     150      this.cmbReplaceWith.Location = new System.Drawing.Point(103, 46);
     151      this.cmbReplaceWith.Name = "cmbReplaceWith";
     152      this.cmbReplaceWith.Size = new System.Drawing.Size(254, 21);
     153      this.cmbReplaceWith.TabIndex = 16;
     154      //
     155      // txtValue
     156      //
     157      this.txtValue.Location = new System.Drawing.Point(103, 73);
     158      this.txtValue.Name = "txtValue";
     159      this.txtValue.Size = new System.Drawing.Size(254, 20);
     160      this.txtValue.TabIndex = 15;
     161      //
     162      // label1
     163      //
     164      this.label1.AutoSize = true;
     165      this.label1.Location = new System.Drawing.Point(28, 49);
     166      this.label1.Name = "label1";
     167      this.label1.Size = new System.Drawing.Size(69, 13);
     168      this.label1.TabIndex = 14;
     169      this.label1.Text = "Replace with";
     170      //
    105171      // FindAndReplaceDialog
    106172      //
    107173      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    108174      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    109       this.ClientSize = new System.Drawing.Size(532, 197);
     175      this.ClientSize = new System.Drawing.Size(588, 159);
    110176      this.Controls.Add(this.tabSearchReplace);
    111177      this.Name = "FindAndReplaceDialog";
    112       this.Text = "FindAndReplaceDialog";
     178      this.Text = "Find and Replace";
    113179      this.tabSearchReplace.ResumeLayout(false);
    114       this.tabSearch.ResumeLayout(false);
    115       this.tabSearch.PerformLayout();
     180      this.tabReplace.ResumeLayout(false);
     181      this.tabReplace.PerformLayout();
    116182      this.ResumeLayout(false);
    117183
     
    123189    private System.Windows.Forms.TabPage tabSearch;
    124190    private System.Windows.Forms.TabPage tabReplace;
     191    private System.Windows.Forms.TextBox txtSearchString;
     192    private System.Windows.Forms.Label lblSearch;
    125193    private System.Windows.Forms.Button btnFindAll;
    126194    private System.Windows.Forms.Button btnFindNext;
    127     private System.Windows.Forms.TextBox txtSearchString;
    128     private System.Windows.Forms.Label lblSearch;
     195    private System.Windows.Forms.Label lblValue;
     196    private System.Windows.Forms.Button btnReplaceAll;
     197    private System.Windows.Forms.Button btnReplaceNext;
     198    private System.Windows.Forms.ComboBox cmbReplaceWith;
     199    private System.Windows.Forms.TextBox txtValue;
     200    private System.Windows.Forms.Label label1;
    129201  }
    130202}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/FindAndReplaceDialog.cs

    r10633 r10636  
    1 using System.Windows.Forms;
     1using System;
     2using System.Windows.Forms;
    23
    34namespace HeuristicLab.DataPreprocessing.Views {
     
    56    public FindAndReplaceDialog() {
    67      InitializeComponent();
     8      string[] cmbItems = { "Value", "Average", "Median", "Random", "Most Common", "Interpolation" };
     9      cmbReplaceWith.Items.AddRange(cmbItems);
    710    }
    811
    912    public void ActivateSearch() {
    1013      tabSearch.Focus();
     14      AddControlsToCurrentTab();
    1115    }
    1216
    1317    public void ActivateReplace() {
    1418      tabReplace.Focus();
     19      AddControlsToCurrentTab();
    1520    }
    1621
    17     private void tabControl1_SelectedIndexChanged(object sender, System.EventArgs e) {
    18       if (sender is TabControl) {
    19         TabControl tc = (TabControl)sender;
    20         tc.SelectedTab.Controls.Add(btnFindAll);
    21         tc.SelectedTab.Controls.Add(btnFindNext);
    22         tc.SelectedTab.Controls.Add(lblSearch);
    23         tc.SelectedTab.Controls.Add(txtSearchString);
    24       }
     22    private void tabSearchReplace_SelectedIndexChanged(object sender, System.EventArgs e) {
     23      AddControlsToCurrentTab();
    2524    }
    2625
     26    private void AddControlsToCurrentTab() {
     27      tabSearchReplace.SelectedTab.Controls.Add(btnFindAll);
     28      tabSearchReplace.SelectedTab.Controls.Add(btnFindNext);
     29      tabSearchReplace.SelectedTab.Controls.Add(lblSearch);
     30      tabSearchReplace.SelectedTab.Controls.Add(txtSearchString);
     31    }
     32
     33    public string GetSearchText() {
     34      return txtSearchString.Text;
     35    }
     36
     37    public string GetReplaceText() {
     38      return txtValue.Text;
     39    }
     40
     41    public string GetReplaceAction() {
     42      return cmbReplaceWith.SelectedText;
     43    }
     44
     45    public event EventHandler FindAllEvent {
     46      add { btnFindAll.Click += value; }
     47      remove { btnFindAll.Click -= value; }
     48    }
     49
     50    public event EventHandler FindNextEvent {
     51      add { btnFindNext.Click += value; }
     52      remove { btnFindNext.Click -= value; }
     53    }
     54
     55    public event EventHandler ReplaceAllEvent {
     56      add { btnReplaceAll.Click += value; }
     57      remove { btnReplaceAll.Click -= value; }
     58    }
     59
     60    public event EventHandler ReplaceNextEvent {
     61      add { btnReplaceNext.Click += value; }
     62      remove { btnReplaceNext.Click -= value; }
     63    }
     64     
    2765  }
    2866}
Note: See TracChangeset for help on using the changeset viewer.