Hi
I have a long list of animation keyframes in a listbox. As the animation plays through, each successive keyframe is selected and i want the selected keyframe to be visible in the list.
I'm using ensureItemIsVisible except there is still a problem. This method seems to put the selected item always at the bottom of the list. This can be a problem if, say, the selected item is already visible and/or the user tries to scroll down the list while playing.
That is, if the item is already visible then i don't want the list to scroll (which it does). The list should move only if the item is not already shown.
ListBox ensureItemIsVisible not behaving as expected
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
I was unable to reproduce this issue.
I had a listbox with 10 items, selected items programatically and also called Listbox::ensureItemIsVisible on those items and the behaviour was correct; the list only scrolled as needed to ensure the item was fully displayed.
It would appear that you do in fact have a usage issue (perhaps I should not have assumed a CEGUI bug so quickly!). One way that the list would always scroll to the bottom would be if you used the Listbox::ensureItemIsVisible(size_t item_index) overload with an invalid index value - so that might be worth checking.
If it's not an invalid index value causing the issue, then if you could post some relevant code, hopefully someone will be able to help further.
CE.
PS. Mantis ticket for the bug report is here: http://www.cegui.org.uk/mantis/view.php?id=246 in case we need to re-open
I had a listbox with 10 items, selected items programatically and also called Listbox::ensureItemIsVisible on those items and the behaviour was correct; the list only scrolled as needed to ensure the item was fully displayed.
It would appear that you do in fact have a usage issue (perhaps I should not have assumed a CEGUI bug so quickly!). One way that the list would always scroll to the bottom would be if you used the Listbox::ensureItemIsVisible(size_t item_index) overload with an invalid index value - so that might be worth checking.
If it's not an invalid index value causing the issue, then if you could post some relevant code, hopefully someone will be able to help further.
CE.
PS. Mantis ticket for the bug report is here: http://www.cegui.org.uk/mantis/view.php?id=246 in case we need to re-open
Who is online
Users browsing this forum: No registered users and 7 guests