From 616ebd78b543876388cb3d64f108abea041d4983 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 20 Mar 2019 19:26:55 +0800 Subject: ... --- src/ui/controls/flex_layout.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/ui/controls/flex_layout.cpp (limited to 'src/ui/controls/flex_layout.cpp') diff --git a/src/ui/controls/flex_layout.cpp b/src/ui/controls/flex_layout.cpp new file mode 100644 index 00000000..ebe61a6d --- /dev/null +++ b/src/ui/controls/flex_layout.cpp @@ -0,0 +1,19 @@ +#include "flex_layout.hpp" + +#include "ui/render/flex_layout_render_object.hpp" + +namespace cru::ui::controls { +using render::FlexLayoutRenderObject; + +FlexLayout::FlexLayout() { render_object_ = new FlexLayoutRenderObject(); } + +FlexLayout::~FlexLayout() { delete render_object_; } + +void FlexLayout::OnAddChild(Control* child, int position) { + render_object_->AddChild(child->GetRenderObject(), position); +} + +void FlexLayout::OnRemoveChild(Control* child, int position) { + render_object_->RemoveChild(position); +} +} // namespace cru::ui::controls -- cgit v1.2.3