summaryrefslogtreecommitdiff
path: root/indra/llui/llcombobox.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-03-10 15:46:45 -0800
committerJames Cook <james@lindenlab.com>2010-03-10 15:46:45 -0800
commit60799effaee5dd9696704342e9c8a35881d22583 (patch)
tree28a10ccdc563ca4795d4018270ef36d50a6c3a1c /indra/llui/llcombobox.cpp
parent0ee6a6025cba2f63c5c33c20870f67afd62f6372 (diff)
parent347585cf975afac59ec6b9960e093acd015627f5 (diff)
Merge
Diffstat (limited to 'indra/llui/llcombobox.cpp')
-rw-r--r--indra/llui/llcombobox.cpp41
1 files changed, 9 insertions, 32 deletions
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index c693c18d1a..466332a468 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -700,13 +700,20 @@ void LLComboBox::onListMouseUp()
void LLComboBox::onItemSelected(const LLSD& data)
{
- setValue(data);
+ const std::string name = mList->getSelectedItemLabel();
- if (mAllowTextEntry && mLastSelectedIndex != -1)
+ S32 cur_id = getCurrentIndex();
+ mLastSelectedIndex = cur_id;
+ if (cur_id != -1)
+ {
+ setLabel(name);
+
+ if (mAllowTextEntry)
{
gFocusMgr.setKeyboardFocus(mTextEntry);
mTextEntry->selectAll();
}
+ }
// hiding the list reasserts the old value stored in the text editor/dropdown button
hideList();
@@ -1059,33 +1066,3 @@ BOOL LLComboBox::selectItemRange( S32 first, S32 last )
{
return mList->selectItemRange(first, last);
}
-
-
-static LLDefaultChildRegistry::Register<LLIconsComboBox> register_icons_combo_box("icons_combo_box");
-
-LLIconsComboBox::Params::Params()
-: icon_column("icon_column", ICON_COLUMN),
- label_column("label_column", LABEL_COLUMN)
-{}
-
-LLIconsComboBox::LLIconsComboBox(const LLIconsComboBox::Params& p)
-: LLComboBox(p),
- mIconColumnIndex(p.icon_column),
- mLabelColumnIndex(p.label_column)
-{}
-
-void LLIconsComboBox::setValue(const LLSD& value)
-{
- BOOL found = mList->selectByValue(value);
- if (found)
- {
- LLScrollListItem* item = mList->getFirstSelected();
- if (item)
- {
- mButton->setImageOverlay(mList->getSelectedItemLabel(mIconColumnIndex), mButton->getImageOverlayHAlign());
-
- setLabel(mList->getSelectedItemLabel(mLabelColumnIndex));
- }
- mLastSelectedIndex = mList->getFirstSelectedIndex();
- }
-}