Changeset 2788


Ignore:
Timestamp:
02/12/10 15:37:36 (11 years ago)
Author:
gkronber
Message:

Removed unnecessary combobox in function library editor. Functions can be dragged in from the right into the allowed sub-functions lists. #873 (FunctionLibraryEditor GUI should be simplified)

Location:
trunk/sources/HeuristicLab.GP/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP/3.3/FunctionLibraryEditor.Designer.cs

    r2729 r2788  
    5454      this.functionDetailsGroupBox = new System.Windows.Forms.GroupBox();
    5555      this.functionDetailsPanel = new System.Windows.Forms.Panel();
    56       this.functionsComboBox = new System.Windows.Forms.ComboBox();
    5756      this.initializationTabPage = new System.Windows.Forms.TabPage();
    5857      this.initSplitContainer = new System.Windows.Forms.SplitContainer();
     
    144143                  | System.Windows.Forms.AnchorStyles.Right)));
    145144      this.functionsListView.Location = new System.Drawing.Point(6, 19);
     145      this.functionsListView.MultiSelect = false;
    146146      this.functionsListView.Name = "functionsListView";
    147147      this.functionsListView.Size = new System.Drawing.Size(218, 475);
     
    150150      this.functionsListView.View = System.Windows.Forms.View.List;
    151151      this.functionsListView.SelectedIndexChanged += new System.EventHandler(this.functionsListView_SelectedIndexChanged);
     152      this.functionsListView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.functionsListView_MouseUp);
    152153      this.functionsListView.KeyUp += new System.Windows.Forms.KeyEventHandler(this.functionsListView_KeyUp);
    153154      this.functionsListView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.functionsListView_ItemDrag);
     
    178179      //
    179180      this.functionDetailsGroupBox.Controls.Add(this.functionDetailsPanel);
    180       this.functionDetailsGroupBox.Controls.Add(this.functionsComboBox);
    181181      this.functionDetailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
    182182      this.functionDetailsGroupBox.Location = new System.Drawing.Point(0, 0);
     
    192192                  | System.Windows.Forms.AnchorStyles.Left)
    193193                  | System.Windows.Forms.AnchorStyles.Right)));
    194       this.functionDetailsPanel.Location = new System.Drawing.Point(6, 46);
     194      this.functionDetailsPanel.Location = new System.Drawing.Point(6, 19);
    195195      this.functionDetailsPanel.Name = "functionDetailsPanel";
    196       this.functionDetailsPanel.Size = new System.Drawing.Size(417, 477);
     196      this.functionDetailsPanel.Size = new System.Drawing.Size(417, 504);
    197197      this.functionDetailsPanel.TabIndex = 7;
    198       //
    199       // functionsComboBox
    200       //
    201       this.functionsComboBox.FormattingEnabled = true;
    202       this.functionsComboBox.Location = new System.Drawing.Point(6, 19);
    203       this.functionsComboBox.Name = "functionsComboBox";
    204       this.functionsComboBox.Size = new System.Drawing.Size(178, 21);
    205       this.functionsComboBox.TabIndex = 0;
    206       this.functionsComboBox.SelectedIndexChanged += new System.EventHandler(this.functionsComboBox_SelectedIndexChanged);
    207198      //
    208199      // initializationTabPage
     
    385376    private System.Windows.Forms.SplitContainer splitContainer;
    386377    private System.Windows.Forms.Panel functionDetailsPanel;
    387     private System.Windows.Forms.ComboBox functionsComboBox;
    388378    private System.Windows.Forms.GroupBox availableFunctionsGroupBox;
    389379    private System.Windows.Forms.GroupBox functionDetailsGroupBox;
  • trunk/sources/HeuristicLab.GP/3.3/FunctionLibraryEditor.cs

    r2729 r2788  
    5757      initListView.Items.Clear();
    5858      functionsListView.Clear();
    59       functionsComboBox.Items.Clear();
    6059      foreach (IFunction fun in FunctionLibrary.Functions) {
    6160        functionsListView.Items.Add(CreateListViewItem(fun));
    62         functionsComboBox.Items.Add(fun);
    6361        if (fun.Manipulator != null) {
    6462          mutationListView.Items.Add(CreateListViewItem(fun));
     
    134132      data.SetData("DragSource", functionsListView);
    135133      DoDragDrop(data, DragDropEffects.Link);
    136     }
    137 
    138     private void functionsComboBox_SelectedIndexChanged(object sender, EventArgs e) {
    139       if (functionsComboBox.SelectedItem != null) {
    140         IFunction selectedFun = (IFunction)functionsComboBox.SelectedItem;
    141         Control funView = (Control)selectedFun.CreateView();
    142         funView.Dock = DockStyle.Fill;
    143         functionDetailsPanel.Controls.Clear();
    144         functionDetailsPanel.Controls.Add(funView);
    145       }
    146134    }
    147135
     
    320308    }
    321309    #endregion
     310
     311    private void functionsListView_MouseUp(object sender, MouseEventArgs e) {
     312      if (functionsListView.SelectedItems.Count > 0) {
     313        IFunction selectedFun = (IFunction)functionsListView.SelectedItems[0].Tag;
     314        Control funView = (Control)selectedFun.CreateView();
     315        funView.Dock = DockStyle.Fill;
     316        functionDetailsPanel.Controls.Clear();
     317        functionDetailsPanel.Controls.Add(funView);
     318      }
     319    }
    322320  }
    323321}
Note: See TracChangeset for help on using the changeset viewer.