@@ -117,4 +117,15 @@ bool UIScrollContainer::OnEvent(const tb::TBWidgetEvent &ev)
return UIWidget::OnEvent(ev);
}
+
+void UIScrollContainer::AddChild(UIWidget* child)
+{
+ if (!widget_ || !child || !child->GetInternalWidget() )
+ return;
+ ((TBScrollContainer*) widget_)->GetContentRoot()->AddChild(child->GetInternalWidget());
+}
@@ -65,6 +65,8 @@ public:
void ScrollTo(int x, int y);
+ /// This is overriden to add children to the widget that is being scrolled rather than the container
+ virtual void AddChild(UIWidget* child);
protected: