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 » Restrict drag&drop to one level
Re: Restrict drag&drop to one level [message #26177 is a reply to message #26115] Thu, 08 April 2010 12:58 Go to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I think this selection filter would work better:
	void OnSel() {
		Vector<int> sel = tree.GetSel();
		int level = GetLevel(tree.GetCursor());
		for (int i = 0; i < sel.GetCount(); i++)
			if (GetLevel(sel[i]) != level)
				tree.SelectOne(sel[i], false);
	}

It works with both Ctrl select and Shift select and preserves the most recently selected.

I don't have thwe problem you describe with draggin to root/the bottom of the tree. Have you tested with the latest SVN?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Distorted GUI / memory leak
Next Topic: Suppress drawing the root 0 node
Goto Forum:
  


Current Time: Tue May 07 18:50:17 CEST 2024

Total time taken to generate the page: 0.01892 seconds