author | Claus Gittinger <cg@exept.de> |
Wed, 08 May 1996 17:00:54 +0200 | |
changeset 168 | 85378c0e7dfc |
parent 158 | 431e38dfc5ab |
child 537 | cd6bc3d8f9f6 |
permissions | -rw-r--r-- |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1 |
" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
101
85422b262e51
my logical size-of-contents changes if any subview changes its contents
Claus Gittinger <cg@exept.de>
parents:
92
diff
changeset
|
3 |
All Rights Reserved |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5 |
This software is furnished under a license and may be used |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6 |
only in accordance with the terms of that license and with the |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
10 |
hereby transferred. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
11 |
" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
12 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
13 |
SimpleView subclass:#SyncedMultiColumnTextView |
158 | 14 |
instanceVariableNames:'textViews' |
15 |
classVariableNames:'' |
|
16 |
poolDictionaries:'' |
|
17 |
category:'Views-Text' |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
18 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
19 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
20 |
!SyncedMultiColumnTextView class methodsFor:'documentation'! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
21 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
22 |
copyright |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
23 |
" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
24 |
COPYRIGHT (c) 1995 by Claus Gittinger |
101
85422b262e51
my logical size-of-contents changes if any subview changes its contents
Claus Gittinger <cg@exept.de>
parents:
92
diff
changeset
|
25 |
All Rights Reserved |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
26 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
27 |
This software is furnished under a license and may be used |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
28 |
only in accordance with the terms of that license and with the |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
29 |
inclusion of the above copyright notice. This software may not |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
30 |
be provided or otherwise made available to, or used by, any |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
31 |
other person. No title to or ownership of the software is |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
32 |
hereby transferred. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
33 |
" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
34 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
35 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
36 |
documentation |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
37 |
" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
38 |
abstract superclass for multi-col textviews. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
39 |
Scrolling is synced, by always scrolling all views. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
40 |
This type of view is especially useful to show diff-lists, |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
41 |
code-versions, or other one-by-one viewable texts. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
42 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
43 |
Usually, it does not make much sense, to put totally different |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
44 |
or unrelated texts into this kind of view. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
45 |
|
102 | 46 |
See concrete examples in subclasses: TwoColumnTextView, DiffTextView etc. |
168 | 47 |
|
48 |
[see also:] |
|
49 |
TwoColumnTextView DiffTextView |
|
50 |
||
51 |
[author:] |
|
52 |
Claus Gittinger |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
53 |
" |
158 | 54 |
! ! |
55 |
||
168 | 56 |
!SyncedMultiColumnTextView class methodsFor:'defaults'! |
57 |
||
58 |
numberOfViews |
|
59 |
"return the number of the synced subViews. |
|
60 |
Usually redefined in subclasses" |
|
61 |
||
62 |
^ 2 |
|
63 |
! |
|
64 |
||
65 |
textViewClass |
|
66 |
"return the type of the synced subViews. |
|
67 |
Can be redefined in subclasses" |
|
68 |
||
69 |
^ TextView |
|
70 |
! ! |
|
71 |
||
158 | 72 |
!SyncedMultiColumnTextView methodsFor:'change & update'! |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
73 |
|
158 | 74 |
update:something with:someArgument from:changedObject |
75 |
"/ |
|
76 |
"/ if any of my views changes its contents, |
|
77 |
"/ I have logically changed my contents -> to give scrollbar |
|
78 |
"/ a chance to update |
|
79 |
"/ |
|
80 |
something == #sizeOfContents ifTrue:[ |
|
81 |
self changed:something |
|
82 |
]. |
|
83 |
||
84 |
"Created: 24.11.1995 / 11:11:22 / cg" |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
85 |
! ! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
86 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
87 |
!SyncedMultiColumnTextView methodsFor:'initialization'! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
88 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
89 |
initialize |
168 | 90 |
|n wEach org crn cls| |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
91 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
92 |
super initialize. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
93 |
|
168 | 94 |
cls := self class textViewClass. |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
95 |
n := self class numberOfViews. |
168 | 96 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
97 |
textViews := Array new:n. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
98 |
wEach := (1 / n) asFloat. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
99 |
org := 0.0. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
100 |
1 to:n do:[:i | |
168 | 101 |
|textView| |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
102 |
|
168 | 103 |
i == n ifTrue:[ |
104 |
crn := 1.0 |
|
105 |
] ifFalse:[ |
|
106 |
crn := org + wEach |
|
107 |
]. |
|
108 |
textView:= cls |
|
109 |
origin:org @ 0.0 |
|
110 |
corner:crn @ 1.0 |
|
111 |
in:self. |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
112 |
|
168 | 113 |
textView borderWidth:1. |
114 |
textView level:0. |
|
115 |
textView addDependent:self. |
|
116 |
textViews at:i put:textView. |
|
117 |
org := org + wEach |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
118 |
]. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
119 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
120 |
"Created: 20.11.1995 / 13:06:16 / cg" |
101
85422b262e51
my logical size-of-contents changes if any subview changes its contents
Claus Gittinger <cg@exept.de>
parents:
92
diff
changeset
|
121 |
"Modified: 24.11.1995 / 11:08:31 / cg" |
85422b262e51
my logical size-of-contents changes if any subview changes its contents
Claus Gittinger <cg@exept.de>
parents:
92
diff
changeset
|
122 |
! ! |
85422b262e51
my logical size-of-contents changes if any subview changes its contents
Claus Gittinger <cg@exept.de>
parents:
92
diff
changeset
|
123 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
124 |
!SyncedMultiColumnTextView methodsFor:'queries'! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
125 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
126 |
heightOfContents |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
127 |
^ textViews inject:0 into:[:maxSoFar :thisView | maxSoFar max:(thisView heightOfContents)] |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
128 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
129 |
"Created: 20.11.1995 / 13:08:25 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
130 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
131 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
132 |
innerHeight |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
133 |
^ textViews inject:0 into:[:maxSoFar :thisView | maxSoFar max:(thisView innerHeight)] |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
134 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
135 |
"Created: 20.11.1995 / 13:08:42 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
136 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
137 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
138 |
innerWidth |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
139 |
^ textViews inject:0 into:[:maxSoFar :thisView | maxSoFar max:(thisView innerWidth)] |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
140 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
141 |
"Created: 20.11.1995 / 13:08:49 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
142 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
143 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
144 |
widthOfContents |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
145 |
^ textViews inject:0 into:[:maxSoFar :thisView | maxSoFar max:(thisView widthOfContents)] |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
146 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
147 |
"Created: 20.11.1995 / 13:08:59 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
148 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
149 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
150 |
xOriginOfContents |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
151 |
^ textViews inject:0 into:[:maxSoFar :thisView | maxSoFar max:(thisView xOriginOfContents)] |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
152 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
153 |
"Created: 20.11.1995 / 13:09:11 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
154 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
155 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
156 |
yOriginOfContents |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
157 |
^ textViews inject:0 into:[:maxSoFar :thisView | maxSoFar max:(thisView yOriginOfContents)] |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
158 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
159 |
"Created: 20.11.1995 / 13:09:18 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
160 |
! ! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
161 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
162 |
!SyncedMultiColumnTextView methodsFor:'scrolling'! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
163 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
164 |
scrollDown |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
165 |
self scrollDown:1. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
166 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
167 |
"Created: 20.11.1995 / 13:01:16 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
168 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
169 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
170 |
scrollDown:nLines |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
171 |
textViews do:[:thisView | thisView scrollDown:nLines]. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
172 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
173 |
"Created: 20.11.1995 / 13:09:40 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
174 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
175 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
176 |
scrollHorizontalToPercent:p |
102 | 177 |
"since the percentage given is based on the widest text |
178 |
of my subvies, scroll the view containing the widest first, |
|
179 |
and take that scroll-offset for the others." |
|
180 |
||
181 |
|master max x| |
|
182 |
||
183 |
max := 0. |
|
184 |
textViews do:[:thisView | |
|
185 |
|wThis| |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
186 |
|
102 | 187 |
(wThis := thisView widthOfContents) > max ifTrue:[ |
188 |
max := wThis. |
|
189 |
master := thisView |
|
190 |
] |
|
191 |
]. |
|
192 |
master scrollHorizontalToPercent:p. |
|
193 |
x := master viewOrigin x. |
|
194 |
textViews do:[:v | |
|
195 |
v ~~ master ifTrue:[ |
|
196 |
v scrollHorizontalTo:x. |
|
197 |
] |
|
198 |
] |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
199 |
|
102 | 200 |
"Created: 20.11.1995 / 13:14:41 / cg" |
201 |
"Modified: 24.11.1995 / 14:22:27 / cg" |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
202 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
203 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
204 |
scrollLeft |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
205 |
textViews do:[:thisView | thisView scrollLeft]. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
206 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
207 |
"Created: 20.11.1995 / 13:09:40 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
208 |
"Modified: 20.11.1995 / 13:15:45 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
209 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
210 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
211 |
scrollLeft:nPixels |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
212 |
textViews do:[:thisView | thisView scrollLeft:nPixels]. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
213 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
214 |
"Created: 20.11.1995 / 13:09:40 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
215 |
"Modified: 20.11.1995 / 13:15:49 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
216 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
217 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
218 |
scrollRight |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
219 |
textViews do:[:thisView | thisView scrollRight]. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
220 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
221 |
"Created: 20.11.1995 / 13:09:40 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
222 |
"Modified: 20.11.1995 / 13:15:39 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
223 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
224 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
225 |
scrollRight:nPixels |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
226 |
textViews do:[:thisView | thisView scrollRight:nPixels]. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
227 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
228 |
"Created: 20.11.1995 / 13:09:40 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
229 |
"Modified: 20.11.1995 / 13:15:27 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
230 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
231 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
232 |
scrollToLine:lineNr |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
233 |
textViews do:[:thisView | thisView scrollToLine:lineNr]. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
234 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
235 |
"Created: 20.11.1995 / 13:09:40 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
236 |
"Modified: 20.11.1995 / 13:15:07 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
237 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
238 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
239 |
scrollUp |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
240 |
self scrollUp:1. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
241 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
242 |
"Created: 20.11.1995 / 13:01:16 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
243 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
244 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
245 |
scrollUp:nLines |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
246 |
textViews do:[:thisView | thisView scrollUp:nLines]. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
247 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
248 |
"Created: 20.11.1995 / 13:09:40 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
249 |
"Modified: 20.11.1995 / 13:14:51 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
250 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
251 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
252 |
scrollVerticalToPercent:p |
102 | 253 |
"since the percentage given is based on the longest text |
254 |
of my subvies, scroll the view containing the longest first, |
|
255 |
and take that scroll-offset for the others." |
|
256 |
||
257 |
|master max y| |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
258 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
259 |
max := 0. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
260 |
textViews do:[:thisView | |
102 | 261 |
|hThis| |
262 |
||
263 |
(hThis := thisView heightOfContents) > max ifTrue:[ |
|
264 |
max := hThis. |
|
101
85422b262e51
my logical size-of-contents changes if any subview changes its contents
Claus Gittinger <cg@exept.de>
parents:
92
diff
changeset
|
265 |
master := thisView |
85422b262e51
my logical size-of-contents changes if any subview changes its contents
Claus Gittinger <cg@exept.de>
parents:
92
diff
changeset
|
266 |
] |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
267 |
]. |
102 | 268 |
|
269 |
master scrollVerticalToPercent:p. |
|
270 |
y := master firstLineShown. |
|
271 |
||
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
272 |
textViews do:[:v | |
102 | 273 |
v ~~ master ifTrue:[ |
274 |
v scrollToLine:y. |
|
101
85422b262e51
my logical size-of-contents changes if any subview changes its contents
Claus Gittinger <cg@exept.de>
parents:
92
diff
changeset
|
275 |
] |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
276 |
] |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
277 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
278 |
"Created: 20.11.1995 / 13:14:41 / cg" |
102 | 279 |
"Modified: 24.11.1995 / 14:22:19 / cg" |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
280 |
! ! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
281 |
|
158 | 282 |
!SyncedMultiColumnTextView class methodsFor:'documentation'! |
283 |
||
284 |
version |
|
168 | 285 |
^ '$Header: /cvs/stx/stx/libwidg2/SyncedMultiColumnTextView.st,v 1.5 1996-05-08 15:00:54 cg Exp $' |
158 | 286 |
! ! |