metaforce/Runtime/GuiSys/CGuiCompoundWidget.cpp

46 lines
1.0 KiB
C++
Raw Normal View History

2016-03-16 03:37:51 +00:00
#include "CGuiCompoundWidget.hpp"
namespace urde
{
CGuiCompoundWidget::CGuiCompoundWidget(const CGuiWidgetParms& parms)
: CGuiWidget(parms)
{
}
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());
}
CGuiWidget::OnVisibleChange();
2016-03-16 03:37:51 +00:00
}
void CGuiCompoundWidget::OnActiveChange()
2016-03-16 03:37:51 +00:00
{
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
while (child)
{
child->SetIsActive(true);
2016-03-16 03:37:51 +00:00
child = static_cast<CGuiWidget*>(child->GetNextSibling());
}
CGuiWidget::OnActiveChange();
2016-03-16 03:37:51 +00:00
}
CGuiWidget* CGuiCompoundWidget::GetWorkerWidget(int id)
{
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
while (child)
{
if (child->GetWorkerId() == id)
return child;
child = static_cast<CGuiWidget*>(child->GetNextSibling());
}
return nullptr;
}
}