diff --git a/sources/ewol/widget/Composer.cpp b/sources/ewol/widget/Composer.cpp index 9d033be7..53541db6 100644 --- a/sources/ewol/widget/Composer.cpp +++ b/sources/ewol/widget/Composer.cpp @@ -107,11 +107,20 @@ void widget::Composer::RegisterOnEventNameWidget(const etk::UString& _subWidgetN const char * _eventId, const char * _eventIdgenerated, const etk::UString& _overloadData) +{ + RegisterOnEventNameWidget(this, _subWidgetName, _eventId, _eventIdgenerated, _overloadData); +} + +void widget::Composer::RegisterOnEventNameWidget(ewol::EObject * _destinationObject, + const etk::UString& _subWidgetName, + const char * _eventId, + const char * _eventIdgenerated, + const etk::UString& _overloadData) { ewol::Widget* tmpWidget = GetWidgetNamed(_subWidgetName); if (NULL != tmpWidget) { //EWOL_DEBUG("Find widget named : \"" << _subWidgetName << "\" register event=\"" << _eventId << "\""); - tmpWidget->RegisterOnEvent(this, _eventId, _eventIdgenerated, _overloadData); + tmpWidget->RegisterOnEvent(_destinationObject, _eventId, _eventIdgenerated, _overloadData); } else { EWOL_WARNING("[" << GetId() << "] {" << GetObjectType() << "} Can not register event : \"" << _eventId << "\" the widget named=\"" << _subWidgetName << "\" does not exist"); } diff --git a/sources/ewol/widget/Composer.h b/sources/ewol/widget/Composer.h index 902964db..56face42 100644 --- a/sources/ewol/widget/Composer.h +++ b/sources/ewol/widget/Composer.h @@ -61,11 +61,26 @@ namespace widget * @param[in] _eventId Event generate inside the object. * @param[in] _eventIdgenerated event generated when call the distant EObject.OnReceiveMessage(...) * @param[in] _overloadData When the user prever to receive a data specificly for this event ... + * @note : To used when herited from this object. */ void RegisterOnEventNameWidget(const etk::UString& _subWidgetName, const char * _eventId, const char * _eventIdgenerated = NULL, const etk::UString& _overloadData=""); + /** + * @brief Register an Event an named widget. @see RegisterOnEvent + * @param[in] _destinationObject pointer on the object that might be call when an event is generated + * @param[in] _subWidgetName Name of the subWidget. + * @param[in] _eventId Event generate inside the object. + * @param[in] _eventIdgenerated event generated when call the distant EObject.OnReceiveMessage(...) + * @param[in] _overloadData When the user prever to receive a data specificly for this event ... + * @note : To used when NOT herited from this object. + */ + void RegisterOnEventNameWidget(ewol::EObject * _destinationObject, + const etk::UString& _subWidgetName, + const char * _eventId, + const char * _eventIdgenerated = NULL, + const etk::UString& _overloadData=""); private: /** * @brief Load a composition with a file.