when the last child is removed,
clear the isExpanded flag.
(looks ugly, because the [-] icon is no
longer shown, and the item cannot be compressed
again).
--- a/HierarchicalItem.st Thu Oct 06 12:58:18 2005 +0200
+++ b/HierarchicalItem.st Thu Oct 06 13:52:05 2005 +0200
@@ -616,17 +616,21 @@
"remove the children from startIndex up to and including
the child under stopIndex.
"
- |noChildren stop|
+ |nrOfChildren stop|
- noChildren := children size.
+ nrOfChildren := children size.
- (startIndex <= stopIndex and:[startIndex <= noChildren]) ifTrue:[
- stop := stopIndex min:noChildren.
+ (startIndex <= stopIndex and:[startIndex <= nrOfChildren]) ifTrue:[
+ stop := stopIndex min:nrOfChildren.
self criticalDo:[
self basicRemoveFromIndex:startIndex toIndex:stop
]
].
+
+ children size == 0 ifTrue:[
+ isExpanded := false.
+ ].
!
removeIndex:anIndex
@@ -1893,5 +1897,5 @@
!HierarchicalItem class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalItem.st,v 1.72 2005-10-05 12:14:10 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalItem.st,v 1.73 2005-10-06 11:52:05 cg Exp $'
! !