diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 0e6a4514c..eb5362a88 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -754,12 +754,16 @@ BOOL LLPanel::childHasFocus(const std::string& id) } } -void LLPanel::childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*, void*), void *userdata ) +// *TODO: Deprecate; for backwards compatability only: +// Prefer getChild("foo")->setCommitCallback(boost:bind(...)), +// which takes a generic slot. Or use mCommitCallbackRegistrar.add() with +// a named callback and reference it in XML. +void LLPanel::childSetCommitCallback(const std::string& id, boost::function cb, void* data) { - LLUICtrl* child = getChild(id, true); + LLUICtrl* child = findChild(id); if (child) { - child->setCommitCallback(cb, userdata); + child->setCommitCallback(boost::bind(cb, child, data)); } } diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 3080eb594..eac7d12a8 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -170,7 +170,12 @@ public: void childSetFocus(const std::string& id, BOOL focus = TRUE); BOOL childHasFocus(const std::string& id); - void childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*, void*), void* userdata = NULL ); + // *TODO: Deprecate; for backwards compatability only: + // Prefer getChild("foo")->setCommitCallback(boost:bind(...)), + // which takes a generic slot. Or use mCommitCallbackRegistrar.add() with + // a named callback and reference it in XML. + void childSetCommitCallback(const std::string& id, boost::function cb, void* data = NULL); + void childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void*) ); void childSetColor(const std::string& id, const LLColor4& color);