refator some stuff, button implementation

This commit is contained in:
Eduardo Bart
2011-04-09 16:07:35 -03:00
parent a5cd0bed74
commit 22c4b0976a
20 changed files with 91 additions and 224 deletions

View File

@@ -57,13 +57,20 @@ void UIContainer::render()
UIElement::render();
for(auto it = m_children.begin(); it != m_children.end(); ++it) {
const UIElementPtr& child = (*it);
child->render();
if(child->isVisible())
child->render();
}
}
bool UIContainer::onInputEvent(InputEvent* event)
bool UIContainer::onInputEvent(const InputEvent& event)
{
return false;
bool ret = false;
for(auto it = m_children.begin(); it != m_children.end(); ++it) {
const UIElementPtr& child = (*it);
if(child->isEnabled() && child->isVisible())
ret = child->onInputEvent(event) || ret;
}
return ret;
}
void UIContainer::setActiveElement(UIElementPtr activeElement)