コード例 #1
0
 public static void Detach()
 {
     if (ExprEditorDragDropManager.DragDropManagerInstance == null)
     {
         return;
     }
     ExprEditorDragDropManager.DragDropManagerInstance.Dispose();
     ExprEditorDragDropManager.DragDropManagerInstance = (ExprEditorDragDropManager)null;
 }
コード例 #2
0
 private void listControl_MouseMove(object sender, MouseEventArgs e)
 {
     if (e.Button != MouseButtons.Left || !this.listItemClicked)
     {
         return;
     }
     if (!this.dragging && ExprEditorDragDropManager.IsRealDragging(e.Location, this.downPt))
     {
         RadElement      elementAtPoint  = this.treeControl.ElementTree.GetElementAtPoint(e.Location);
         TreeNodeElement treeNodeElement = elementAtPoint as TreeNodeElement;
         if (treeNodeElement == null && elementAtPoint != null)
         {
             treeNodeElement = elementAtPoint.FindDescendant <TreeNodeElement>();
         }
         if (treeNodeElement == null)
         {
             return;
         }
         this.treeControl.SelectedNode = treeNodeElement.Data;
         this.dragging                      = true;
         this.treeControl.Capture           = true;
         this.treeControl.FindForm().Cursor = Cursors.No;
         this.outlineForm                   = TelerikHelper.CreateOutlineForm();
         this.outlineForm.ShowInTaskbar     = false;
         this.outlineForm.ShowIcon          = false;
         this.outlineForm.BackgroundImage   = (Image)treeNodeElement.GetAsBitmap(Brushes.Transparent, 0.0f, new SizeF(1f, 1f));
         this.outlineForm.FormBorderStyle   = FormBorderStyle.None;
         this.outlineForm.Size              = this.outlineForm.BackgroundImage.Size;
         this.outlineForm.MinimumSize       = this.outlineForm.BackgroundImage.Size;
         this.outlineForm.Location          = new Point(Cursor.Position.X + 2, Cursor.Position.Y + 2);
         this.outlineForm.TopMost           = true;
         this.outlineForm.Show();
     }
     else
     {
         if (!this.dragging)
         {
             return;
         }
         Point mousePosition = Control.MousePosition;
         Point client        = this.treeControl.FindForm().PointToClient(mousePosition);
         this.outlineForm.Location = new Point(mousePosition.X + 5, mousePosition.Y + 5);
         if (this.textBox.Bounds.Contains(client))
         {
             this.treeControl.FindForm().Cursor = Cursors.Arrow;
         }
         else
         {
             this.treeControl.FindForm().Cursor = Cursors.No;
         }
     }
 }
コード例 #3
0
 public static void Attach(RadTreeView listControl, RadTextBox textBox)
 {
     ExprEditorDragDropManager.Detach();
     ExprEditorDragDropManager.DragDropManagerInstance = new ExprEditorDragDropManager(listControl, textBox);
 }