--- a/SimpleView.st Thu May 09 00:05:37 1996 +0200
+++ b/SimpleView.st Thu May 09 01:20:08 1996 +0200
@@ -722,14 +722,16 @@
newView := self basicNew.
aView notNil ifTrue:[
- newView device:(aView device).
- newView superView:aView.
+ newView device:(aView device).
+ newView container:aView.
] ifFalse:[
- newView device:Screen current "Display"
+ newView device:Screen current "Display"
].
newView initialize.
aView notNil ifTrue:[aView addSubView:newView].
^ newView
+
+ "Modified: 9.5.1996 / 00:41:49 / cg"
!
label:label
@@ -2274,6 +2276,15 @@
!SimpleView methodsFor:'accessing-hierarchy'!
+container:aContainer
+ "set my container (i.e. superView) to be aContainer"
+
+ superView := aContainer
+
+ "Created: 9.5.1996 / 00:40:56 / cg"
+ "Modified: 9.5.1996 / 00:45:40 / cg"
+!
+
lower
"bring to back"
@@ -2307,10 +2318,12 @@
subViews := aListOfViews.
subViews notNil ifTrue:[
- subViews do:[:view |
- view superView:self
- ]
+ subViews do:[:view |
+ view container:self
+ ]
]
+
+ "Modified: 9.5.1996 / 00:42:28 / cg"
!
superView
@@ -2322,7 +2335,10 @@
superView:aView
"set my superView to be aView"
- superView := aView
+ self obsoleteMethodWarning:'use #container:'.
+ self container:aView.
+
+ "Modified: 9.5.1996 / 00:46:24 / cg"
!
topView
@@ -2823,25 +2839,29 @@
Dont use this right now for non-views"
aComponent isView ifTrue:[
- self addSubView:aComponent
+ self addSubView:aComponent
] ifFalse:[
- components isNil ifTrue:[
- components := OrderedCollection new
- ].
- components add:aComponent.
- aComponent setParentViewIn:self
+ components isNil ifTrue:[
+ components := OrderedCollection new
+ ].
+ components add:aComponent.
+ aComponent container:self.
]
+
+ "Modified: 9.5.1996 / 00:50:43 / cg"
!
addSubView:newView
"add a view to the collection of subviews"
subViews isNil ifTrue:[
- subViews := OrderedCollection with:newView
+ subViews := OrderedCollection with:newView
] ifFalse:[
- subViews add:newView.
- ].
- self setParentViewIn:newView.
+ subViews add:newView.
+ ].
+ self setContainerIn:newView.
+
+ "Modified: 9.5.1996 / 00:47:16 / cg"
!
addSubView:newView after:aView
@@ -2850,15 +2870,17 @@
element at some defined place."
subViews isNil ifTrue:[
- subViews := OrderedCollection with:newView
+ subViews := OrderedCollection with:newView
] ifFalse:[
- aView isNil ifTrue:[
- subViews add:newView
- ] ifFalse:[
- subViews add:newView after:aView.
- ]
- ].
- self setParentViewIn:newView.
+ aView isNil ifTrue:[
+ subViews add:newView
+ ] ifFalse:[
+ subViews add:newView after:aView.
+ ]
+ ].
+ self setContainerIn:newView.
+
+ "Modified: 9.5.1996 / 00:47:20 / cg"
!
addSubView:newView before:aView
@@ -2867,15 +2889,17 @@
element at some defined place."
subViews isNil ifTrue:[
- subViews := OrderedCollection with:newView
+ subViews := OrderedCollection with:newView
] ifFalse:[
- aView isNil ifTrue:[
- subViews addFirst:newView
- ] ifFalse:[
- subViews add:newView before:aView.
- ]
- ].
- self setParentViewIn:newView.
+ aView isNil ifTrue:[
+ subViews addFirst:newView
+ ] ifFalse:[
+ subViews add:newView before:aView.
+ ]
+ ].
+ self setContainerIn:newView.
+
+ "Modified: 9.5.1996 / 00:47:23 / cg"
!
addSubView:aView in:bounds borderWidth:bw
@@ -2911,11 +2935,13 @@
aComponent origin:0.0@0.0 corner:1.0@1.0.
aComponent isView ifTrue:[
- self addSubView:aComponent
+ self addSubView:aComponent
] ifFalse:[
- components := OrderedCollection with:aComponent.
- aComponent setParentViewIn:self
+ components := OrderedCollection with:aComponent.
+ aComponent container:self
]
+
+ "Modified: 9.5.1996 / 00:51:36 / cg"
!
destroySubViews
@@ -2954,16 +2980,19 @@
]
!
-setParentViewIn:aView
+setContainerIn:aView
"common code for addSubView* methods"
- aView superView:self.
+ aView container:self.
(aView device ~~ device) ifTrue:[
- 'VIEW: warning subview (' errorPrint. aView class name errorPrint.
- ') has different device than me (' errorPrint.
- self class name errorPrint. ').' errorPrintNL.
- aView device:device
+ 'VIEW: warning subview (' errorPrint. aView class name errorPrint.
+ ') has different device than me (' errorPrint.
+ self class name errorPrint. ').' errorPrintNL.
+ aView device:device
]
+
+ "Modified: 9.5.1996 / 00:42:49 / cg"
+ "Created: 9.5.1996 / 00:46:59 / cg"
! !
!SimpleView methodsFor:'change & update'!
@@ -6273,6 +6302,6 @@
!SimpleView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.85 1996-05-08 22:05:37 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.86 1996-05-08 23:20:08 cg Exp $'
! !
SimpleView initialize!