diff options
author | Loren Shih <seraph@lindenlab.com> | 2011-03-09 11:24:54 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2011-03-09 11:24:54 -0500 |
commit | c8293e29caf4701f130141a88b90709a09143d4e (patch) | |
tree | fc84848355f3c5d21e3fd6dd1ba2c5eade2d8c03 /indra/llui/llcombobox.cpp | |
parent | 94b0ce6d842a1f34bd46535a8b4db68aa397a541 (diff) | |
parent | 76a325b83271424d231561d8ef099df1406c9517 (diff) |
Automated merge up from viewer-development into mesh-development
Diffstat (limited to 'indra/llui/llcombobox.cpp')
-rw-r--r-- | indra/llui/llcombobox.cpp | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 701d1ff706..a4d1854bc8 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -320,7 +320,7 @@ void LLComboBox::setValue(const LLSD& value) LLScrollListItem* item = mList->getFirstSelected(); if (item) { - setLabel(getSelectedItemLabel()); + updateLabel(); } mLastSelectedIndex = mList->getFirstSelectedIndex(); } @@ -388,6 +388,23 @@ void LLComboBox::setLabel(const LLStringExplicit& name) } } +void LLComboBox::updateLabel() +{ + // Update the combo editor with the selected + // item label. + if (mTextEntry) + { + mTextEntry->setText(getSelectedItemLabel()); + mTextEntry->setTentative(FALSE); + } + + // If combo box doesn't allow text entry update + // the combo button label. + if (!mAllowTextEntry) + { + mButton->setLabel(getSelectedItemLabel()); + } +} BOOL LLComboBox::remove(const std::string& name) { @@ -705,13 +722,13 @@ void LLComboBox::onItemSelected(const LLSD& data) mLastSelectedIndex = getCurrentIndex(); if (mLastSelectedIndex != -1) { - setLabel(getSelectedItemLabel()); + updateLabel(); if (mAllowTextEntry) - { - gFocusMgr.setKeyboardFocus(mTextEntry); - mTextEntry->selectAll(); - } + { + gFocusMgr.setKeyboardFocus(mTextEntry); + mTextEntry->selectAll(); + } } // hiding the list reasserts the old value stored in the text editor/dropdown button hideList(); |