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)
|
|
|
|
{
|
|
|
|
child->SetIsVisible(true);
|
|
|
|
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)
|
|
|
|
{
|
2016-12-15 22:37:34 +00:00
|
|
|
child->SetIsActive(true);
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|