metaforce/Runtime/GuiSys/CGuiCompoundWidget.cpp

36 lines
1015 B
C++
Raw Normal View History

#include "Runtime/GuiSys/CGuiCompoundWidget.hpp"
2016-03-16 03:37:51 +00:00
2018-12-08 05:30:43 +00:00
namespace urde {
2016-03-16 03:37:51 +00:00
2018-12-08 05:30:43 +00:00
CGuiCompoundWidget::CGuiCompoundWidget(const CGuiWidgetParms& parms) : CGuiWidget(parms) {}
2016-03-16 03:37:51 +00:00
2018-12-08 05:30:43 +00:00
void CGuiCompoundWidget::OnVisibleChange() {
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
while (child) {
child->SetIsVisible(GetIsVisible());
child = static_cast<CGuiWidget*>(child->GetNextSibling());
}
CGuiWidget::OnVisibleChange();
2016-03-16 03:37:51 +00:00
}
2018-12-08 05:30:43 +00:00
void CGuiCompoundWidget::OnActiveChange() {
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
while (child) {
child->SetIsActive(GetIsActive());
child = static_cast<CGuiWidget*>(child->GetNextSibling());
}
CGuiWidget::OnActiveChange();
2016-03-16 03:37:51 +00:00
}
2018-12-08 05:30:43 +00:00
CGuiWidget* CGuiCompoundWidget::GetWorkerWidget(int id) const {
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
while (child) {
if (child->GetWorkerId() == id)
return child;
child = static_cast<CGuiWidget*>(child->GetNextSibling());
}
return nullptr;
2016-03-16 03:37:51 +00:00
}
2018-12-08 05:30:43 +00:00
} // namespace urde