Eliminated redundant selection callback for LLComboBox (mSelectionCallback).
parent
516b2fe7cd
commit
dd4a4409cd
|
|
@ -102,7 +102,6 @@ LLComboBox::LLComboBox(const LLComboBox::Params& p)
|
|||
mMaxChars(p.max_chars),
|
||||
mPrearrangeCallback(p.prearrange_callback()),
|
||||
mTextEntryCallback(p.text_entry_callback()),
|
||||
mSelectionCallback(p.selection_callback()),
|
||||
mListPosition(p.list_position),
|
||||
mLastSelectedIndex(-1)
|
||||
{
|
||||
|
|
@ -706,12 +705,6 @@ void LLComboBox::onItemSelected(const LLSD& data)
|
|||
|
||||
// commit does the reverse, asserting the value in the list
|
||||
onCommit();
|
||||
|
||||
// call the callback if it exists
|
||||
if(mSelectionCallback)
|
||||
{
|
||||
mSelectionCallback(this, data);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL LLComboBox::handleToolTip(S32 x, S32 y, MASK mask)
|
||||
|
|
|
|||
|
|
@ -82,8 +82,7 @@ public:
|
|||
allow_new_values;
|
||||
Optional<S32> max_chars;
|
||||
Optional<commit_callback_t> prearrange_callback,
|
||||
text_entry_callback,
|
||||
selection_callback;
|
||||
text_entry_callback;
|
||||
|
||||
Optional<EPreferredPosition, PreferredPositionValues> list_position;
|
||||
|
||||
|
|
@ -200,7 +199,6 @@ public:
|
|||
|
||||
void setPrearrangeCallback( commit_callback_t cb ) { mPrearrangeCallback = cb; }
|
||||
void setTextEntryCallback( commit_callback_t cb ) { mTextEntryCallback = cb; }
|
||||
void setSelectionCallback( commit_callback_t cb ) { mSelectionCallback = cb; }
|
||||
|
||||
void setButtonVisible(BOOL visible);
|
||||
|
||||
|
|
|
|||
|
|
@ -431,9 +431,9 @@ BOOL LLFloaterUIPreview::postBuild()
|
|||
|
||||
// get pointers to buttons and link to callbacks
|
||||
mLanguageSelection = main_panel_tmp->getChild<LLComboBox>("language_select_combo");
|
||||
mLanguageSelection->setSelectionCallback(boost::bind(&LLFloaterUIPreview::onLanguageComboSelect, this, mLanguageSelection));
|
||||
mLanguageSelection->setCommitCallback(boost::bind(&LLFloaterUIPreview::onLanguageComboSelect, this, mLanguageSelection));
|
||||
mLanguageSelection_2 = main_panel_tmp->getChild<LLComboBox>("language_select_combo_2");
|
||||
mLanguageSelection_2->setSelectionCallback(boost::bind(&LLFloaterUIPreview::onLanguageComboSelect, this, mLanguageSelection));
|
||||
mLanguageSelection_2->setCommitCallback(boost::bind(&LLFloaterUIPreview::onLanguageComboSelect, this, mLanguageSelection));
|
||||
LLPanel* editor_panel_tmp = main_panel_tmp->getChild<LLPanel>("editor_panel");
|
||||
mDisplayFloaterBtn = main_panel_tmp->getChild<LLButton>("display_floater");
|
||||
mDisplayFloaterBtn->setClickedCallback(boost::bind(&LLFloaterUIPreview::onClickDisplayFloater, this, PRIMARY_FLOATER));
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ BOOL LLNavigationBar::postBuild()
|
|||
|
||||
mBtnHome->setClickedCallback(boost::bind(&LLNavigationBar::onHomeButtonClicked, this));
|
||||
|
||||
mCmbLocation->setSelectionCallback(boost::bind(&LLNavigationBar::onLocationSelection, this));
|
||||
mCmbLocation->setCommitCallback(boost::bind(&LLNavigationBar::onLocationSelection, this));
|
||||
|
||||
mSearchComboBox->setCommitCallback(boost::bind(&LLNavigationBar::onSearchCommit, this));
|
||||
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ BOOL LLPanelPlaces::postBuild()
|
|||
notes_editor->setKeystrokeCallback(boost::bind(&LLPanelPlaces::onEditButtonClicked, this));
|
||||
|
||||
LLComboBox* folder_combo = mLandmarkInfo->getChild<LLComboBox>("folder_combo");
|
||||
folder_combo->setSelectionCallback(boost::bind(&LLPanelPlaces::onEditButtonClicked, this));
|
||||
folder_combo->setCommitCallback(boost::bind(&LLPanelPlaces::onEditButtonClicked, this));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ LLSearchComboBox::LLSearchComboBox(const Params&p)
|
|||
setButtonVisible(p.dropdown_button_visible);
|
||||
mTextEntry->setCommitCallback(boost::bind(&LLComboBox::onTextCommit, this, _2));
|
||||
mTextEntry->setKeystrokeCallback(boost::bind(&LLComboBox::onTextEntry, this, _1), NULL);
|
||||
setSelectionCallback(boost::bind(&LLSearchComboBox::onSelectionCommit, this));
|
||||
setCommitCallback(boost::bind(&LLSearchComboBox::onSelectionCommit, this));
|
||||
setPrearrangeCallback(boost::bind(&LLSearchComboBox::onSearchPrearrange, this, _2));
|
||||
mSearchButton->setCommitCallback(boost::bind(&LLSearchComboBox::onTextCommit, this, _2));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue