aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/render/RenderObject.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/ui/render/RenderObject.hpp')
-rw-r--r--include/cru/ui/render/RenderObject.hpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/cru/ui/render/RenderObject.hpp b/include/cru/ui/render/RenderObject.hpp
index 09f140db..2d9cd817 100644
--- a/include/cru/ui/render/RenderObject.hpp
+++ b/include/cru/ui/render/RenderObject.hpp
@@ -121,7 +121,7 @@ class RenderObject : public Object {
// This will set offset of this render object and call OnLayoutCore.
void Layout(const Point& offset);
- virtual void Draw(platform::graph::IPainter* painter) = 0;
+ void Draw(platform::graph::IPainter* painter);
// Param point must be relative the lefttop of render object including margin.
// Add offset before pass point to children.
@@ -145,6 +145,17 @@ class RenderObject : public Object {
// default is to invalidate both layout and paint
virtual void OnRemoveChild(RenderObject* removed_child, Index position);
+ // Draw all children with offset.
+ void DefaultDrawChildren(platform::graph::IPainter* painter);
+
+ // Draw all children with translation of content rect lefttop.
+ void DefaultDrawContent(platform::graph::IPainter* painter);
+
+ // Call DefaultDrawContent. Then call DefaultDrawChildren.
+ virtual void OnDrawCore(platform::graph::IPainter* painter);
+
+ virtual void OnDrawContent(platform::graph::IPainter* painter);
+
// Size measure including margin and padding. Please reduce margin and padding
// or other custom things and pass the result content measure requirement and
// preferred size to OnMeasureContent. Return value must not be negative and