| View previous topic :: View next topic |
| Author |
Message |
JVines Guest
|
Posted: Mon Sep 25, 2006 8:10 am Post subject: Drag and Drop in TTreeView |
|
|
How can I set TTreeView to allow drag and drop operations? I would like
to be able to drag TTreeNodes from one part of the tree to another. I
would also like to be able to accept nodes from other TTreeViews, as well. |
|
| Back to top |
|
 |
4N Guest
|
Posted: Fri Sep 29, 2006 9:53 pm Post subject: Re: Drag and Drop in TTreeView |
|
|
Set DragMode=Automatic in the properties of the TreeView (in Object
inspector window)
"JVines" <dev_support (AT) phoenixresearch (DOT) biz> ha scritto nel messaggio
news:451760fe$1 (AT) newsgroups (DOT) borland.com...
| Quote: | How can I set TTreeView to allow drag and drop operations? I would like to
be able to drag TTreeNodes from one part of the tree to another. I would
also like to be able to accept nodes from other TTreeViews, as well. |
|
|
| Back to top |
|
 |
JVines Guest
|
Posted: Sat Sep 30, 2006 1:11 am Post subject: Re: Drag and Drop in TTreeView |
|
|
To be honest, the answer to the problem that I was facing is to make
sure that the TTreeView's OnDragOver event was handled in some way, even
if that meant simply placing a single return; statement in the
OnDragOver event handler function. |
|
| Back to top |
|
 |
4N Guest
|
Posted: Sat Sep 30, 2006 9:32 pm Post subject: Re: Drag and Drop in TTreeView |
|
|
The OnDragOver event is needed to accept the dragged object by setting
Accept=true inside it, and you have to set it = true if the source, sent as
pareameter, is the TreeView only.
something like:
Accept=Source->ClassNameIs("TreeView");
inside OnDrop event you receive the source of the drag from wich you
retrieve the currently selected Node which has to be dropped.
"JVines" <dev_support (AT) phoenixresearch (DOT) biz> ha scritto nel messaggio
news:451d7d70$1 (AT) newsgroups (DOT) borland.com...
| Quote: | To be honest, the answer to the problem that I was facing is to make sure
that the TTreeView's OnDragOver event was handled in some way, even if
that meant simply placing a single return; statement in the OnDragOver
event handler function. |
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Sat Sep 30, 2006 11:40 pm Post subject: Re: Drag and Drop in TTreeView |
|
|
"4N" <xxxx (AT) yyyy (DOT) zzz> wrote in message
news:451e9be2 (AT) newsgroups (DOT) borland.com...
| Quote: | Accept=Source->ClassNameIs("TreeView");
|
To accept only the nodes within the same TreeView, you can do this instead:
Accept = (Source == Sender);
Gambit |
|
| Back to top |
|
 |
|