diff options
author | prep <prep@lindenlab.com> | 2011-03-10 12:10:29 -0500 |
---|---|---|
committer | prep <prep@lindenlab.com> | 2011-03-10 12:10:29 -0500 |
commit | 55dbd0c4f3c1cc3598d3d8428dea4a2645b211c4 (patch) | |
tree | b7b67fd048fda99511042040cf91ac2ae309e728 /indra/llui/llcombobox.cpp | |
parent | 79664c1017175b2cdfdc4b16c5894bdfdf6e8188 (diff) | |
parent | ca610bfc82e9f150877efa7e8c4e972d47bce7d4 (diff) |
merge
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(); |