Now Fixed:GuiTreeViewCtrl cannot select single object internally
by Clint S. Brewer · in Torque Game Engine · 11/08/2006 (2:55 pm) · 6 replies
The new GuiTreeViewCtrl has some nice new features using key controls that do not function correctly for objects that support multiple selection
in onKeyDown it checks to see if mItems has only a single item in it, and if so it supports vairous key commands,
However, when I select a single item, mItems always has two items. It appears that two onMouseDowns are getting in to the control, and thus it ends up adding an item twice.
anyone track this down yet?
I'm also really missing the functionality to select a simgroup and have all the children selected so I can move them all as a group.
I'll be tracking these down, but thanks for any tips if you already have!
in onKeyDown it checks to see if mItems has only a single item in it, and if so it supports vairous key commands,
However, when I select a single item, mItems always has two items. It appears that two onMouseDowns are getting in to the control, and thus it ends up adding an item twice.
anyone track this down yet?
I'm also really missing the functionality to select a simgroup and have all the children selected so I can move them all as a group.
I'll be tracking these down, but thanks for any tips if you already have!
About the author
#2
if I click on one,
then shift click a few down so I have many selected.
then ctrl click to remove items, until there is just a single item selected.
it still thinks it has quite a few selected.
perhaps related to adding more than one per selection.
11/08/2006 (3:14 pm)
MSelectItems also behaves wankily when doing multiselect.if I click on one,
then shift click a few down so I have many selected.
then ctrl click to remove items, until there is just a single item selected.
it still thinks it has quite a few selected.
perhaps related to adding more than one per selection.
#3
I am only getting two devices enumerated, the keyboard and the mouse.
11/08/2006 (3:53 pm)
I don't think the problem is related to teh forum post I posted above.I am only getting two devices enumerated, the keyboard and the mouse.
#4
in setItemSelected, at the beginning of the function it adds the item to mSelected then down the function a ways it calls addSelection which ends up pushing the item onto mSelected again
11/08/2006 (4:09 pm)
Ok, I'm crazy there are not two mousedowns being called.in setItemSelected, at the beginning of the function it adds the item to mSelected then down the function a ways it calls addSelection which ends up pushing the item onto mSelected again
#5
in GuiTreeViewCtrl::setItemSelected
a lot of this code looks like it's not supposed to be there, like it duplicates functionality. I wonder if I've messed something up here in between all my versions of TGE and doing this back manual merge :)
anyways, if I comment out the first mSelected.push_front in the if(selected) case at the very beginning, it works better, since addSelection gets called afterwards which will then push it onto mSelected
now... in GuiTreeViewCtrl::addSelection at the very end of the function there is another time where
mSelectedItems.push_front(item) is called.
this is a duplications as it will have already been pushed in the above if/else statements. so commenting that one out, and now yay!
I can use the keyboard to navigate my tree and expand items fully.
that feels so good.
edit: ahh I see I'm confusing mSelectedItems and mSelected a bit here...this fix is not correct...although it does work! I need to go over this all again and do the correct fix...
will post results.
11/08/2006 (6:10 pm)
A couple places..in GuiTreeViewCtrl::setItemSelected
a lot of this code looks like it's not supposed to be there, like it duplicates functionality. I wonder if I've messed something up here in between all my versions of TGE and doing this back manual merge :)
anyways, if I comment out the first mSelected.push_front in the if(selected) case at the very beginning, it works better, since addSelection gets called afterwards which will then push it onto mSelected
now... in GuiTreeViewCtrl::addSelection at the very end of the function there is another time where
mSelectedItems.push_front(item) is called.
this is a duplications as it will have already been pushed in the above if/else statements. so commenting that one out, and now yay!
I can use the keyboard to navigate my tree and expand items fully.
that feels so good.
edit: ahh I see I'm confusing mSelectedItems and mSelected a bit here...this fix is not correct...although it does work! I need to go over this all again and do the correct fix...
will post results.
#6
so when you add the selection,
it will call scrollVisible(item)
which will in turn call
buildVisibleTree
which will in turn call
syncSelection
which will push the item onto mSelectedItems
then back in addSelection,
it will once again push the item onto mSelectedItems
so removing that last mSelectedItems.push_front from GuiTreeViewCtrl.addSelection should be the solution.
testing.... and not quite, ok now I see why my original one worked, and it is the right solution after all.
that first mSelected gets called inside of addSelection also, so removing the one at the top of setItemSelected is a good thing.
not that different...and now for something completely different
11/08/2006 (6:23 pm)
And now for something completely different:so when you add the selection,
it will call scrollVisible(item)
which will in turn call
buildVisibleTree
which will in turn call
syncSelection
which will push the item onto mSelectedItems
then back in addSelection,
it will once again push the item onto mSelectedItems
so removing that last mSelectedItems.push_front from GuiTreeViewCtrl.addSelection should be the solution.
testing.... and not quite, ok now I see why my original one worked, and it is the right solution after all.
that first mSelected gets called inside of addSelection also, so removing the one at the top of setItemSelected is a good thing.
not that different...and now for something completely different
Torque Owner Clint S. Brewer
I thought that this old forum post might be related
http://www.garagegames.com/mg/forums/result.thread.php?qt=11335
that code there didn't quite work for me, but perhaps it is related to the underlying problem of getting two mouse clicks events for every one.