111
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1994 by Claus Gittinger
|
|
3 |
All Rights Reserved
|
|
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 |
|
|
13 |
"Created: 20.11.1995 / 13:21:17 / cg"
|
|
14 |
|
2965
|
15 |
"{ Package: 'stx:libwidg2' }"
|
|
16 |
|
111
|
17 |
SyncedMultiColumnTextView subclass:#ThreeColumnTextView
|
|
18 |
instanceVariableNames:''
|
|
19 |
classVariableNames:''
|
|
20 |
poolDictionaries:''
|
|
21 |
category:'Views-Text'
|
|
22 |
!
|
|
23 |
|
|
24 |
!ThreeColumnTextView class methodsFor:'documentation'!
|
|
25 |
|
|
26 |
copyright
|
|
27 |
"
|
|
28 |
COPYRIGHT (c) 1994 by Claus Gittinger
|
|
29 |
All Rights Reserved
|
|
30 |
|
|
31 |
This software is furnished under a license and may be used
|
|
32 |
only in accordance with the terms of that license and with the
|
|
33 |
inclusion of the above copyright notice. This software may not
|
|
34 |
be provided or otherwise made available to, or used by, any
|
|
35 |
other person. No title to or ownership of the software is
|
|
36 |
hereby transferred.
|
|
37 |
"
|
|
38 |
|
|
39 |
"Created: 20.11.1995 / 13:21:17 / cg"
|
|
40 |
!
|
|
41 |
|
|
42 |
documentation
|
|
43 |
"
|
|
44 |
a view showing two texts side-by-side.
|
|
45 |
Scrolling is synced, by always scrolling both views.
|
|
46 |
This type of view is especially useful to show diff-lists,
|
|
47 |
code-versions, or other one-by-one viewable texts.
|
|
48 |
|
|
49 |
Usually, it does not make much sense, to put totally different
|
|
50 |
or unrelated texts into this kind of view.
|
|
51 |
|
|
52 |
See subclass DiffTextView for a real class;
|
|
53 |
see ChangesBrowsers compare operation for a real application
|
|
54 |
of this kind of views.
|
|
55 |
"
|
|
56 |
|
|
57 |
"Created: 20.11.1995 / 13:21:17 / cg"
|
|
58 |
!
|
|
59 |
|
|
60 |
examples
|
|
61 |
"
|
1440
|
62 |
ThreeColumnTextViews are currently not directly used by the system.
|
|
63 |
However, it is used as an abstract superclass for Diff3TextView.
|
111
|
64 |
See more examples there.
|
|
65 |
(you may find nice uses for it anyway ...)
|
|
66 |
|
1440
|
67 |
ThreeColumnTextView
|
|
68 |
openOn:('smalltalk.rc' asFilename contents)
|
|
69 |
and:('display.rc' asFilename contents)
|
|
70 |
and:('host.rc' asFilename contents)
|
111
|
71 |
|
|
72 |
|
1440
|
73 |
ThreeColumnTextView
|
|
74 |
openOn:('smalltalk.rc' asFilename contents)
|
111
|
75 |
label:'smalltalk.rc'
|
1440
|
76 |
and:('display.rc' asFilename contents)
|
111
|
77 |
label:'display.rc'
|
1440
|
78 |
and:('host.rc' asFilename contents)
|
|
79 |
label:'host.rc'
|
111
|
80 |
"
|
|
81 |
|
|
82 |
"Created: 20.11.1995 / 13:21:42 / cg"
|
|
83 |
"Modified: 20.11.1995 / 13:23:12 / cg"
|
|
84 |
! !
|
|
85 |
|
|
86 |
!ThreeColumnTextView class methodsFor:'instance creation'!
|
|
87 |
|
|
88 |
openOn:firstText and:secondText and:thirdText
|
|
89 |
"open up a view showing firstText, secondText and thirdText side-by-side"
|
|
90 |
|
|
91 |
|top v|
|
|
92 |
|
|
93 |
top := StandardSystemView label:'three texts'.
|
|
94 |
v := HVScrollableView
|
|
95 |
for:self
|
|
96 |
miniScrollerH:true miniScrollerV:false
|
|
97 |
in:top.
|
|
98 |
v origin:0.0 @ 0.0 corner:1.0 @ 1.0.
|
|
99 |
v scrolledView text1:firstText text2:secondText text3:thirdText.
|
|
100 |
^ top open
|
|
101 |
|
|
102 |
"
|
|
103 |
ThreeColumnTextView
|
|
104 |
openOn:('smalltalk.rc' asFilename contentsOfEntireFile)
|
|
105 |
and:('display.rc' asFilename contentsOfEntireFile)
|
|
106 |
and:('private.rc' asFilename contentsOfEntireFile)
|
|
107 |
"
|
|
108 |
|
|
109 |
"Modified: 12.12.1995 / 12:22:51 / cg"
|
|
110 |
!
|
|
111 |
|
|
112 |
openOn:firstText label:firstLabel and:secondText label:secondLabel and:thirdText label:thirdLabel
|
|
113 |
"open up a view showing firstText, secondText and thirdText side-by-side,
|
|
114 |
and labels for all views."
|
|
115 |
|
|
116 |
|top v l1 l2 l3|
|
|
117 |
|
|
118 |
top := StandardSystemView label:'three texts'.
|
|
119 |
l1 := Label label:firstLabel in:top.
|
|
120 |
l1 origin:0.0@0.0 corner:0.33@(l1 height).
|
|
121 |
l2 := Label label:secondLabel in:top.
|
|
122 |
l2 origin:0.33@0.0 corner:0.67@(l1 height).
|
|
123 |
l3 := Label label:thirdLabel in:top.
|
|
124 |
l3 origin:0.67@0.0 corner:1.0@(l1 height).
|
|
125 |
|
|
126 |
v := HVScrollableView
|
|
127 |
for:self
|
|
128 |
miniScrollerH:true miniScrollerV:false
|
|
129 |
in:top.
|
|
130 |
v origin:0.0 @ (l1 height + ViewSpacing) corner:1.0 @ 1.0.
|
|
131 |
v scrolledView text1:firstText text2:secondText text3:thirdText.
|
|
132 |
^ top open
|
|
133 |
|
|
134 |
"
|
|
135 |
ThreeColumnTextView
|
|
136 |
openOn:('smalltalk.rc' asFilename contentsOfEntireFile)
|
|
137 |
label:'smalltalk.rc'
|
|
138 |
and:('display.rc' asFilename contentsOfEntireFile)
|
|
139 |
label:'display.rc'
|
|
140 |
and:('private.rc' asFilename contentsOfEntireFile)
|
|
141 |
label:'private.rc'
|
|
142 |
"
|
|
143 |
|
|
144 |
"Modified: 12.12.1995 / 12:24:14 / cg"
|
|
145 |
! !
|
|
146 |
|
|
147 |
!ThreeColumnTextView class methodsFor:'specification'!
|
|
148 |
|
|
149 |
numberOfViews
|
|
150 |
^ 3
|
|
151 |
|
|
152 |
"Created: 20.11.1995 / 13:17:00 / cg"
|
|
153 |
"Modified: 12.12.1995 / 12:24:06 / cg"
|
|
154 |
! !
|
|
155 |
|
|
156 |
!ThreeColumnTextView methodsFor:'accessing'!
|
|
157 |
|
|
158 |
text1:t1 text2:t2 text3:t3
|
|
159 |
(textViews at:1) list:t1 asText.
|
|
160 |
(textViews at:2) list:t2 asText.
|
|
161 |
(textViews at:3) list:t3 asText.
|
|
162 |
|
|
163 |
"Created: 20.11.1995 / 13:20:39 / cg"
|
|
164 |
"Modified: 12.12.1995 / 12:21:42 / cg"
|
|
165 |
! !
|
|
166 |
|
|
167 |
!ThreeColumnTextView class methodsFor:'documentation'!
|
|
168 |
|
|
169 |
version
|
2965
|
170 |
^ '$Header: /cvs/stx/stx/libwidg2/ThreeColumnTextView.st,v 1.3 2006-07-05 07:42:12 fm Exp $'
|
111
|
171 |
! !
|