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:
@@ -765,19 +765,6 @@ void LLPanel::childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanel::childSetDoubleClickCallback(const std::string& id, void (*cb)(void*), void *userdata )
|
||||
{
|
||||
LLUICtrl* child = getChild<LLUICtrl>(id, true);
|
||||
if (child)
|
||||
{
|
||||
child->setDoubleClickCallback(cb);
|
||||
if (userdata)
|
||||
{
|
||||
child->setCallbackUserData(userdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanel::childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void*))
|
||||
{
|
||||
LLUICtrl* child = getChild<LLUICtrl>(id, true);
|
||||
@@ -962,7 +949,7 @@ void LLPanel::childSetWrappedText(const std::string& id, const std::string& text
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanel::childSetAction(const std::string& id, void(*function)(void*), void* value)
|
||||
void LLPanel::childSetAction(const std::string& id, boost::function<void(void*)> function, void* value)
|
||||
{
|
||||
LLButton* button = getChild<LLButton>(id);
|
||||
if (button)
|
||||
@@ -971,6 +958,15 @@ void LLPanel::childSetAction(const std::string& id, void(*function)(void*), void
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanel::childSetAction(const std::string& id, const commit_signal_t::slot_type& function)
|
||||
{
|
||||
LLButton* button = getChild<LLButton>(id);
|
||||
if (button)
|
||||
{
|
||||
button->setClickedCallback(function);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanel::childSetActionTextbox(const std::string& id, void(*function)(void*), void* value)
|
||||
{
|
||||
LLTextBox* textbox = getChild<LLTextBox>(id);
|
||||
|
||||
Reference in New Issue
Block a user