diff options
| author | Oz Linden <oz@lindenlab.com> | 2011-03-13 08:57:53 -0400 |
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2011-03-13 08:57:53 -0400 |
| commit | b7635b6112b7c7fd448aa4400bba2edbf15a5b0a (patch) | |
| tree | 71a591c69a0bae36666e96f9ff23dcc563cbb193 /indra/llui/llcombobox.cpp | |
| parent | c556efbce8e093883a7c7474b1cdac0d53c39cfb (diff) | |
| parent | 522af96acaf07e098e8ce4a3eb9187a5eaeda6d7 (diff) | |
pull transplanted crash fix changesets back from viewer-release
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 8b6a73af56..6f9893b07a 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -316,7 +316,7 @@ void LLComboBox::setValue(const LLSD& value) LLScrollListItem* item = mList->getFirstSelected(); if (item) { - setLabel(getSelectedItemLabel()); + updateLabel(); } mLastSelectedIndex = mList->getFirstSelectedIndex(); } @@ -384,6 +384,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) { @@ -701,13 +718,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(); |
