[SOLVED]Combobox getSelectedItem

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

User avatar
Tiblanc
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Sun Sep 13, 2009 01:27
Location: Quebec, Canada

[SOLVED]Combobox getSelectedItem

Postby Tiblanc » Sun Oct 11, 2009 22:50

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?
Last edited by Tiblanc on Mon Oct 12, 2009 14:33, edited 1 time in total.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Re: Combobox getSelectedItem

Postby scriptkid » Mon Oct 12, 2009 08:27

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.
Check out my released snake game using Cegui!

User avatar
Tiblanc
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Sun Sep 13, 2009 01:27
Location: Quebec, Canada

Re: Combobox getSelectedItem

Postby Tiblanc » Mon Oct 12, 2009 14:31

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!


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 1 guest