Hi all!
I'm not sure if this is a bug or a feature. I have a combobox with various items and a method that is called every frame which takes the selected item of the combobox and uses it to calculate stuff. The getSelectedItem function appears to be returning the correct value when the combobox is not expanded. When it is, it will return whatever is under the mouse at that time or nothing if the mouse is not over any item.
So if I have A, B and C in my combobox, select A, expand the list and put the mouse over B without clicking, getSelectedItem will return B. Is this the correct behavior?
[SOLVED]Combobox getSelectedItem
Moderators: CEGUI MVP, CEGUI Team
[SOLVED]Combobox getSelectedItem
Last edited by Tiblanc on Mon Oct 12, 2009 14:33, edited 1 time in total.
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
Re: Combobox getSelectedItem
Hi,
IIRC, this is by design. Being "selected" is merely a visual "true". An actual 'commit' doesn't take place until the user clicks the item, which triggers the CEGUI.Combobox.EventListSelectionAccepted event.
HTH.
IIRC, this is by design. Being "selected" is merely a visual "true". An actual 'commit' doesn't take place until the user clicks the item, which triggers the CEGUI.Combobox.EventListSelectionAccepted event.
HTH.
Check out my released snake game using Cegui!
Re: Combobox getSelectedItem
Alright. If it's not a bug, I'll use this feature instead of creating a child class for my ComboDropList to get the item under the mouse cursor(viewtopic.php?f=10&t=4387). I was not sure if this would be fixed in a future release. That should simplify my code nicely!
Thanks!
Thanks!
Return to “Bug Reports, Suggestions, Feature Requests”
Who is online
Users browsing this forum: No registered users and 5 guests