author | Claus Gittinger <cg@exept.de> |
Thu, 15 Aug 1996 19:47:17 +0200 | |
changeset 234 | da6bb07255b2 |
parent 162 | 8b671f2e31ef |
child 261 | 9a25b39f5320 |
permissions | -rw-r--r-- |
12 | 1 |
" |
2 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
24 | 3 |
All Rights Reserved |
12 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
13 |
"Created: 20.11.1995 / 13:21:17 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
14 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
15 |
SyncedMultiColumnTextView subclass:#TwoColumnTextView |
158 | 16 |
instanceVariableNames:'' |
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Views-Text' |
|
12 | 20 |
! |
21 |
||
234
da6bb07255b2
no borders in labels (2D style)
Claus Gittinger <cg@exept.de>
parents:
162
diff
changeset
|
22 |
!TwoColumnTextView class methodsFor:'documentation'! |
12 | 23 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
24 |
copyright |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
25 |
" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
26 |
COPYRIGHT (c) 1994 by Claus Gittinger |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
27 |
All Rights Reserved |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
28 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
29 |
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:
91
diff
changeset
|
30 |
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:
91
diff
changeset
|
31 |
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:
91
diff
changeset
|
32 |
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:
91
diff
changeset
|
33 |
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:
91
diff
changeset
|
34 |
hereby transferred. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
35 |
" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
36 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
37 |
"Created: 20.11.1995 / 13:21:17 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
38 |
! |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
39 |
|
12 | 40 |
documentation |
41 |
" |
|
42 |
a view showing two texts side-by-side. |
|
43 |
Scrolling is synced, by always scrolling both views. |
|
44 |
This type of view is especially useful to show diff-lists, |
|
91
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
45 |
code-versions, or other one-by-one viewable texts. |
12 | 46 |
|
47 |
Usually, it does not make much sense, to put totally different |
|
24 | 48 |
or unrelated texts into this kind of view. |
49 |
||
50 |
See subclass DiffTextView for a real class; |
|
51 |
see ChangesBrowsers compare operation for a real application |
|
52 |
of this kind of views. |
|
162 | 53 |
|
54 |
[see also:] |
|
55 |
DiffTextView |
|
56 |
TextView EditTextView |
|
57 |
||
58 |
[author:] |
|
59 |
Claus Gittinger |
|
12 | 60 |
" |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
61 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
62 |
"Created: 20.11.1995 / 13:21:17 / cg" |
34 | 63 |
! |
64 |
||
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
65 |
examples |
34 | 66 |
" |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
67 |
TwoColumnTextView are currently not directly used by the system. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
68 |
However, it is used as an abstract superclass for DiffTextView. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
69 |
See more examples there. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
70 |
(you may find nice uses for it anyway ...) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
71 |
|
161 | 72 |
[exBegin] |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
73 |
TwoColumnTextView |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
74 |
openOn:('smalltalk.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
75 |
and:('display.rc' asFilename contentsOfEntireFile) |
161 | 76 |
[exEnd] |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
77 |
|
34 | 78 |
|
161 | 79 |
[exBegin] |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
80 |
TwoColumnTextView |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
81 |
openOn:('display.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
82 |
and:('smalltalk.rc' asFilename contentsOfEntireFile) |
161 | 83 |
[exEnd] |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
84 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
85 |
|
161 | 86 |
[exBegin] |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
87 |
TwoColumnTextView |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
88 |
openOn:('smalltalk.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
89 |
label:'smalltalk.rc' |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
90 |
and:('display.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
91 |
label:'display.rc' |
161 | 92 |
[exEnd] |
34 | 93 |
" |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
94 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
95 |
"Created: 20.11.1995 / 13:21:42 / cg" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
96 |
"Modified: 20.11.1995 / 13:23:12 / cg" |
158 | 97 |
! ! |
12 | 98 |
|
234
da6bb07255b2
no borders in labels (2D style)
Claus Gittinger <cg@exept.de>
parents:
162
diff
changeset
|
99 |
!TwoColumnTextView class methodsFor:'instance creation'! |
12 | 100 |
|
101 |
openOn:firstText and:secondText |
|
162 | 102 |
"open up a view showing firstText and secondText side-by-side. |
103 |
This does not make much sense for unrelated texts - of course." |
|
12 | 104 |
|
91
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
105 |
|top v| |
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
106 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
107 |
top := StandardSystemView label:'two texts'. |
91
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
108 |
v := HVScrollableView |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
109 |
for:self |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
110 |
miniScrollerH:true miniScrollerV:false |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
111 |
in:top. |
91
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
112 |
v origin:0.0 @ 0.0 corner:1.0 @ 1.0. |
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
113 |
v scrolledView text1:firstText text2:secondText. |
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
114 |
^ top open |
12 | 115 |
|
91
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
116 |
" |
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
117 |
TwoColumnTextView |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
118 |
openOn:('smalltalk.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
119 |
and:('display.rc' asFilename contentsOfEntireFile) |
91
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
120 |
|
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
121 |
|
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
122 |
TwoColumnTextView |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
123 |
openOn:('display.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
124 |
and:('smalltalk.rc' asFilename contentsOfEntireFile) |
91
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
125 |
" |
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
126 |
|
162 | 127 |
"Modified: 25.4.1996 / 13:31:03 / cg" |
12 | 128 |
! |
129 |
||
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
130 |
openOn:firstText label:firstLabel and:secondText label:secondLabel |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
131 |
"open up a view showing firstText and secondText side-by-side, |
162 | 132 |
and labels for both views. |
133 |
This does not make much sense for unrelated texts - of course." |
|
12 | 134 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
135 |
|top v l1 l2| |
12 | 136 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
137 |
top := StandardSystemView label:'two texts'. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
138 |
l1 := Label label:firstLabel in:top. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
139 |
l1 origin:0.0@0.0 corner:0.5@(l1 height). |
234
da6bb07255b2
no borders in labels (2D style)
Claus Gittinger <cg@exept.de>
parents:
162
diff
changeset
|
140 |
l1 borderWidth:0. |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
141 |
l2 := Label label:secondLabel in:top. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
142 |
l2 origin:0.5@0.0 corner:1.0@(l1 height). |
234
da6bb07255b2
no borders in labels (2D style)
Claus Gittinger <cg@exept.de>
parents:
162
diff
changeset
|
143 |
l2 borderWidth:0. |
12 | 144 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
145 |
v := HVScrollableView |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
146 |
for:self |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
147 |
miniScrollerH:true miniScrollerV:false |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
148 |
in:top. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
149 |
v origin:0.0 @ (l1 height + ViewSpacing) corner:1.0 @ 1.0. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
150 |
v scrolledView text1:firstText text2:secondText. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
151 |
^ top open |
12 | 152 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
153 |
" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
154 |
TwoColumnTextView |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
155 |
openOn:('smalltalk.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
156 |
label:'smalltalk.rc' |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
157 |
and:('display.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
158 |
label:'display.rc' |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
159 |
" |
12 | 160 |
|
234
da6bb07255b2
no borders in labels (2D style)
Claus Gittinger <cg@exept.de>
parents:
162
diff
changeset
|
161 |
"Modified: 15.8.1996 / 19:46:38 / cg" |
12 | 162 |
! ! |
163 |
||
234
da6bb07255b2
no borders in labels (2D style)
Claus Gittinger <cg@exept.de>
parents:
162
diff
changeset
|
164 |
!TwoColumnTextView class methodsFor:'specification'! |
12 | 165 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
166 |
numberOfViews |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
167 |
^ 2 |
12 | 168 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
169 |
"Created: 20.11.1995 / 13:17:00 / cg" |
12 | 170 |
! ! |
171 |
||
172 |
!TwoColumnTextView methodsFor:'accessing'! |
|
173 |
||
174 |
text1:t1 text2:t2 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
175 |
(textViews at:1) list:t1 asText. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
176 |
(textViews at:2) list:t2 asText. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
177 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
178 |
"Created: 20.11.1995 / 13:20:39 / cg" |
12 | 179 |
! ! |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
180 |
|
234
da6bb07255b2
no borders in labels (2D style)
Claus Gittinger <cg@exept.de>
parents:
162
diff
changeset
|
181 |
!TwoColumnTextView class methodsFor:'documentation'! |
158 | 182 |
|
183 |
version |
|
234
da6bb07255b2
no borders in labels (2D style)
Claus Gittinger <cg@exept.de>
parents:
162
diff
changeset
|
184 |
^ '$Header: /cvs/stx/stx/libwidg2/TwoColumnTextView.st,v 1.14 1996-08-15 17:47:17 cg Exp $'! ! |