ListBox ensureItemIsVisible not behaving as expected

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

EvilClown
Just popping in
Just popping in
Posts: 3
Joined: Fri Aug 15, 2008 01:57

ListBox ensureItemIsVisible not behaving as expected

Postby EvilClown » Mon Nov 10, 2008 07:10

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.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Mon Nov 10, 2008 10:13

Hi,

Yes I agree - if the object is already visible no change in scroll position should occur. This is a bug :)

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sun Nov 16, 2008 12:40

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 ;)


Return to “Help”

Who is online

Users browsing this forum: No registered users and 14 guests