diff --git a/src/dlangui/widgets/scroll.d b/src/dlangui/widgets/scroll.d index 53c08f67..0d4e8a3a 100644 --- a/src/dlangui/widgets/scroll.d +++ b/src/dlangui/widgets/scroll.d @@ -217,11 +217,19 @@ class ScrollWidgetBase : WidgetGroup, OnScrollHandler { pwidth -= m.left + m.right + p.left + p.right; if (parentHeight != SIZE_UNSPECIFIED) pheight -= m.top + m.bottom + p.top + p.bottom; - if (_hscrollbar) + if (_hscrollbar) { _hscrollbar.measure(pwidth, pheight); - if (_vscrollbar) + } + if (_vscrollbar) { _vscrollbar.measure(pwidth, pheight); + } Point sz = fullContentSize(); + if (_hscrollbar) { + sz.y += _hscrollbar.measuredHeight; + } + if (_vscrollbar) { + sz.x += _vscrollbar.measuredWidth; + } measuredContent(parentWidth, parentHeight, sz.x, sz.y); } diff --git a/src/dlangui/widgets/tree.d b/src/dlangui/widgets/tree.d index e2140dea..435c83e5 100644 --- a/src/dlangui/widgets/tree.d +++ b/src/dlangui/widgets/tree.d @@ -122,6 +122,10 @@ class TreeItem { p = p._parent; return cast(TreeItems)p; } + + void clear() { + _children.clear(); + } @property TreeItem parent() { return _parent; } @property protected TreeItem parent(TreeItem p) { _parent = p; return this; } @@ -197,6 +201,29 @@ class TreeItem { return _parent.topParent; } + + protected int _intParam; + protected Object _objectParam; + + @property int intParam() { + return _intParam; + } + + @property TreeItem intParam(int value) { + _intParam = value; + return this; + } + + @property Object objectParam() { + return _objectParam; + } + + @property TreeItem objectParam(Object value) { + _objectParam = value; + return this; + } + + /// returns true if item has at least one child @property bool hasChildren() { return childCount > 0; } @@ -643,7 +670,7 @@ class TreeWidgetBase : ScrollWidget, OnTreeContentChangeListener, OnTreeStateCh super.layout(rc); } - /// Measure widget according to desired width and height constraints. (Step 1 of two phase layout). + /// Measure widget according to desired width and height constraints. (Step 1 of two phase layout). override void measure(int parentWidth, int parentHeight) { if (visibility == Visibility.Gone) { return;