summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorKent Quirk <q@lindenlab.com>2010-03-18 23:44:30 -0400
committerKent Quirk <q@lindenlab.com>2010-03-18 23:44:30 -0400
commita072b63f4106b707ce0cea7826223433f5bba352 (patch)
tree4f1b3ad15b57a58508e0402c2f6cbeb31a4928f8 /indra/llui
parent0c1ff8e8769a569c2551a2be04a18cc854cfc5d4 (diff)
parent1944f64107be98f344824045a19e113966591340 (diff)
Merge of PE merge with extra head
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llcombobox.cpp33
-rw-r--r--indra/llui/llcombobox.h3
-rw-r--r--indra/llui/llsearcheditor.h2
3 files changed, 12 insertions, 26 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());
diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h
index 965061ead2..f0bd432f3a 100644
--- a/indra/llui/llcombobox.h
+++ b/indra/llui/llcombobox.h
@@ -221,7 +221,6 @@ protected:
LLPointer<LLUIImage> mArrowImage;
LLUIString mLabel;
BOOL mHasAutocompletedText;
- S32 mLastSelectedIndex;
private:
BOOL mAllowTextEntry;
@@ -232,6 +231,7 @@ private:
commit_callback_t mTextEntryCallback;
commit_callback_t mSelectionCallback;
boost::signals2::connection mTopLostSignalConnection;
+ S32 mLastSelectedIndex;
};
// A combo box with icons for the list of items.
@@ -247,7 +247,6 @@ public:
Params();
};
- /*virtual*/ void setValue(const LLSD& value);
/*virtual*/ const std::string getSelectedItemLabel(S32 column = 0) const;
private:
diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h
index 714aca9337..785d0633dc 100644
--- a/indra/llui/llsearcheditor.h
+++ b/indra/llui/llsearcheditor.h
@@ -66,6 +66,8 @@ public:
}
};
+ void setCommitOnFocusLost(BOOL b) { if (mSearchEditor) mSearchEditor->setCommitOnFocusLost(b); }
+
protected:
LLSearchEditor(const Params&);
friend class LLUICtrlFactory;