Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TreeCtrl » Like the new Drag and Drop TreeCtrl but...
Re: Like the new Drag and Drop TreeCtrl but... [message #11792 is a reply to message #11779] Wed, 26 September 2007 00:14 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
nixnixnix wrote on Tue, 25 September 2007 11:46

Ok, sounds fair.

However I have another question: why is it that the code inside Drag() never gets executed?

	void Drag()
	{
		if(tree.DoDragAndDrop(InternalClip(tree, "mytreedrag"),
		                       tree.GetDragSample()) == DND_MOVE)
		{
			PromptOK("hey");
			tree.RemoveSelection();
		}
	}


I added a PromptOK() as you can see above and it never pops up (I made sure to drag the selection to merely a different position on the same parent so there was no logical conflict).

Does that seems right to you?

I'm guessing that if that function did something it would copy the options across as its a MOVE rather than a copy right?

Nick



Well, this is a little bit tricky situation. And maybe existing solution is not right.

The problem is that if DND returns MOVE, you are in fact supposed to delete the source selection. Which would be wrong here - that is why TreeCtrl::InsertDrop changes the action to COPY if the operation is performed withing single widget.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TreeCtrl Scroll triggers Parent Refresh
Next Topic: hierarchical tree data structure & binding to TreeCtrl
Goto Forum:
  


Current Time: Thu Aug 21 06:07:37 CEST 2025

Total time taken to generate the page: 0.04590 seconds