summaryrefslogtreecommitdiff
path: root/indra/llui/llcombobox.cpp
diff options
context:
space:
mode:
authorYuri Chebotarev <ychebotarev@productengine.com>2010-03-26 16:32:38 +0200
committerYuri Chebotarev <ychebotarev@productengine.com>2010-03-26 16:32:38 +0200
commit35b5b5e2a3dceaf98fdf770d971c45b1c80116ed (patch)
tree3f34f5deff668a9a0001f79560b3823dd48d6f49 /indra/llui/llcombobox.cpp
parente962b8418f8a37c1d18743c31199dd9c33d5c74b (diff)
parent379517ce5e1535b20a94ef3a581e1b25223f8798 (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/llui/llcombobox.cpp')
-rw-r--r--indra/llui/llcombobox.cpp33
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());