Removed LLUICtrl::setDoubleClickCallback and LLPanel::childSetDoubleClickCallback as they aren't used/needed and complicate things. Added LLPanel::childSetAction overload that accepts boost::singal2::signal (for boost::bind). Now using boost::function for various callbacks in LLScrollListCtrl (for boost::bind).

This commit is contained in:
Shyotl
2012-12-04 21:54:01 -06:00
parent ca3e0d2ba9
commit ef6f411b70
29 changed files with 82 additions and 103 deletions

View File

@@ -108,23 +108,25 @@ BOOL LLFloaterAvatarPicker::postBuild()
childSetKeystrokeCallback("Edit", editKeystroke, this);
childSetKeystrokeCallback("EditUUID", editKeystroke, this);
childSetAction("Find", onBtnFind, this);
childDisable("Find");
childSetAction("Refresh", onBtnRefresh, this);
childSetCommitCallback("near_me_range", onRangeAdjust, this);
childSetAction("Find", boost::bind(&LLFloaterAvatarPicker::onBtnFind, this));
getChildView("Find")->setEnabled(FALSE);
childSetAction("Refresh", boost::bind(&LLFloaterAvatarPicker::onBtnRefresh, this));
getChild<LLUICtrl>("near_me_range")->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onRangeAdjust, _1, this));
childSetDoubleClickCallback("SearchResults", onBtnSelect);
childSetDoubleClickCallback("NearMe", onBtnSelect);
childSetCommitCallback("SearchResults", onList, this);
childSetCommitCallback("NearMe", onList, this);
childDisable("SearchResults");
LLScrollListCtrl* searchresults = getChild<LLScrollListCtrl>("SearchResults");
searchresults->setDoubleClickCallback( boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
searchresults->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, _1, this));
getChildView("SearchResults")->setEnabled(FALSE);
childSetAction("Select", onBtnSelect, this);
childDisable("Select");
LLScrollListCtrl* nearme = getChild<LLScrollListCtrl>("NearMe");
nearme->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
nearme->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, _1, this));
childSetAction("Cancel", onBtnClose, this);
childSetAction("Select", boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
getChildView("Select")->setEnabled(FALSE);
childSetAction("Cancel", boost::bind(&LLFloaterAvatarPicker::onBtnClose, this));
childSetFocus("Edit");
getChild<LLUICtrl>("Edit")->setFocus(TRUE);
LLPanel* search_panel = getChild<LLPanel>("SearchPanel");
if (search_panel)
@@ -162,10 +164,9 @@ LLFloaterAvatarPicker::~LLFloaterAvatarPicker()
sInstance = NULL;
}
void LLFloaterAvatarPicker::onBtnFind(void* userdata)
void LLFloaterAvatarPicker::onBtnFind()
{
LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata;
if(self) self->find();
find();
}
static void getSelectedAvatarData(const LLScrollListCtrl* from, std::vector<std::string>& avatar_names, std::vector<LLUUID>& avatar_ids)