mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-25 16:32:55 +08:00
Drag and drop feature for Project Explorer
This commit is contained in:
parent
ba16eab570
commit
7917453b19
@ -34,6 +34,7 @@
|
||||
//
|
||||
// ProjectTreeView
|
||||
//
|
||||
this.ProjectTreeView.AllowDrop = true;
|
||||
this.ProjectTreeView.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.ProjectTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.ProjectTreeView.FullRowSelect = true;
|
||||
@ -47,6 +48,8 @@
|
||||
this.ProjectTreeView.BeforeCollapse += new System.Windows.Forms.TreeViewCancelEventHandler(this.ProjectTreeView_BeforeCollapse);
|
||||
this.ProjectTreeView.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.ProjectTreeView_BeforeExpand);
|
||||
this.ProjectTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.ProjectTreeView_AfterSelect);
|
||||
this.ProjectTreeView.DragDrop += new System.Windows.Forms.DragEventHandler(this.ProjectTreeView_DragDrop);
|
||||
this.ProjectTreeView.DragEnter += new System.Windows.Forms.DragEventHandler(this.ProjectTreeView_DragEnter);
|
||||
this.ProjectTreeView.DoubleClick += new System.EventHandler(this.ProjectTreeView_DoubleClick);
|
||||
this.ProjectTreeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ProjectTreeView_MouseDown);
|
||||
//
|
||||
|
@ -2708,6 +2708,20 @@ namespace CodeWalker.Project.Panels
|
||||
{
|
||||
inDoubleClick = (e.Clicks > 1); //disabling doubleclick expand/collapse
|
||||
}
|
||||
|
||||
private void ProjectTreeView_DragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.Data.GetData(DataFormats.FileDrop) != null) //disabling drag and drop text
|
||||
e.Effect = DragDropEffects.All;
|
||||
}
|
||||
|
||||
private void ProjectTreeView_DragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
string[] files = (string[]) e.Data.GetData(DataFormats.FileDrop);
|
||||
ProjectForm.OpenFiles(files);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public delegate void ProjectExplorerItemSelectHandler(object item);
|
||||
public delegate void ProjectExplorerItemActivateHandler(object item);
|
||||
|
Loading…
Reference in New Issue
Block a user