diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-03-29 10:53:22 -0400 |
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-03-29 10:53:22 -0400 |
| commit | 783eb286a67e6f9ace5561073a16c9c1b7f1ade5 (patch) | |
| tree | 1b4a6d5a81527202860d3cfc217c30d4e1a67880 /indra/llui/llcombobox.cpp | |
| parent | f428d62c93f2cd2817e055fce7db49410e8324d6 (diff) | |
| parent | 61657d2e7904ba7274a0ab5d451669d2ee7bb7cc (diff) | |
merge
Diffstat (limited to 'indra/llui/llcombobox.cpp')
| -rw-r--r-- | indra/llui/llcombobox.cpp | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index c1d512e148..3a8efadaa4 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -706,14 +706,17 @@ void LLComboBox::onListMouseUp() void LLComboBox::onItemSelected(const LLSD& data) { - setValue(data); - - if (mAllowTextEntry && mLastSelectedIndex != -1) + mLastSelectedIndex = getCurrentIndex(); + if (mLastSelectedIndex != -1) { - gFocusMgr.setKeyboardFocus(mTextEntry); - mTextEntry->selectAll(); - } + setLabel(getSelectedItemLabel()); + if (mAllowTextEntry) + { + gFocusMgr.setKeyboardFocus(mTextEntry); + mTextEntry->selectAll(); + } + } // hiding the list reasserts the old value stored in the text editor/dropdown button hideList(); @@ -1080,24 +1083,6 @@ LLIconsComboBox::LLIconsComboBox(const LLIconsComboBox::Params& p) mLabelColumnIndex(p.label_column) {} -void LLIconsComboBox::setValue(const LLSD& value) -{ - BOOL found = mList->selectByValue(value); - if (found) - { - LLScrollListItem* item = mList->getFirstSelected(); - if (item) - { - setLabel(getSelectedItemLabel()); - } - mLastSelectedIndex = mList->getFirstSelectedIndex(); - } - else - { - mLastSelectedIndex = -1; - } -} - const std::string LLIconsComboBox::getSelectedItemLabel(S32 column) const { mButton->setImageOverlay(LLComboBox::getSelectedItemLabel(mIconColumnIndex), mButton->getImageOverlayHAlign()); |
