Fix combobox widget: fire Change signal when the combobox is selected with the keyboard

This commit is contained in:
David Capello 2014-03-29 17:17:06 -03:00
parent 44d3e228fd
commit 7253fa59c5

View File

@ -454,14 +454,9 @@ bool ComboBoxListBox::onProcessMessage(Message* msg)
{
switch (msg->type()) {
case kMouseUpMessage: {
int index = m_comboBox->getSelectedItemIndex();
if (isValidItem(index))
m_comboBox->onChange();
case kMouseUpMessage:
m_comboBox->closeListBox();
return true;
}
case kKeyDownMessage:
if (hasFocus()) {
@ -486,8 +481,10 @@ void ComboBoxListBox::onChangeSelectedItem()
ListBox::onChangeSelectedItem();
int index = getSelectedIndex();
if (isValidItem(index))
if (isValidItem(index)) {
m_comboBox->setSelectedItemIndex(index);
m_comboBox->onChange();
}
}
// When the mouse is clicked we switch the visibility-status of the list-box