--- a/SyncedMultiColumnTextView.st Wed May 08 01:16:57 1996 +0200
+++ b/SyncedMultiColumnTextView.st Wed May 08 17:00:54 1996 +0200
@@ -44,9 +44,31 @@
or unrelated texts into this kind of view.
See concrete examples in subclasses: TwoColumnTextView, DiffTextView etc.
+
+ [see also:]
+ TwoColumnTextView DiffTextView
+
+ [author:]
+ Claus Gittinger
"
! !
+!SyncedMultiColumnTextView class methodsFor:'defaults'!
+
+numberOfViews
+ "return the number of the synced subViews.
+ Usually redefined in subclasses"
+
+ ^ 2
+!
+
+textViewClass
+ "return the type of the synced subViews.
+ Can be redefined in subclasses"
+
+ ^ TextView
+! !
+
!SyncedMultiColumnTextView methodsFor:'change & update'!
update:something with:someArgument from:changedObject
@@ -65,32 +87,34 @@
!SyncedMultiColumnTextView methodsFor:'initialization'!
initialize
- |n wEach org crn|
+ |n wEach org crn cls|
super initialize.
+ cls := self class textViewClass.
n := self class numberOfViews.
+
textViews := Array new:n.
wEach := (1 / n) asFloat.
org := 0.0.
1 to:n do:[:i |
- |textView|
+ |textView|
- i == n ifTrue:[
- crn := 1.0
- ] ifFalse:[
- crn := org + wEach
- ].
- textView:= TextView
- origin:org @ 0.0
- corner:crn @ 1.0
- in:self.
+ i == n ifTrue:[
+ crn := 1.0
+ ] ifFalse:[
+ crn := org + wEach
+ ].
+ textView:= cls
+ origin:org @ 0.0
+ corner:crn @ 1.0
+ in:self.
- textView borderWidth:1.
- textView level:0.
- textView addDependent:self.
- textViews at:i put:textView.
- org := org + wEach
+ textView borderWidth:1.
+ textView level:0.
+ textView addDependent:self.
+ textViews at:i put:textView.
+ org := org + wEach
].
"Created: 20.11.1995 / 13:06:16 / cg"
@@ -258,5 +282,5 @@
!SyncedMultiColumnTextView class methodsFor:'documentation'!
version
-^ '$Header: /cvs/stx/stx/libwidg2/SyncedMultiColumnTextView.st,v 1.4 1996-04-25 17:32:23 cg Exp $'
+^ '$Header: /cvs/stx/stx/libwidg2/SyncedMultiColumnTextView.st,v 1.5 1996-05-08 15:00:54 cg Exp $'
! !