author | Claus Gittinger <cg@exept.de> |
Sat, 27 Apr 1996 20:23:13 +0200 | |
changeset 161 | 5b6e284959a4 |
parent 158 | 431e38dfc5ab |
child 162 | 8b671f2e31ef |
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 |
||
22 |
!TwoColumnTextView class methodsFor:'documentation'! |
|
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. |
|
12 | 53 |
" |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
54 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
55 |
"Created: 20.11.1995 / 13:21:17 / cg" |
34 | 56 |
! |
57 |
||
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
58 |
examples |
34 | 59 |
" |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
60 |
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
|
61 |
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
|
62 |
See more examples there. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
63 |
(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
|
64 |
|
161 | 65 |
[exBegin] |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
66 |
TwoColumnTextView |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
67 |
openOn:('smalltalk.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
68 |
and:('display.rc' asFilename contentsOfEntireFile) |
161 | 69 |
[exEnd] |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
70 |
|
34 | 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:('display.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
75 |
and:('smalltalk.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 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
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:('smalltalk.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
82 |
label:'smalltalk.rc' |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
83 |
and:('display.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
84 |
label:'display.rc' |
161 | 85 |
[exEnd] |
34 | 86 |
" |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
87 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
88 |
"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
|
89 |
"Modified: 20.11.1995 / 13:23:12 / cg" |
158 | 90 |
! ! |
12 | 91 |
|
92 |
!TwoColumnTextView class methodsFor:'instance creation'! |
|
93 |
||
94 |
openOn:firstText and:secondText |
|
24 | 95 |
"open up a view showing firstText and secondText side-by-side" |
12 | 96 |
|
91
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
97 |
|top v| |
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
98 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
99 |
top := StandardSystemView label:'two texts'. |
91
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
100 |
v := HVScrollableView |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
101 |
for:self |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
102 |
miniScrollerH:true miniScrollerV:false |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
103 |
in:top. |
91
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
104 |
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
|
105 |
v scrolledView text1:firstText text2:secondText. |
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
106 |
^ top open |
12 | 107 |
|
91
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
108 |
" |
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
109 |
TwoColumnTextView |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
110 |
openOn:('smalltalk.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
111 |
and:('display.rc' asFilename contentsOfEntireFile) |
91
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
112 |
|
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
113 |
|
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
114 |
TwoColumnTextView |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
115 |
openOn:('display.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
116 |
and:('smalltalk.rc' asFilename contentsOfEntireFile) |
91
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
117 |
" |
ef89e1292812
fixes for different text sizes
Claus Gittinger <cg@exept.de>
parents:
86
diff
changeset
|
118 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
119 |
"Modified: 20.11.1995 / 13:36:15 / cg" |
12 | 120 |
! |
121 |
||
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
122 |
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
|
123 |
"open up a view showing firstText and secondText side-by-side, |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
124 |
and labels for both views." |
12 | 125 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
126 |
|top v l1 l2| |
12 | 127 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
128 |
top := StandardSystemView label:'two texts'. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
129 |
l1 := Label label:firstLabel in:top. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
130 |
l1 origin:0.0@0.0 corner:0.5@(l1 height). |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
131 |
l2 := Label label:secondLabel in:top. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
132 |
l2 origin:0.5@0.0 corner:1.0@(l1 height). |
12 | 133 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
134 |
v := HVScrollableView |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
135 |
for:self |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
136 |
miniScrollerH:true miniScrollerV:false |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
137 |
in:top. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
138 |
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
|
139 |
v scrolledView text1:firstText text2:secondText. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
140 |
^ top open |
12 | 141 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
142 |
" |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
143 |
TwoColumnTextView |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
144 |
openOn:('smalltalk.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
145 |
label:'smalltalk.rc' |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
146 |
and:('display.rc' asFilename contentsOfEntireFile) |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
147 |
label:'display.rc' |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
148 |
" |
12 | 149 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
150 |
"Modified: 20.11.1995 / 13:36:20 / cg" |
12 | 151 |
! ! |
152 |
||
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
153 |
!TwoColumnTextView class methodsFor:'specification'! |
12 | 154 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
155 |
numberOfViews |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
156 |
^ 2 |
12 | 157 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
158 |
"Created: 20.11.1995 / 13:17:00 / cg" |
12 | 159 |
! ! |
160 |
||
161 |
!TwoColumnTextView methodsFor:'accessing'! |
|
162 |
||
163 |
text1:t1 text2:t2 |
|
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
164 |
(textViews at:1) list:t1 asText. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
165 |
(textViews at:2) list:t2 asText. |
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
166 |
|
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
167 |
"Created: 20.11.1995 / 13:20:39 / cg" |
12 | 168 |
! ! |
92
ca6389321c2a
new (abstract) class for multiple sync-scrolled textviews
Claus Gittinger <cg@exept.de>
parents:
91
diff
changeset
|
169 |
|
158 | 170 |
!TwoColumnTextView class methodsFor:'documentation'! |
171 |
||
172 |
version |
|
161 | 173 |
^ '$Header: /cvs/stx/stx/libwidg2/TwoColumnTextView.st,v 1.12 1996-04-27 18:23:13 cg Exp $'! ! |