2016-03-16 03:37:51 +00:00
|
|
|
#include "CGuiCompoundWidget.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
|
|
|
|
CGuiCompoundWidget::CGuiCompoundWidget(const CGuiWidgetParms& parms)
|
|
|
|
: CGuiWidget(parms)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-12-15 22:37:34 +00:00
|
|
|
void CGuiCompoundWidget::OnVisibleChange()
|
2016-03-16 03:37:51 +00:00
|
|
|
{
|
|
|
|
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
|
|
|
|
while (child)
|
|
|
|
{
|
2017-01-29 03:58:16 +00:00
|
|
|
child->SetIsVisible(GetIsVisible());
|
2016-03-16 03:37:51 +00:00
|
|
|
child = static_cast<CGuiWidget*>(child->GetNextSibling());
|
|
|
|
}
|
2016-12-15 22:37:34 +00:00
|
|
|
CGuiWidget::OnVisibleChange();
|
2016-03-16 03:37:51 +00:00
|
|
|
}
|
|
|
|
|
2016-12-15 22:37:34 +00:00
|
|
|
void CGuiCompoundWidget::OnActiveChange()
|
2016-03-16 03:37:51 +00:00
|
|
|
{
|
|
|
|
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
|
|
|
|
while (child)
|
|
|
|
{
|
2017-01-29 03:58:16 +00:00
|
|
|
child->SetIsActive(GetIsActive());
|
2016-03-16 03:37:51 +00:00
|
|
|
child = static_cast<CGuiWidget*>(child->GetNextSibling());
|
|
|
|
}
|
2016-12-15 22:37:34 +00:00
|
|
|
CGuiWidget::OnActiveChange();
|
2016-03-16 03:37:51 +00:00
|
|
|
}
|
|
|
|
|
2017-01-09 03:44:00 +00:00
|
|
|
CGuiWidget* CGuiCompoundWidget::GetWorkerWidget(int id) const
|
2016-03-16 03:37:51 +00:00
|
|
|
{
|
|
|
|
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
|
|
|
|
while (child)
|
|
|
|
{
|
|
|
|
if (child->GetWorkerId() == id)
|
|
|
|
return child;
|
|
|
|
child = static_cast<CGuiWidget*>(child->GetNextSibling());
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|