setSelected for ComboBox

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

earthsruler
Quite a regular
Quite a regular
Posts: 74
Joined: Mon Apr 28, 2008 23:21
Location: Australia

setSelected for ComboBox

Postby earthsruler » Wed Jul 16, 2008 23:58

When you call set selected on the combo box, it doesn't simultaneously set the text of the edit box the combo box uses. as a result you have to say something like:


Code: Select all


local item = comboBox:findItemWithText( "OMG", nil )
comboBox:setItemSelectState( item, true )
comboBox:getEditbox():setText( "OMG" )



This should happen automatically when the item is set as selected.

Cheers.
ER.

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

Postby CrazyEddie » Thu Jul 17, 2008 08:18

Hi,

This omission is largely due to the way the Combobox used to be regarded - whereby the list and 'selected item' was only relevant when the list was visible - although I changed my mind about that earlier this year.

Thanks for the report, action will be taken shortly ;)

CE.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Postby Jamarr » Thu Jul 17, 2008 16:54

Confirmed. I didn't even think about mentioning this when I ran into this issue. It's fairly easy to work around, though:

Code: Select all

CEGUI::ListboxItem* pItem = _pCombo->getDropList()->getFirstSelectedItem();
_pCombo->getEditbox()->setText(pItem->getText());


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 11 guests