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 |
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?
|
|
|
Goto Forum:
Current Time: Tue May 07 18:50:17 CEST 2024
Total time taken to generate the page: 0.01892 seconds
|