author | Claus Gittinger <cg@exept.de> |
Mon, 11 Mar 2019 11:49:22 +0100 | |
changeset 6034 | ebfb3c4aa27a |
parent 5808 | 51da0754f9d1 |
permissions | -rw-r--r-- |
5808 | 1 |
"{ Encoding: utf8 }" |
2 |
||
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3 |
" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4 |
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
|
5 |
All Rights Reserved |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7 |
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
|
8 |
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
|
9 |
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
|
10 |
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
|
11 |
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
|
12 |
hereby transferred. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
13 |
" |
2432
ef8c696dd217
care for being asked to scroll, before my subviews are present.
penk
parents:
1384
diff
changeset
|
14 |
"{ Package: 'stx:libwidg2' }" |
ef8c696dd217
care for being asked to scroll, before my subviews are present.
penk
parents:
1384
diff
changeset
|
15 |
|
5808 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
18 |
SimpleView subclass:#SyncedMultiColumnTextView |
3093
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
19 |
instanceVariableNames:'textViewClass textViews scrollLock' |
158 | 20 |
classVariableNames:'' |
21 |
poolDictionaries:'' |
|
22 |
category:'Views-Text' |
|
92
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 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
25 |
!SyncedMultiColumnTextView class methodsFor:'documentation'! |
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 |
copyright |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
28 |
" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
29 |
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
|
30 |
All Rights Reserved |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
31 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
32 |
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
|
33 |
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
|
34 |
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
|
35 |
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
|
36 |
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
|
37 |
hereby transferred. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
38 |
" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
39 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
40 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
41 |
documentation |
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 |
abstract superclass for multi-col textviews. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
44 |
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
|
45 |
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
|
46 |
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
|
47 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
48 |
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
|
49 |
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
|
50 |
|
102 | 51 |
See concrete examples in subclasses: TwoColumnTextView, DiffTextView etc. |
168 | 52 |
|
53 |
[see also:] |
|
54 |
TwoColumnTextView DiffTextView |
|
55 |
||
56 |
[author:] |
|
57 |
Claus Gittinger |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
58 |
" |
158 | 59 |
! ! |
60 |
||
168 | 61 |
!SyncedMultiColumnTextView class methodsFor:'defaults'! |
62 |
||
63 |
numberOfViews |
|
64 |
"return the number of the synced subViews. |
|
65 |
Usually redefined in subclasses" |
|
66 |
||
67 |
^ 2 |
|
68 |
! |
|
69 |
||
70 |
textViewClass |
|
71 |
"return the type of the synced subViews. |
|
72 |
Can be redefined in subclasses" |
|
73 |
||
74 |
^ TextView |
|
75 |
! ! |
|
76 |
||
3093
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
77 |
!SyncedMultiColumnTextView methodsFor:'accessing'! |
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
78 |
|
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
79 |
textViewClass |
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
80 |
textViewClass isNil ifTrue:[ ^ self class textViewClass ]. |
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
81 |
^ textViewClass |
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
82 |
|
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
83 |
"Created: / 06-10-2006 / 14:28:53 / cg" |
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
84 |
! |
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
85 |
|
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
86 |
textViewClass:aClass |
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
87 |
textViewClass := aClass |
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
88 |
|
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
89 |
"Created: / 06-10-2006 / 14:29:04 / cg" |
4125 | 90 |
! |
91 |
||
92 |
textViews |
|
93 |
^ textViews |
|
94 |
||
95 |
"Created: / 08-05-2012 / 14:04:00 / cg" |
|
3093
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
96 |
! ! |
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
97 |
|
158 | 98 |
!SyncedMultiColumnTextView methodsFor:'change & update'! |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
99 |
|
158 | 100 |
update:something with:someArgument from:changedObject |
101 |
"/ |
|
102 |
"/ if any of my views changes its contents, |
|
103 |
"/ I have logically changed my contents -> to give scrollbar |
|
104 |
"/ a chance to update |
|
105 |
"/ |
|
106 |
something == #sizeOfContents ifTrue:[ |
|
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
107 |
self changed:something |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
108 |
]. |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
109 |
|
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
110 |
"/ |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
111 |
"/ if any of my views' changes the origin its contents, |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
112 |
"/ I have logically changed my origin -> give the scrollbar |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
113 |
"/ a chance to update and sync my views. |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
114 |
"/ |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
115 |
something == #originOfContents ifTrue:[ |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
116 |
"/ beware of recursive calls |
4131 | 117 |
scrollLock ifFalse:[ |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
118 |
scrollLock := true. |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
119 |
textViews do:[:v| |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
120 |
v ~~ changedObject ifTrue:[ |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
121 |
v scrollTo:changedObject viewOrigin. |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
122 |
]. |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
123 |
]. |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
124 |
self changed:something. |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
125 |
scrollLock := false. |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
126 |
]. |
3159 | 127 |
^ self. |
158 | 128 |
]. |
3159 | 129 |
super update:something with:someArgument from:changedObject |
158 | 130 |
|
3159 | 131 |
"Created: / 24-11-1995 / 11:11:22 / cg" |
132 |
"Modified: / 25-09-1997 / 11:46:32 / stefan" |
|
4131 | 133 |
"Modified: / 06-06-2012 / 11:04:21 / cg" |
92
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 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
136 |
!SyncedMultiColumnTextView methodsFor:'initialization'! |
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 |
initialize |
168 | 139 |
|n wEach org crn cls| |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
140 |
|
4131 | 141 |
scrollLock := false. |
142 |
||
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
143 |
super initialize. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
144 |
|
3093
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
145 |
cls := self textViewClass. |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
146 |
n := self class numberOfViews. |
168 | 147 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
148 |
textViews := Array new:n. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
149 |
wEach := (1 / n) asFloat. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
150 |
org := 0.0. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
151 |
1 to:n do:[:i | |
168 | 152 |
|textView| |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
153 |
|
168 | 154 |
i == n ifTrue:[ |
155 |
crn := 1.0 |
|
156 |
] ifFalse:[ |
|
157 |
crn := org + wEach |
|
158 |
]. |
|
159 |
textView:= cls |
|
160 |
origin:org @ 0.0 |
|
161 |
corner:crn @ 1.0 |
|
162 |
in:self. |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
163 |
|
168 | 164 |
textView borderWidth:1. |
165 |
textView level:0. |
|
166 |
textView addDependent:self. |
|
167 |
textViews at:i put:textView. |
|
168 |
org := org + wEach |
|
92
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 |
|
3093
84ec3d9dd45c
allow for the textViewClass to be specified
Claus Gittinger <cg@exept.de>
parents:
2432
diff
changeset
|
171 |
"Created: / 20-11-1995 / 13:06:16 / cg" |
4131 | 172 |
"Modified: / 06-06-2012 / 11:04:03 / cg" |
101
85422b262e51
my logical size-of-contents changes if any subview changes its contents
Claus Gittinger <cg@exept.de>
parents:
92
diff
changeset
|
173 |
! ! |
85422b262e51
my logical size-of-contents changes if any subview changes its contents
Claus Gittinger <cg@exept.de>
parents:
92
diff
changeset
|
174 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
175 |
!SyncedMultiColumnTextView methodsFor:'queries'! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
176 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
177 |
heightOfContents |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
178 |
^ 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
|
179 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
180 |
"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
|
181 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
182 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
183 |
innerHeight |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
184 |
^ 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
|
185 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
186 |
"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
|
187 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
188 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
189 |
innerWidth |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
190 |
^ 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
|
191 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
192 |
"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
|
193 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
194 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
195 |
widthOfContents |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
196 |
^ 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
|
197 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
198 |
"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
|
199 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
200 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
201 |
xOriginOfContents |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
202 |
^ 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
|
203 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
204 |
"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
|
205 |
! |
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 |
yOriginOfContents |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
208 |
^ 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
|
209 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
210 |
"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
|
211 |
! ! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
212 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
213 |
!SyncedMultiColumnTextView methodsFor:'scrolling'! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
214 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
215 |
scrollDown:nLines |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
216 |
textViews first scrollDown:nLines. |
92
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 |
"Created: 20.11.1995 / 13:09:40 / cg" |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
219 |
"Modified: 25.9.1997 / 11:39:59 / stefan" |
92
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 |
|
5808 | 222 |
scrollDownLines:nLines |
223 |
textViews first scrollDownLines:nLines. |
|
224 |
||
225 |
"Created: / 13-06-2018 / 21:56:58 / Claus Gittinger" |
|
226 |
! |
|
227 |
||
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
228 |
scrollHorizontalToPercent:p |
102 | 229 |
"since the percentage given is based on the widest text |
230 |
of my subvies, scroll the view containing the widest first, |
|
231 |
and take that scroll-offset for the others." |
|
232 |
||
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
233 |
|master max| |
102 | 234 |
|
235 |
max := 0. |
|
236 |
textViews do:[:thisView | |
|
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
237 |
|wThis| |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
238 |
|
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
239 |
(wThis := thisView widthOfContents) > max ifTrue:[ |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
240 |
max := wThis. |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
241 |
master := thisView |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
242 |
] |
102 | 243 |
]. |
2432
ef8c696dd217
care for being asked to scroll, before my subviews are present.
penk
parents:
1384
diff
changeset
|
244 |
master notNil ifTrue:[ |
ef8c696dd217
care for being asked to scroll, before my subviews are present.
penk
parents:
1384
diff
changeset
|
245 |
master scrollHorizontalToPercent:p. |
ef8c696dd217
care for being asked to scroll, before my subviews are present.
penk
parents:
1384
diff
changeset
|
246 |
]. |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
247 |
|
102 | 248 |
"Created: 20.11.1995 / 13:14:41 / cg" |
249 |
"Modified: 24.11.1995 / 14:22:27 / cg" |
|
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
250 |
"Modified: 25.9.1997 / 11:42:46 / stefan" |
92
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 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
253 |
scrollLeft |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
254 |
textViews first scrollLeft. |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
255 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
256 |
"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
|
257 |
"Modified: 20.11.1995 / 13:15:45 / cg" |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
258 |
"Modified: 25.9.1997 / 11:41:04 / stefan" |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
259 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
260 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
261 |
scrollLeft:nPixels |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
262 |
textViews first scrollLeft:nPixels. |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
263 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
264 |
"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
|
265 |
"Modified: 20.11.1995 / 13:15:49 / cg" |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
266 |
"Modified: 25.9.1997 / 11:41:17 / stefan" |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
267 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
268 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
269 |
scrollRight |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
270 |
textViews first scrollRight. |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
271 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
272 |
"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
|
273 |
"Modified: 20.11.1995 / 13:15:39 / cg" |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
274 |
"Modified: 25.9.1997 / 11:41:30 / stefan" |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
275 |
! |
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 |
scrollRight:nPixels |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
278 |
textViews first scrollRight:nPixels. |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
279 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
280 |
"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
|
281 |
"Modified: 20.11.1995 / 13:15:27 / cg" |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
282 |
"Modified: 25.9.1997 / 11:41:43 / stefan" |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
283 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
284 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
285 |
scrollToLine:lineNr |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
286 |
textViews first scrollToLine:lineNr. |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
287 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
288 |
"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
|
289 |
"Modified: 20.11.1995 / 13:15:07 / cg" |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
290 |
"Modified: 25.9.1997 / 11:41:56 / stefan" |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
291 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
292 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
293 |
scrollUp:nLines |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
294 |
textViews first scrollUp:nLines. |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
295 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
296 |
"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
|
297 |
"Modified: 20.11.1995 / 13:14:51 / cg" |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
298 |
"Modified: 25.9.1997 / 11:42:10 / stefan" |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
299 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
300 |
|
5808 | 301 |
scrollUpLines:nLines |
302 |
textViews first scrollUpLines:nLines. |
|
303 |
||
304 |
"Created: / 13-06-2018 / 21:58:14 / Claus Gittinger" |
|
305 |
! |
|
306 |
||
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
307 |
scrollVerticalToPercent:p |
102 | 308 |
"since the percentage given is based on the longest text |
309 |
of my subvies, scroll the view containing the longest first, |
|
310 |
and take that scroll-offset for the others." |
|
311 |
||
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
312 |
|master max| |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
313 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
314 |
max := 0. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
315 |
textViews do:[:thisView | |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
316 |
|hThis| |
102 | 317 |
|
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
318 |
(hThis := thisView heightOfContents) > max ifTrue:[ |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
319 |
max := hThis. |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
320 |
master := thisView |
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
321 |
] |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
322 |
]. |
102 | 323 |
|
2432
ef8c696dd217
care for being asked to scroll, before my subviews are present.
penk
parents:
1384
diff
changeset
|
324 |
master notNil ifTrue:[ |
ef8c696dd217
care for being asked to scroll, before my subviews are present.
penk
parents:
1384
diff
changeset
|
325 |
master scrollVerticalToPercent:p. |
ef8c696dd217
care for being asked to scroll, before my subviews are present.
penk
parents:
1384
diff
changeset
|
326 |
] |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
327 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
328 |
"Created: 20.11.1995 / 13:14:41 / cg" |
102 | 329 |
"Modified: 24.11.1995 / 14:22:19 / cg" |
537
cd6bc3d8f9f6
Now sync origin of views even when searching or selecting.
Stefan Vogel <sv@exept.de>
parents:
168
diff
changeset
|
330 |
"Modified: 25.9.1997 / 11:42:34 / stefan" |
1384 | 331 |
! |
332 |
||
333 |
verticalScrollStep |
|
3502 | 334 |
"return the amount to scroll when stepping up/down (also used for mouseWheel)." |
335 |
||
1384 | 336 |
^ 1. |
337 |
||
338 |
"Created: / 21.5.1999 / 19:18:09 / cg" |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
339 |
! ! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
340 |
|
158 | 341 |
!SyncedMultiColumnTextView class methodsFor:'documentation'! |
342 |
||
343 |
version |
|
5808 | 344 |
^ '$Header$' |
158 | 345 |
! ! |
5808 | 346 |