[DEV] add subWidget search with there name

This commit is contained in:
Edouard DUPIN 2014-10-18 08:14:24 +02:00
parent 5309ac7550
commit 2ff07a736e
2 changed files with 28 additions and 0 deletions

View File

@ -266,3 +266,30 @@ void ewol::widget::Windows::requestDestroyFromChild(const std::shared_ptr<Object
markToRedraw();
}
}
std::shared_ptr<ewol::Object> ewol::widget::Windows::getSubObjectNamed(const std::string& _objectName) {
std::shared_ptr<ewol::Object> tmpObject = ewol::Widget::getSubObjectNamed(_objectName);
if (tmpObject != nullptr) {
return tmpObject;
}
// check direct subwidget
if (m_subWidget != nullptr) {
tmpObject = m_subWidget->getSubObjectNamed(_objectName);
if (tmpObject != nullptr) {
return tmpObject;
}
}
// get all subwidget "pop-up"
for (auto &it : m_popUpWidgetList) {
if (it != nullptr) {
tmpObject = it->getSubObjectNamed(_objectName);
if (tmpObject != nullptr) {
return tmpObject;
}
}
}
// not find ...
return nullptr;
}

View File

@ -92,6 +92,7 @@ namespace ewol {
virtual void calculateSize(const vec2& _availlable);
virtual std::shared_ptr<ewol::Widget> getWidgetAtPos(const vec2& _pos);
virtual void requestDestroyFromChild(const std::shared_ptr<Object>& _child);
virtual std::shared_ptr<ewol::Object> getSubObjectNamed(const std::string& _objectName);
void setTitle(const std::string& _title);
public:
enum popUpMessageType {