text edit improvments (not finished)

This commit is contained in:
Eduardo Bart
2011-04-14 23:13:53 -03:00
parent e01bd17510
commit f1475c0569
16 changed files with 375 additions and 226 deletions

View File

@@ -111,7 +111,7 @@ void UIContainer::onInputEvent(const InputEvent& event)
}
// mouse events
} else if(event.type & EV_MOUSE) {
// mouse down and weel events only go to elements that contains the mouse position
// mouse down and wheel events only go to elements that contains the mouse position
if(event.type & EV_DOWN || event.type & EV_MOUSE_WHEEL) {
if(child->getRect().contains(event.mousePos)) {
// focus it
@@ -134,7 +134,11 @@ void UIContainer::onInputEvent(const InputEvent& event)
void UIContainer::setFocusedElement(UIElementPtr focusedElement)
{
if(m_focusedElement)
if(m_focusedElement) {
m_focusedElement->setFocused(false);
m_focusedElement->onFocusChange();
}
m_focusedElement = focusedElement;
m_focusedElement->setFocused(true);
m_focusedElement->onFocusChange();
}