metaforce/Runtime/GuiSys/CGuiCompoundWidget.cpp

36 lines
1.0 KiB
C++
Raw Normal View History

#include "Runtime/GuiSys/CGuiCompoundWidget.hpp"
2016-03-16 03:37:51 +00:00
2021-04-10 08:42:06 +00:00
namespace metaforce {
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
}
2021-04-10 08:42:06 +00:00
} // namespace metaforce