author | Claus Gittinger <cg@exept.de> |
Thu, 06 May 1999 17:08:32 +0200 | |
changeset 1900 | d334ab9d32d5 |
parent 1822 | 9abf58839e67 |
child 1971 | cff41b7cfb54 |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
59 | 3 |
All Rights Reserved |
0 | 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 |
EditTextView subclass:#TextCollector |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
14 |
instanceVariableNames:'entryStream lineLimit destroyAction outstandingLines |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
15 |
outstandingLine flushBlock flushPending inFlush collecting |
1562
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
16 |
timeDelay access currentEmphasis alwaysAppendAtEnd collectSize' |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
17 |
classVariableNames:'' |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
18 |
poolDictionaries:'' |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
19 |
category:'Views-Text' |
0 | 20 |
! |
21 |
||
928 | 22 |
!TextCollector class methodsFor:'documentation'! |
15 | 23 |
|
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
24 |
copyright |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
25 |
" |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
26 |
COPYRIGHT (c) 1989 by Claus Gittinger |
59 | 27 |
All Rights Reserved |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
28 |
|
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
29 |
This software is furnished under a license and may be used |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
30 |
only in accordance with the terms of that license and with the |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
31 |
inclusion of the above copyright notice. This software may not |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
32 |
be provided or otherwise made available to, or used by, any |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
33 |
other person. No title to or ownership of the software is |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
34 |
hereby transferred. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
35 |
" |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
36 |
! |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
37 |
|
15 | 38 |
documentation |
39 |
" |
|
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
40 |
a view for editable text, which also understands some stream messages. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
41 |
Instances of this view can take the place of a stream and display the |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
42 |
received text. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
43 |
Its main use in the system is the Transcript, but it can also be used for |
110 | 44 |
things like trace-windows, errorLogs etc. |
0 | 45 |
|
60 | 46 |
If collecting is turned on, a textcollector will not immediately display |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
47 |
entered text, but wait for some short time (timeDelay) and collect incoming |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
48 |
data - finally updating the whole chunk in one piece. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
49 |
This helps slow display devices, which would otherwise scroll a lot. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
50 |
(on fast displays this is less of a problem). |
15 | 51 |
|
60 | 52 |
The total number of lines kept is controlled by lineLimit, if more lines |
53 |
than this limit are added at the bottom, the textcollector will forget lines |
|
54 |
at the top. |
|
55 |
You can set linelimit to nil (i.e. no limit), but you may need a lot |
|
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
56 |
of memory then ... |
77 | 57 |
|
586 | 58 |
[StyleSheet paramters (transcript only):] |
59 |
||
60 |
transcriptForegroundColor defaults to textForegroundColor |
|
61 |
transcriptBackgroundColor' defaults to textBackgroundColor. |
|
77 | 62 |
|
586 | 63 |
transcriptCursorForegroundColor |
64 |
transcriptCursorBackgroundColor |
|
77 | 65 |
|
586 | 66 |
[author:] |
67 |
Claus Gittinger |
|
68 |
||
69 |
[see also:] |
|
70 |
CodeView EditTextView |
|
71 |
ActorStream |
|
15 | 72 |
" |
73 |
! ! |
|
0 | 74 |
|
928 | 75 |
!TextCollector class methodsFor:'instance creation'! |
0 | 76 |
|
77 |
newTranscript |
|
778
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
78 |
"create and open a new transcript. |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
79 |
This is a leftOver method from times were the Launcher & Transcript |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
80 |
were two different views. It is no longer recommended." |
110 | 81 |
|
1900
d334ab9d32d5
removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
82 |
|topView transcript defSz f v lines cols| |
0 | 83 |
|
1900
d334ab9d32d5
removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
84 |
topView := StandardSystemView label:'Transcript' "minExtent:(100 @ 100)". |
0 | 85 |
|
60 | 86 |
v := HVScrollableView for:self miniScrollerH:true miniScrollerV:false in:topView. |
0 | 87 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
88 |
transcript := v scrolledView. |
|
89 |
"transcript partialLines:false." |
|
90 |
||
91 |
f := transcript font. |
|
60 | 92 |
|
93 |
" |
|
94 |
should add the height of the frame & scrollbars to be exact ... |
|
95 |
" |
|
1900
d334ab9d32d5
removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
96 |
defSz := self defaultTranscriptSize. |
d334ab9d32d5
removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
97 |
cols := defSz x. |
d334ab9d32d5
removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
98 |
lines := defSz y. |
60 | 99 |
topView extent:(((f widthOf:'x') * cols) @ (f height * lines)). |
0 | 100 |
|
110 | 101 |
transcript beTranscript. |
59 | 102 |
|
80 | 103 |
" |
104 |
run it at a slightly higher prio, to allow for |
|
105 |
delayed buffered updates to be performed |
|
106 |
" |
|
107 |
topView openWithPriority:(Processor userSchedulingPriority + 1). |
|
15 | 108 |
|
0 | 109 |
^ transcript |
110 | 110 |
|
111 |
" |
|
1026 | 112 |
TextCollector newTranscript. |
113 |
Transcript lineLimit:3000. |
|
110 | 114 |
" |
778
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
115 |
|
1026 | 116 |
"Modified: 17.2.1997 / 18:20:27 / cg" |
0 | 117 |
! ! |
118 |
||
928 | 119 |
!TextCollector class methodsFor:'defaults'! |
0 | 120 |
|
1610
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
121 |
defaultCollectSize |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
122 |
"the number of lines buffered for delayed update" |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
123 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
124 |
^ 50 |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
125 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
126 |
"Modified: / 27.7.1998 / 16:14:51 / cg" |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
127 |
! |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
128 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
129 |
defaultLineLimit |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
130 |
"the number of lines remembered by default" |
59 | 131 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
132 |
^ 600 |
59 | 133 |
! |
134 |
||
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
135 |
defaultTimeDelay |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
136 |
"the time in seconds to wait & collect by default" |
36 | 137 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
138 |
^ 0.3 |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
139 |
! |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
140 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
141 |
defaultTranscriptSize |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
142 |
"the number of cols/lines by which the Transcript should come up" |
110 | 143 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
144 |
^ 70@11 |
110 | 145 |
! ! |
146 |
||
1500 | 147 |
!TextCollector methodsFor:'ST-80 compatibility'! |
148 |
||
149 |
deselect |
|
150 |
self unselect |
|
1504
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
151 |
! |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
152 |
|
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
153 |
flush |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
154 |
self endEntry. |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
155 |
super flush |
1500 | 156 |
! ! |
157 |
||
0 | 158 |
!TextCollector methodsFor:'accessing'! |
159 |
||
1467
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
160 |
beginEntry |
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
161 |
"noop for now, ST80 compatibility" |
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
162 |
|
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
163 |
^ self |
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
164 |
|
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
165 |
"Created: / 4.3.1998 / 11:08:14 / stefan" |
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
166 |
! |
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
167 |
|
0 | 168 |
collect:aBoolean |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
169 |
"turn on/off collecting - if on, do not output immediately |
15 | 170 |
but collect text and output en-bloque after some time delta" |
0 | 171 |
|
172 |
collecting := aBoolean |
|
173 |
! |
|
174 |
||
1610
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
175 |
collectSize:numberOfLines |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
176 |
"set the collect buffer size. If collect is enabled, |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
177 |
the receiver will force update of the view, |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
178 |
whenever that many lines have been collected |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
179 |
(or the updateTimeDelay interval has passed). |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
180 |
With collect turned off, an immediate update is performed." |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
181 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
182 |
collectSize := numberOfLines |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
183 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
184 |
"Modified: / 27.7.1998 / 16:16:00 / cg" |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
185 |
! |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
186 |
|
0 | 187 |
destroyAction:aBlock |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
188 |
"define the action to be performed when I get destroyed. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
189 |
This is a special feature, to allow resetting Transcript to Stderr |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
190 |
when closed. (see TextCollectorclass>>newTranscript)" |
0 | 191 |
|
192 |
destroyAction := aBlock |
|
193 |
! |
|
194 |
||
195 |
endEntry |
|
928 | 196 |
"flush collected output; displaying all that has been buffered so far" |
0 | 197 |
|
36 | 198 |
|nLines lines| |
0 | 199 |
|
133 | 200 |
shown ifFalse:[ |
653 | 201 |
flushPending ifFalse:[ |
202 |
self installDelayedUpdate. |
|
203 |
]. |
|
204 |
^ self |
|
133 | 205 |
]. |
119 | 206 |
inFlush ifTrue:[^ self]. |
1714 | 207 |
flushBlock notNil ifTrue:[ |
208 |
Processor removeTimedBlock:flushBlock. |
|
209 |
]. |
|
59 | 210 |
flushPending ifFalse:[^ self]. |
15 | 211 |
|
52 | 212 |
access critical:[ |
653 | 213 |
inFlush := true. |
1491
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
214 |
[ |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
215 |
flushPending := false. |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
216 |
outstandingLines size ~~ 0 ifTrue:[ |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
217 |
"insert the bunch of lines - if any" |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
218 |
lines := outstandingLines. |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
219 |
outstandingLines := nil. |
36 | 220 |
|
1491
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
221 |
nLines := lines size. |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
222 |
(nLines ~~ 0) ifTrue:[ |
1565
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
223 |
insertMode ifTrue:[ |
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
224 |
self insertLines:lines withCR:true. |
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
225 |
] ifFalse:[ |
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
226 |
self replaceLines:lines withCR:true |
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
227 |
]. |
1562
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
228 |
alwaysAppendAtEnd ifTrue:[ |
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
229 |
self cursorToEnd. |
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
230 |
]. |
1491
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
231 |
self withCursorOffDo:[ |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
232 |
(cursorLine >= (firstLineShown + nFullLinesShown)) ifTrue:[ |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
233 |
self scrollDown:nLines |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
234 |
] |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
235 |
]. |
653 | 236 |
]. |
237 |
]. |
|
928 | 238 |
|
1491
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
239 |
"and the last partial line - if any" |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
240 |
outstandingLine size > 0 ifTrue:[ |
1565
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
241 |
insertMode ifTrue:[ |
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
242 |
self insertStringAtCursor:outstandingLine. |
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
243 |
] ifFalse:[ |
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
244 |
self replaceStringAtCursor:outstandingLine. |
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
245 |
]. |
1491
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
246 |
outstandingLine := ''. |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
247 |
]. |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
248 |
self checkLineLimit. |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
249 |
device flush. |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
250 |
] valueNowOrOnUnwindDo:[ |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
251 |
inFlush := false. |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
252 |
] |
119 | 253 |
]. |
254 |
flushPending ifTrue:[ |
|
653 | 255 |
flushPending := false. |
256 |
self installDelayedUpdate |
|
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
257 |
] |
653 | 258 |
|
1714 | 259 |
"Modified: / 9.11.1998 / 21:17:56 / cg" |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
260 |
! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
261 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
262 |
lineLimit:aNumber |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
263 |
"define the number of text-lines I am supposed to hold" |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
264 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
265 |
lineLimit := aNumber |
1611 | 266 |
|
267 |
" |
|
268 |
Transcript lineLimit:5000 |
|
269 |
" |
|
270 |
||
271 |
"Modified: / 16.5.1998 / 01:33:52 / cg" |
|
1610
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
272 |
! |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
273 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
274 |
updateTimeDelay:seconds |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
275 |
"if collect is enabled, the receiver will update its view, |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
276 |
after that time delay (i.e. it collects more output during that period), |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
277 |
or when collectSize lines have been collected without update. |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
278 |
With collect turned off, an immediate update is performed." |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
279 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
280 |
timeDelay := seconds |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
281 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
282 |
"Modified: / 27.7.1998 / 16:16:41 / cg" |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
283 |
! ! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
284 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
285 |
!TextCollector methodsFor:'change & update'! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
286 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
287 |
getListFromModel |
928 | 288 |
"a textCollector always scrolls to the bottom" |
289 |
||
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
290 |
super getListFromModel. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
291 |
self scrollToBottom |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
292 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
293 |
"Created: 12.2.1996 / 14:27:56 / stefan" |
928 | 294 |
"Modified: 11.1.1997 / 14:41:50 / cg" |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
295 |
! ! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
296 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
297 |
!TextCollector methodsFor:'events'! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
298 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
299 |
exposeX:x y:y width:w height:h |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
300 |
"flush buffered text when exposed" |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
301 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
302 |
super exposeX:x y:y width:w height:h. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
303 |
self endEntry |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
304 |
! ! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
305 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
306 |
!TextCollector methodsFor:'initialize / release'! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
307 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
308 |
destroy |
928 | 309 |
"destroy this view" |
310 |
||
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
311 |
destroyAction notNil ifTrue:[ |
928 | 312 |
destroyAction value |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
313 |
]. |
1714 | 314 |
flushBlock notNil ifTrue:[ |
315 |
Processor removeTimedBlock:flushBlock. |
|
316 |
]. |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
317 |
flushBlock := nil. |
928 | 318 |
outstandingLines := nil. |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
319 |
outstandingLine := ''. |
928 | 320 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
321 |
super destroy |
928 | 322 |
|
1714 | 323 |
"Modified: / 9.11.1998 / 21:18:17 / cg" |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
324 |
! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
325 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
326 |
editMenu |
928 | 327 |
"return my popUpMenu; thats the superClasses menu, |
328 |
minus any accept item." |
|
329 |
||
1262
d69149b5be1f
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
330 |
<resource: #programMenu> |
1109 | 331 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
332 |
|m idx| |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
333 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
334 |
m := super editMenu. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
335 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
336 |
" |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
337 |
textcollectors do not support #accept |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
338 |
remove it from the menu (and the preceeding separating line) |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
339 |
" |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
340 |
idx := m indexOf:#accept. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
341 |
idx ~~ 0 ifTrue:[ |
928 | 342 |
m remove:idx. |
343 |
(m labels at:(idx - 1)) = '-' ifTrue:[ |
|
344 |
m remove:idx - 1 |
|
345 |
]. |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
346 |
]. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
347 |
^ m |
928 | 348 |
|
1262
d69149b5be1f
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
349 |
"Modified: 3.7.1997 / 13:54:11 / cg" |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
350 |
! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
351 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
352 |
initialize |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
353 |
super initialize. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
354 |
|
928 | 355 |
outstandingLines := nil. |
1562
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
356 |
alwaysAppendAtEnd := true. |
1610
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
357 |
collectSize := self class defaultCollectSize. |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
358 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
359 |
flushPending := inFlush := false. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
360 |
collecting := true. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
361 |
timeDelay := self class defaultTimeDelay. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
362 |
access := RecursionLock new. "/ Semaphore forMutualExclusion. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
363 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
364 |
lineLimit := self class defaultLineLimit. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
365 |
entryStream := ActorStream new. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
366 |
entryStream nextPutBlock:[:something | self nextPut:something]. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
367 |
entryStream nextPutAllBlock:[:something | self nextPutAll:something] |
928 | 368 |
|
1711 | 369 |
"Modified: / 9.11.1998 / 14:33:46 / cg" |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
370 |
! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
371 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
372 |
mapped |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
373 |
"view became visible - show collected lines (if any)" |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
374 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
375 |
super mapped. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
376 |
self endEntry |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
377 |
! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
378 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
379 |
reinitialize |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
380 |
"recreate access-semaphore; image could have been save (theoretically) |
1467
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
381 |
with the semaphore locked - in this case, we had a deadlock" |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
382 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
383 |
flushPending := false. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
384 |
access := RecursionLock new. "/ Semaphore forMutualExclusion. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
385 |
super reinitialize. |
1467
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
386 |
|
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
387 |
"Modified: / 5.3.1998 / 10:09:14 / stefan" |
0 | 388 |
! ! |
389 |
||
390 |
!TextCollector methodsFor:'private'! |
|
391 |
||
392 |
checkLineLimit |
|
393 |
"this method checks if the text has become too large (> lineLimit) |
|
394 |
and cuts off some lines at the top if so; it must be called whenever lines |
|
395 |
have been added to the bottom" |
|
396 |
||
397 |
|nDel| |
|
398 |
||
399 |
lineLimit notNil ifTrue:[ |
|
59 | 400 |
(cursorLine > lineLimit) ifTrue:[ |
401 |
nDel := list size - lineLimit. |
|
402 |
list removeFromIndex:1 toIndex:nDel. |
|
403 |
cursorLine := cursorLine - nDel. |
|
404 |
firstLineShown := firstLineShown - nDel. |
|
405 |
(firstLineShown < 1) ifTrue:[ |
|
406 |
cursorLine := cursorLine - firstLineShown + 1. |
|
407 |
firstLineShown := 1 |
|
408 |
]. |
|
409 |
self contentsChanged |
|
410 |
] |
|
0 | 411 |
] |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
412 |
! |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
413 |
|
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
414 |
installDelayedUpdate |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
415 |
"arrange for collecting input for some time, |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
416 |
and output all buffered strings at once after a while. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
417 |
This makes output to the transcript much faster on systems |
553 | 418 |
with poor scrolling performance (i.e. dumb vga cards ...)." |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
419 |
|
131 | 420 |
|p| |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
421 |
|
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
422 |
flushPending ifFalse:[ |
553 | 423 |
flushPending := true. |
424 |
inFlush ifFalse:[ |
|
425 |
" |
|
426 |
we could run under a process, which dies in the meantime; |
|
427 |
therefore, we have to arrange for the transcript process to |
|
428 |
be interrupted and do the update. |
|
429 |
" |
|
430 |
windowGroup isNil ifTrue:[ |
|
431 |
p := Processor activeProcess |
|
432 |
] ifFalse:[ |
|
433 |
p := windowGroup process |
|
434 |
]. |
|
1221
0c2a4231fc9e
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1109
diff
changeset
|
435 |
(p isNil or:[p isSystemProcess]) ifTrue:[ |
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
436 |
self endEntry |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
437 |
] ifFalse:[ |
1711 | 438 |
flushBlock isNil ifTrue:[ |
439 |
flushBlock := [self endEntry]. |
|
440 |
]. |
|
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
441 |
Processor addTimedBlock:flushBlock for:p afterSeconds:timeDelay. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
442 |
] |
553 | 443 |
] |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
444 |
] |
553 | 445 |
|
1711 | 446 |
"Modified: / 17.4.1997 / 13:03:15 / stefan" |
447 |
"Modified: / 9.11.1998 / 14:34:07 / cg" |
|
0 | 448 |
! ! |
449 |
||
778
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
450 |
!TextCollector methodsFor:'queries'! |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
451 |
|
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
452 |
current |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
453 |
"return the current (your screens) transcript. |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
454 |
In multiDisplay applications, this need NOT be the main transcript. |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
455 |
But typically, this is the same as Transcript." |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
456 |
|
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
457 |
^ self topView application class current transcript |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
458 |
|
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
459 |
" |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
460 |
Transcript current flash |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
461 |
" |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
462 |
|
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
463 |
"Created: 5.7.1996 / 14:14:34 / cg" |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
464 |
"Modified: 5.7.1996 / 14:14:52 / cg" |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
465 |
! ! |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
466 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
467 |
!TextCollector methodsFor:'stream messages'! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
468 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
469 |
cr |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
470 |
"output a carriage return, finishing the current line" |
135 | 471 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
472 |
access critical:[ |
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
473 |
collecting ifTrue:[ |
928 | 474 |
outstandingLine notNil ifTrue:[ "/ mhmh - is never nil |
475 |
outstandingLines isNil ifTrue:[ |
|
476 |
outstandingLines := OrderedCollection with:outstandingLine |
|
477 |
] ifFalse:[ |
|
478 |
outstandingLines add:outstandingLine. |
|
479 |
] |
|
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
480 |
]. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
481 |
outstandingLine := ''. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
482 |
] ifFalse:[ |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
483 |
self cursorReturn. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
484 |
self checkLineLimit. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
485 |
self cursorToEnd. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
486 |
]. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
487 |
]. |
135 | 488 |
|
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
489 |
collecting ifTrue:[ |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
490 |
flushPending ifFalse:[ |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
491 |
self installDelayedUpdate |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
492 |
] |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
493 |
] |
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
494 |
|
928 | 495 |
"Modified: 11.1.1997 / 14:39:00 / cg" |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
496 |
! |
135 | 497 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
498 |
doesNotUnderstand:aMessage |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
499 |
"this is funny: all message we do not understand, are passed |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
500 |
on to the stream which will send the characters via nextPut: |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
501 |
This way, we understand all Stream messages - great isn't it !! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
502 |
" |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
503 |
^ entryStream perform:(aMessage selector) withArguments:(aMessage arguments) |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
504 |
! |
0 | 505 |
|
506 |
lineLength |
|
928 | 507 |
"to make a textCollector (somewhat) compatible with printer |
508 |
streams, support the lineLength query" |
|
509 |
||
0 | 510 |
^ width // (font width) |
928 | 511 |
|
512 |
"Modified: 11.1.1997 / 14:42:41 / cg" |
|
0 | 513 |
! |
514 |
||
515 |
nextPut:something |
|
928 | 516 |
"append somethings printString to my displayed text. |
517 |
This allows TextCollectors to be used Stream-wise" |
|
0 | 518 |
|
1504
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
519 |
|txt| |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
520 |
|
656 | 521 |
(something isCharacter) ifTrue:[ |
522 |
((something == Character cr) or:[something == Character nl]) ifTrue:[ |
|
523 |
^ self cr |
|
524 |
]. |
|
0 | 525 |
]. |
1504
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
526 |
|
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
527 |
txt := something asString. |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
528 |
currentEmphasis notNil ifTrue:[ |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
529 |
txt := txt emphasizeAllWith:currentEmphasis |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
530 |
]. |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
531 |
self show:txt. |
656 | 532 |
|
533 |
"/ flushPending ifTrue:[ |
|
534 |
"/ self endEntry |
|
535 |
"/ ]. |
|
536 |
"/ (something isMemberOf:Character) ifTrue:[ |
|
537 |
"/ ((something == Character cr) or:[something == Character nl]) ifTrue:[ |
|
538 |
"/ ^ self cr |
|
539 |
"/ ]. |
|
540 |
"/ self insertCharAtCursor:something |
|
541 |
"/ ] ifFalse:[ |
|
542 |
"/ self insertStringAtCursor:(something printString). |
|
543 |
"/ self checkLineLimit |
|
544 |
"/ ]. |
|
545 |
"/ device flush |
|
546 |
||
928 | 547 |
"Modified: 11.1.1997 / 14:43:05 / cg" |
0 | 548 |
! |
549 |
||
550 |
nextPutAll:something |
|
928 | 551 |
"append all of something to my displayed text. |
552 |
This allows TextCollectors to be used Stream-wise" |
|
0 | 553 |
|
1504
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
554 |
currentEmphasis notNil ifTrue:[ |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
555 |
^ self show:(something emphasizeAllWith:currentEmphasis) |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
556 |
]. |
656 | 557 |
^ self show:something |
558 |
||
928 | 559 |
"Modified: 11.1.1997 / 14:43:26 / cg" |
0 | 560 |
! |
561 |
||
562 |
show:anObject |
|
563 |
"insert the argument aString at current cursor position" |
|
564 |
||
308
b216a5efa2c8
handle show: with a string containing cr's
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
565 |
|aString lines| |
0 | 566 |
|
567 |
aString := anObject printString. |
|
928 | 568 |
|
308
b216a5efa2c8
handle show: with a string containing cr's
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
569 |
(aString includes:(Character cr)) ifTrue:[ |
653 | 570 |
lines := aString asStringCollection. |
571 |
lines keysAndValuesDo:[:nr :line | |
|
1562
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
572 |
(nr == lines size |
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
573 |
and:[(aString endsWith:(Character cr)) not]) ifTrue:[ |
653 | 574 |
"/ the last one. |
575 |
self show:line |
|
576 |
] ifFalse:[ |
|
577 |
self showCR:line |
|
578 |
]. |
|
579 |
]. |
|
580 |
^ self. |
|
308
b216a5efa2c8
handle show: with a string containing cr's
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
581 |
]. |
b216a5efa2c8
handle show: with a string containing cr's
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
582 |
|
1026 | 583 |
access critical:[ |
584 |
outstandingLine size > 0 ifTrue:[ |
|
585 |
outstandingLine := outstandingLine , aString |
|
586 |
] ifFalse:[ |
|
587 |
outstandingLine := aString |
|
653 | 588 |
]. |
1026 | 589 |
collecting ifTrue:[ |
590 |
flushPending ifFalse:[ |
|
591 |
self installDelayedUpdate |
|
1312
eaa44f7649f5
flush after some lines have been collected
Claus Gittinger <cg@exept.de>
parents:
1262
diff
changeset
|
592 |
] ifTrue:[ |
1562
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
593 |
outstandingLines size > collectSize ifTrue:[ |
1312
eaa44f7649f5
flush after some lines have been collected
Claus Gittinger <cg@exept.de>
parents:
1262
diff
changeset
|
594 |
self endEntry |
eaa44f7649f5
flush after some lines have been collected
Claus Gittinger <cg@exept.de>
parents:
1262
diff
changeset
|
595 |
] |
1026 | 596 |
] |
597 |
] ifFalse:[ |
|
598 |
self endEntry |
|
653 | 599 |
] |
1026 | 600 |
]. |
0 | 601 |
|
1562
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
602 |
"Modified: / 10.6.1998 / 19:34:25 / cg" |
1617 | 603 |
! |
604 |
||
605 |
showCR:anObject |
|
606 |
"insert the argument aString at current cursor position, |
|
607 |
and advance to the next line. This is the same as a #show: |
|
608 |
followed by a #cr." |
|
609 |
||
610 |
|aString lines| |
|
611 |
||
612 |
aString := anObject printString. |
|
613 |
aString size == 0 ifTrue:[ |
|
614 |
^ self cr |
|
615 |
]. |
|
616 |
||
617 |
(aString includes:(Character cr)) ifTrue:[ |
|
618 |
lines := aString asStringCollection. |
|
619 |
lines keysAndValuesDo:[:nr :line | |
|
620 |
(nr == lines size |
|
621 |
and:[(aString endsWith:(Character cr)) not]) ifTrue:[ |
|
622 |
"/ the last one. |
|
623 |
self show:line |
|
624 |
] ifFalse:[ |
|
625 |
self showCR:line |
|
626 |
]. |
|
627 |
]. |
|
628 |
^ self. |
|
629 |
]. |
|
630 |
||
631 |
access critical:[ |
|
632 |
outstandingLine size > 0 ifTrue:[ |
|
633 |
outstandingLine := outstandingLine , aString |
|
634 |
] ifFalse:[ |
|
635 |
outstandingLine := aString |
|
636 |
]. |
|
637 |
collecting ifTrue:[ |
|
638 |
outstandingLines isNil ifTrue:[ |
|
639 |
outstandingLines := OrderedCollection with:outstandingLine |
|
640 |
] ifFalse:[ |
|
641 |
outstandingLines add:outstandingLine. |
|
642 |
]. |
|
643 |
outstandingLine := ''. |
|
644 |
||
645 |
flushPending ifFalse:[ |
|
646 |
self installDelayedUpdate |
|
647 |
] ifTrue:[ |
|
648 |
outstandingLines size > collectSize ifTrue:[ |
|
649 |
self endEntry |
|
650 |
] |
|
651 |
] |
|
652 |
] ifFalse:[ |
|
653 |
self endEntry. |
|
654 |
self cursorReturn. |
|
655 |
self checkLineLimit. |
|
656 |
self cursorToEnd. |
|
657 |
] |
|
658 |
]. |
|
659 |
||
660 |
"Created: / 28.7.1998 / 00:31:46 / cg" |
|
661 |
"Modified: / 28.7.1998 / 00:34:58 / cg" |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
662 |
! ! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
663 |
|
1822
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
664 |
!TextCollector methodsFor:'stream messages - emphasis'! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
665 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
666 |
bold |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
667 |
currentEmphasis := #bold |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
668 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
669 |
"Modified: / 26.3.1999 / 14:28:58 / cg" |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
670 |
! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
671 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
672 |
color:aColor |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
673 |
currentEmphasis := #color->aColor |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
674 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
675 |
"Modified: / 26.3.1999 / 14:29:21 / cg" |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
676 |
! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
677 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
678 |
italic |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
679 |
currentEmphasis := #italic |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
680 |
! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
681 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
682 |
normal |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
683 |
currentEmphasis := nil |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
684 |
! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
685 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
686 |
reverse |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
687 |
currentEmphasis := Array with:#color->bgColor |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
688 |
with:#backgroundColor->fgColor. |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
689 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
690 |
"Created: / 20.6.1998 / 20:10:45 / cg" |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
691 |
! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
692 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
693 |
underline |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
694 |
currentEmphasis := #underline |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
695 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
696 |
"Created: / 26.3.1999 / 14:27:07 / cg" |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
697 |
! ! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
698 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
699 |
!TextCollector methodsFor:'transcript specials'! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
700 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
701 |
beTranscript |
928 | 702 |
"make the receiver be the systemTranscript; this one |
703 |
is accessable via the global Transcript and gets relevant |
|
704 |
system messages from various places." |
|
705 |
||
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
706 |
|fg bg cFg cBg| |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
707 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
708 |
Smalltalk at:#Transcript put:self. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
709 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
710 |
" |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
711 |
fancy feature: whenever Transcript is closed, reset to StdError |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
712 |
" |
1421
afef284eadc4
only reset Transcript to stdErr, if I really am the transcript.
ca
parents:
1389
diff
changeset
|
713 |
self destroyAction:[ |
afef284eadc4
only reset Transcript to stdErr, if I really am the transcript.
ca
parents:
1389
diff
changeset
|
714 |
self == (Smalltalk at:#Transcript) ifTrue:[ |
afef284eadc4
only reset Transcript to stdErr, if I really am the transcript.
ca
parents:
1389
diff
changeset
|
715 |
Smalltalk at:#Transcript put:Stderr |
afef284eadc4
only reset Transcript to stdErr, if I really am the transcript.
ca
parents:
1389
diff
changeset
|
716 |
] |
afef284eadc4
only reset Transcript to stdErr, if I really am the transcript.
ca
parents:
1389
diff
changeset
|
717 |
]. |
0 | 718 |
|
928 | 719 |
"/ user may prefer a special color for this one; |
720 |
"/ look into the style definitions ... |
|
721 |
||
1389 | 722 |
fg := styleSheet colorAt:'transcript.foregroundColor' default:self foregroundColor. |
723 |
bg := styleSheet colorAt:'transcript.backgroundColor' default:self backgroundColor. |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
724 |
self foregroundColor:fg backgroundColor:bg. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
725 |
self viewBackground:bg. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
726 |
|
1389 | 727 |
cFg := styleSheet colorAt:'transcript.cursorForegroundColor' default:bg. |
728 |
cBg := styleSheet colorAt:'transcript.cursorBackgroundColor' default:fg. |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
729 |
self cursorForegroundColor:cFg backgroundColor:cBg. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
730 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
731 |
"self lineLimit:1000. " "or whatever you think makes sense" |
928 | 732 |
|
1389 | 733 |
"Modified: / 2.11.1997 / 22:34:47 / cg" |
0 | 734 |
! ! |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
735 |
|
928 | 736 |
!TextCollector class methodsFor:'documentation'! |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
737 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
738 |
version |
1900
d334ab9d32d5
removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
739 |
^ '$Header: /cvs/stx/stx/libwidg/TextCollector.st,v 1.56 1999-05-06 15:08:32 cg Exp $' |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
740 |
! ! |