BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Drag and Drop in TTreeView

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
JVines
Guest





PostPosted: Mon Sep 25, 2006 8:10 am    Post subject: Drag and Drop in TTreeView Reply with 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
4N
Guest





PostPosted: Fri Sep 29, 2006 9:53 pm    Post subject: Re: Drag and Drop in TTreeView Reply with quote



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





PostPosted: Sat Sep 30, 2006 1:11 am    Post subject: Re: Drag and Drop in TTreeView Reply with 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
4N
Guest





PostPosted: Sat Sep 30, 2006 9:32 pm    Post subject: Re: Drag and Drop in TTreeView Reply with quote

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





PostPosted: Sat Sep 30, 2006 11:40 pm    Post subject: Re: Drag and Drop in TTreeView Reply with quote

"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.