mirror of https://github.com/buggins/dlangui.git
fix tree view and scroll widget
This commit is contained in:
parent
cc838718ef
commit
55f9a43a2f
|
@ -217,11 +217,19 @@ class ScrollWidgetBase : WidgetGroup, OnScrollHandler {
|
||||||
pwidth -= m.left + m.right + p.left + p.right;
|
pwidth -= m.left + m.right + p.left + p.right;
|
||||||
if (parentHeight != SIZE_UNSPECIFIED)
|
if (parentHeight != SIZE_UNSPECIFIED)
|
||||||
pheight -= m.top + m.bottom + p.top + p.bottom;
|
pheight -= m.top + m.bottom + p.top + p.bottom;
|
||||||
if (_hscrollbar)
|
if (_hscrollbar) {
|
||||||
_hscrollbar.measure(pwidth, pheight);
|
_hscrollbar.measure(pwidth, pheight);
|
||||||
if (_vscrollbar)
|
}
|
||||||
|
if (_vscrollbar) {
|
||||||
_vscrollbar.measure(pwidth, pheight);
|
_vscrollbar.measure(pwidth, pheight);
|
||||||
|
}
|
||||||
Point sz = fullContentSize();
|
Point sz = fullContentSize();
|
||||||
|
if (_hscrollbar) {
|
||||||
|
sz.y += _hscrollbar.measuredHeight;
|
||||||
|
}
|
||||||
|
if (_vscrollbar) {
|
||||||
|
sz.x += _vscrollbar.measuredWidth;
|
||||||
|
}
|
||||||
measuredContent(parentWidth, parentHeight, sz.x, sz.y);
|
measuredContent(parentWidth, parentHeight, sz.x, sz.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,10 @@ class TreeItem {
|
||||||
return cast(TreeItems)p;
|
return cast(TreeItems)p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clear() {
|
||||||
|
_children.clear();
|
||||||
|
}
|
||||||
|
|
||||||
@property TreeItem parent() { return _parent; }
|
@property TreeItem parent() { return _parent; }
|
||||||
@property protected TreeItem parent(TreeItem p) { _parent = p; return this; }
|
@property protected TreeItem parent(TreeItem p) { _parent = p; return this; }
|
||||||
@property string id() { return _id; }
|
@property string id() { return _id; }
|
||||||
|
@ -197,6 +201,29 @@ class TreeItem {
|
||||||
return _parent.topParent;
|
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
|
/// returns true if item has at least one child
|
||||||
@property bool hasChildren() { return childCount > 0; }
|
@property bool hasChildren() { return childCount > 0; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue