Exemple #1
0
void Container::DisableChildren()
{
	for (std::vector< RefCountedPtr<Widget> >::iterator i = m_widgets.begin(); i != m_widgets.end(); ++i) {
		Widget *w = (*i).Get();
		w->SetDisabled(true);
		Container *c = dynamic_cast<Container*>(w);
		if (c) c->DisableChildren();
	}
}
Exemple #2
0
void Container::EnableChildren()
{
	for (std::vector< RefCountedPtr<Widget> >::iterator i = m_widgets.begin(); i != m_widgets.end(); ++i) {
		Widget *w = (*i).Get();
		w->SetDisabled(false);
		if (w->IsContainer()) {
			static_cast<Container*>(w)->EnableChildren();
		}
	}
}