I have a CEGUI::Tree and I add several ROOT items. Then I add several branches to the ROOT items. My problem is, when a user selects a ROOT item, it will not expand and show the branches (children).
I have stepped through the code and I see the branch items being attached to the root items and I in debug I can see the items but I can't get the root item to expand when selected.
What am I missing?
Root TreeItems will not expand
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi,
I think you have to manually click the "expand" icon/button?
Aside from this, I'm not sure. I do not have a great deal of experience of how this tree works, though I know it's not always "good"; while I agree that "any tree is better than no tree", I totally despise this tree implementation
CE.
I think you have to manually click the "expand" icon/button?
Aside from this, I'm not sure. I do not have a great deal of experience of how this tree works, though I know it's not always "good"; while I agree that "any tree is better than no tree", I totally despise this tree implementation
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi,
Thanks for posting the resolution to the issue, and I'm glad you found it.
I think expanding / collapsing parts of the tree in response to double-clicks is something that should probably be added, unless progress and time pans out such that I am able to provide a decent replacement ready for 0.7.0
CE.
Thanks for posting the resolution to the issue, and I'm glad you found it.
I think expanding / collapsing parts of the tree in response to double-clicks is something that should probably be added, unless progress and time pans out such that I am able to provide a decent replacement ready for 0.7.0
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
-
- Just popping in
- Posts: 5
- Joined: Wed May 20, 2009 03:50
Re: Root TreeItems will not expand
Has this problem been resolved?
I have devoted a lot of time to getting my UI looking decent with CEGUI, only to find that the tree item (which is essential for me) does not work as one expects it to.
Ideally it would expand if you double-clicked anywhere on the tree item, not just the image. However, if I could make the image larger (as it is, to get the aiming right at very high resolutions takes some effort), this problem could at least be alleviated.
I've tried, but to no avail. But I'm not too great with the ".looknfeel" data (I usually just use TeharezLook data and just modify the tga image to get what I want). Is it possible to (a) enlarge the rendered image for the tree items and (b) enlarge the clickable area (I guess these may be the same thing)?
Any help would be appreciated. Thanks.
I have devoted a lot of time to getting my UI looking decent with CEGUI, only to find that the tree item (which is essential for me) does not work as one expects it to.
Ideally it would expand if you double-clicked anywhere on the tree item, not just the image. However, if I could make the image larger (as it is, to get the aiming right at very high resolutions takes some effort), this problem could at least be alleviated.
I've tried, but to no avail. But I'm not too great with the ".looknfeel" data (I usually just use TeharezLook data and just modify the tga image to get what I want). Is it possible to (a) enlarge the rendered image for the tree items and (b) enlarge the clickable area (I guess these may be the same thing)?
Any help would be appreciated. Thanks.
-
- Just popping in
- Posts: 5
- Joined: Wed May 20, 2009 03:50
Re: Root TreeItems will not expand
Also, how do I control the horizontal offset of a child item relative to its parent? Currently the offset is quite large. Besides looking a bit odd, this makes my text length exceeds the width of the container. This forces me to either use a very wide container or put up with a horizontal scrollbar, which I would prefer to avoid.
Re: Root TreeItems will not expand
I'm reviving this thread since it is closely relevant to my situation as well.
I have populated my tree, but it is not expanded by default. I can find no way to accomplish this (though methods or events). So basically, how do I make the tree to be fully expanded programatically?
I have populated my tree, but it is not expanded by default. I can find no way to accomplish this (though methods or events). So basically, how do I make the tree to be fully expanded programatically?
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Root TreeItems will not expand
I found no easy way to do this. You might be able to do something by scanning down the items in the tree and toggling the 'open' state via TreeItem::toggleIsOpen, and then invalidating the window to have it redrawn,or something. Yes this sucks, my total revulsion for this tree is well known - it is truly a travesty of the highest order that this code ever got added to the code base, but alas once there it's more difficult to remove
CE.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Root TreeItems will not expand
Lol, yeah, it is difficult to fail to notice your sentiments regarding this control. As for me, as much as I'd like a better implementation, atm I'm happy I have a tree control at all, since that was what made me throw out OGRE's default version and start using the trunk instead! Still, a decent tree would be lovely!
Anywho, yeah, iterating over the treeitems and calling toggleIsOpen() was the way to go. Thanks for directing me to the solution! Unfortunately toggleIsOpen() does not take parameters so the toggle is just a toggle with no manual means of setting the open/closed state of the branch... O.o Another enjoyable aspect was that you get a node's children by calling the getItemList() member, which is not very self-descriptively named and which returns a LBIitemList datatype, which is not covered in the docs. It turned out to be CEGUI::TreeItem::LBItemList, a typedef for a std::vector of TreeItem pointers.
But I've got the tree expanded at creation time now, and given that this answer's the OP's question, too, I think it is safe to mark this thread as [solved]?
Anywho, yeah, iterating over the treeitems and calling toggleIsOpen() was the way to go. Thanks for directing me to the solution! Unfortunately toggleIsOpen() does not take parameters so the toggle is just a toggle with no manual means of setting the open/closed state of the branch... O.o Another enjoyable aspect was that you get a node's children by calling the getItemList() member, which is not very self-descriptively named and which returns a LBIitemList datatype, which is not covered in the docs. It turned out to be CEGUI::TreeItem::LBItemList, a typedef for a std::vector of TreeItem pointers.
But I've got the tree expanded at creation time now, and given that this answer's the OP's question, too, I think it is safe to mark this thread as [solved]?
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Root TreeItems will not expand
Mikademus wrote:Lol, yeah, it is difficult to fail to notice your sentiments regarding this control. As for me, as much as I'd like a better implementation, atm I'm happy I have a tree control at all, since that was what made me throw out OGRE's default version and start using the trunk instead! Still, a decent tree would be lovely!
Yeah, and we'll get there eventually too It's been ages since I wrote a widget
Mikademus wrote:I think it is safe to mark this thread as [solved]?
Probably, though the OP has to do that
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Who is online
Users browsing this forum: No registered users and 22 guests