aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/controls/TreeView.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/ui/controls/TreeView.h')
-rw-r--r--include/cru/ui/controls/TreeView.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/cru/ui/controls/TreeView.h b/include/cru/ui/controls/TreeView.h
index f4938259..62b1c69b 100644
--- a/include/cru/ui/controls/TreeView.h
+++ b/include/cru/ui/controls/TreeView.h
@@ -48,6 +48,11 @@ class CRU_UI_API TreeViewItem : public Object {
};
class CRU_UI_API TreeView : public Control {
+ friend TreeViewItem;
+
+ private:
+ using Control::AddChild;
+
public:
constexpr static std::string_view kControlType = "TreeView";
@@ -61,11 +66,11 @@ class CRU_UI_API TreeView : public Control {
}
render::TreeRenderObject* GetRenderObject() { return &render_object_; }
- void ForEachChild(const std::function<void(Control*)>& predicate) override;
- void RemoveChild(Control* control) override;
-
TreeViewItem* GetRootItem() { return &root_item_; }
+ protected:
+ void OnChildRemoved(Control* control, Index index) override;
+
private:
render::TreeRenderObject render_object_;
TreeViewItem root_item_;