fix and changes

* win32 compilation fix
* add buttons to miniwindow
* dispatcher events fixes
* ui fixes
This commit is contained in:
Eduardo Bart
2012-03-27 15:14:35 -03:00
parent 060c1cf8e7
commit 8ea154016b
24 changed files with 129 additions and 81 deletions

View File

@@ -35,16 +35,17 @@ void UIHorizontalLayout::applyStyle(const OTMLNodePtr& styleNode)
}
}
void UIHorizontalLayout::internalUpdate()
bool UIHorizontalLayout::internalUpdate()
{
UIWidgetPtr parentWidget = getParentWidget();
if(!parentWidget)
return;
return false;
UIWidgetList widgets = parentWidget->getChildren();
if(m_alignRight)
std::reverse(widgets.begin(), widgets.end());
bool changed = false;
Rect clippingRect = parentWidget->getClippingRect();
Point pos = (m_alignRight) ? clippingRect.topRight() : clippingRect.topLeft();
int prefferedWidth = 0;
@@ -70,7 +71,8 @@ void UIHorizontalLayout::internalUpdate()
pos.y = clippingRect.top() + (clippingRect.height() - size.height())/2;
}
widget->setRect(Rect(pos - parentWidget->getVirtualOffset(), size));
if(widget->setRect(Rect(pos - parentWidget->getVirtualOffset(), size)))
changed = true;
gap = (m_alignRight) ? -widget->getMarginLeft() : (widget->getWidth() + widget->getMarginRight());
gap += m_spacing;
@@ -87,4 +89,6 @@ void UIHorizontalLayout::internalUpdate()
parentWidget->setWidth(prefferedWidth);
});
}
return true;
}