--- a/SimpleView.st Wed Mar 21 12:32:35 2012 +0100
+++ b/SimpleView.st Thu Mar 22 10:40:41 2012 +0100
@@ -4532,50 +4532,54 @@
"Modified: 9.5.1996 / 00:47:16 / cg"
!
-addSubView:newView after:aView
+addSubView:newView after:aViewOrNil
"add a view to the collection of subviews after another view.
+ If the argument aViewOrNil is nil, the newView is added at the end.
This makes sense, in Panels and other layout views, to enter a new
element at some defined place."
subViews isNil ifTrue:[
- subViews := OrderedCollection with:newView
+ subViews := OrderedCollection with:newView
] ifFalse:[
- (subViews includesIdentical:newView) ifTrue:[
- self error:'trying to add a view twice' mayProceed:true.
- ^ self.
- ].
- aView isNil ifTrue:[
- subViews add:newView
- ] ifFalse:[
- subViews add:newView after:aView.
- ]
+ (subViews includesIdentical:newView) ifTrue:[
+ self error:'trying to add a view twice' mayProceed:true.
+ ^ self.
+ ].
+ aViewOrNil isNil ifTrue:[
+ subViews add:newView
+ ] ifFalse:[
+ subViews add:newView after:aViewOrNil.
+ ]
].
self setContainerIn:newView.
- "Modified: 9.5.1996 / 00:47:20 / cg"
-!
-
-addSubView:newView before:aView
+ "Modified: / 09-05-1996 / 00:47:20 / cg"
+ "Modified (comment): / 22-03-2012 / 10:39:04 / cg"
+!
+
+addSubView:newView before:aViewOrNil
"add a view to the collection of subviews before another view.
+ If the argument aViewOrNil is nil, the newView is added at the end.
This makes sense, in Panels and other layout views, to enter a new
element at some defined place."
subViews isNil ifTrue:[
- subViews := OrderedCollection with:newView
+ subViews := OrderedCollection with:newView
] ifFalse:[
- (subViews includesIdentical:newView) ifTrue:[
- self error:'trying to add a view twice' mayProceed:true.
- ^ self.
- ].
- aView isNil ifTrue:[
- subViews addFirst:newView
- ] ifFalse:[
- subViews add:newView before:aView.
- ]
+ (subViews includesIdentical:newView) ifTrue:[
+ self error:'trying to add a view twice' mayProceed:true.
+ ^ self.
+ ].
+ aViewOrNil isNil ifTrue:[
+ subViews addFirst:newView
+ ] ifFalse:[
+ subViews add:newView before:aViewOrNil.
+ ]
].
self setContainerIn:newView.
- "Modified: 9.5.1996 / 00:47:23 / cg"
+ "Modified: / 09-05-1996 / 00:47:23 / cg"
+ "Modified (comment): / 22-03-2012 / 10:39:18 / cg"
!
addSubView:aView in:bounds borderWidth:bw
@@ -10953,11 +10957,11 @@
!SimpleView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.706 2012-03-12 19:32:31 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.707 2012-03-22 09:40:41 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.706 2012-03-12 19:32:31 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.707 2012-03-22 09:40:41 cg Exp $'
!
version_SVN