Changeset 3556
- Timestamp:
- 04/29/10 12:59:00 (15 years ago)
- 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 238 238 // OperatorGraphView 239 239 // 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); 240 243 this.AllowDrop = true; 241 244 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); … … 244 247 this.Name = "OperatorGraphView"; 245 248 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);248 249 this.shapeContextMenu.ResumeLayout(false); 249 250 this.splitContainer.Panel1.ResumeLayout(false); -
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphVisualization/OperatorGraphView.cs
r3523 r3556 226 226 227 227 #region drag and drop 228 private void OperatorGraphView_DragEnter (object sender, DragEventArgs e) {228 private void OperatorGraphView_DragEnterOver(object sender, DragEventArgs e) { 229 229 e.Effect = DragDropEffects.None; 230 if (ReadOnly)231 return;232 230 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; 235 237 } 236 238 } … … 239 241 if (e.Effect != DragDropEffects.None) { 240 242 IOperator op = e.Data.GetData("Value") as IOperator; 243 if ((e.Effect & DragDropEffects.Copy) == DragDropEffects.Copy) op = (IOperator)op.Clone(); 241 244 IOperatorShapeInfo shapeInfo = OperatorShapeInfoFactory.CreateOperatorShapeInfo(op); 242 245 Point mouse = new Point(MousePosition.X, MousePosition.Y);
Note: See TracChangeset
for help on using the changeset viewer.