Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3556


Ignore:
Timestamp:
04/29/10 12:59:00 (15 years ago)
Author:
mkommend
Message:

corrected drag and drop in operator graph visualization (ticket #867)

Location:
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphVisualization
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphVisualization/OperatorGraphView.Designer.cs

    r3523 r3556  
    238238      // OperatorGraphView
    239239      //
     240      this.DragOver += new System.Windows.Forms.DragEventHandler(this.OperatorGraphView_DragEnterOver);
     241      this.DragDrop += new System.Windows.Forms.DragEventHandler(this.OperatorGraphView_DragDrop);
     242      this.DragEnter += new System.Windows.Forms.DragEventHandler(this.OperatorGraphView_DragEnterOver);
    240243      this.AllowDrop = true;
    241244      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     
    244247      this.Name = "OperatorGraphView";
    245248      this.Size = new System.Drawing.Size(665, 444);
    246       this.DragDrop += new System.Windows.Forms.DragEventHandler(this.OperatorGraphView_DragDrop);
    247       this.DragEnter += new System.Windows.Forms.DragEventHandler(this.OperatorGraphView_DragEnter);
    248249      this.shapeContextMenu.ResumeLayout(false);
    249250      this.splitContainer.Panel1.ResumeLayout(false);
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphVisualization/OperatorGraphView.cs

    r3523 r3556  
    226226
    227227    #region drag and drop
    228     private void OperatorGraphView_DragEnter(object sender, DragEventArgs e) {
     228    private void OperatorGraphView_DragEnterOver(object sender, DragEventArgs e) {
    229229      e.Effect = DragDropEffects.None;
    230       if (ReadOnly)
    231         return;
    232230      Type type = e.Data.GetData("Type") as Type;
    233       if ((type != null) && (typeof(IOperator).IsAssignableFrom(type))) {
    234         e.Effect = DragDropEffects.Copy;
     231      if (!ReadOnly && (type != null) && (typeof(IOperator).IsAssignableFrom(type))) {
     232        if ((e.KeyState & 8) == 8) e.Effect = DragDropEffects.Link;  // CTRL key       
     233        else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move;  // SHIFT key
     234        else if ((e.AllowedEffect & DragDropEffects.Copy) == DragDropEffects.Copy) e.Effect = DragDropEffects.Copy;
     235        else if ((e.AllowedEffect & DragDropEffects.Move) == DragDropEffects.Move) e.Effect = DragDropEffects.Move;
     236        else if ((e.AllowedEffect & DragDropEffects.Link) == DragDropEffects.Link) e.Effect = DragDropEffects.Link;
    235237      }
    236238    }
     
    239241      if (e.Effect != DragDropEffects.None) {
    240242        IOperator op = e.Data.GetData("Value") as IOperator;
     243        if ((e.Effect & DragDropEffects.Copy) == DragDropEffects.Copy) op = (IOperator)op.Clone();
    241244        IOperatorShapeInfo shapeInfo = OperatorShapeInfoFactory.CreateOperatorShapeInfo(op);
    242245        Point mouse = new Point(MousePosition.X, MousePosition.Y);
Note: See TracChangeset for help on using the changeset viewer.