author | Merge Script |
Tue, 06 Oct 2015 06:43:18 +0200 | |
branch | jv |
changeset 5459 | b54f4b01de15 |
parent 5409 | a862f7795ef5 |
parent 5455 | e151df78df1e |
child 5487 | 455c92ac5d83 |
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 |
" |
|
2259 | 12 |
"{ Package: 'stx:libwidg' }" |
13 |
||
5246 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
0 | 16 |
EditTextView subclass:#TextCollector |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
17 |
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
|
18 |
outstandingLine flushBlock flushPending inFlush collecting |
3710 | 19 |
timeDelay access currentEmphasis alwaysAppendAtEnd collectSize |
5137 | 20 |
autoRaise' |
4365 | 21 |
classVariableNames:'TranscriptQuerySignal DebugSendersOfMessagePattern |
5455 | 22 |
TraceSendersOfMessagePattern TimestampMessages DefaultLineLimit |
5301 | 23 |
DefaultTimeDelay DefaultCollectSize' |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
24 |
poolDictionaries:'' |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
25 |
category:'Views-Text' |
0 | 26 |
! |
27 |
||
928 | 28 |
!TextCollector class methodsFor:'documentation'! |
15 | 29 |
|
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
30 |
copyright |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
31 |
" |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
32 |
COPYRIGHT (c) 1989 by Claus Gittinger |
59 | 33 |
All Rights Reserved |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
34 |
|
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
35 |
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
|
36 |
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
|
37 |
inclusion of the above copyright notice. This software may not |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
38 |
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
|
39 |
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
|
40 |
hereby transferred. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
41 |
" |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
42 |
! |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
43 |
|
15 | 44 |
documentation |
45 |
" |
|
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
46 |
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
|
47 |
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
|
48 |
received text. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
49 |
Its main use in the system is the Transcript, but it can also be used for |
110 | 50 |
things like trace-windows, errorLogs etc. |
4650 | 51 |
It is also inherited by TerminalView, which especially uses the buffering and |
52 |
delayed output features for high performance output (compare to a windows console). |
|
0 | 53 |
|
60 | 54 |
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
|
55 |
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
|
56 |
data - finally updating the whole chunk in one piece. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
57 |
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
|
58 |
(on fast displays this is less of a problem). |
15 | 59 |
|
60 | 60 |
The total number of lines kept is controlled by lineLimit, if more lines |
61 |
than this limit are added at the bottom, the textcollector will forget lines |
|
4650 | 62 |
at the top. 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
|
63 |
of memory then ... |
77 | 64 |
|
586 | 65 |
[StyleSheet paramters (transcript only):] |
66 |
||
67 |
transcriptForegroundColor defaults to textForegroundColor |
|
68 |
transcriptBackgroundColor' defaults to textBackgroundColor. |
|
77 | 69 |
|
586 | 70 |
transcriptCursorForegroundColor |
71 |
transcriptCursorBackgroundColor |
|
77 | 72 |
|
586 | 73 |
[author:] |
74 |
Claus Gittinger |
|
75 |
||
76 |
[see also:] |
|
77 |
CodeView EditTextView |
|
78 |
ActorStream |
|
15 | 79 |
" |
80 |
! ! |
|
0 | 81 |
|
928 | 82 |
!TextCollector class methodsFor:'instance creation'! |
0 | 83 |
|
2025
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
84 |
initialize |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
85 |
TranscriptQuerySignal := QuerySignal new. |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
86 |
|
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
87 |
! |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
88 |
|
0 | 89 |
newTranscript |
778
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
90 |
"create and open a new transcript. |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
91 |
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
|
92 |
were two different views. It is no longer recommended." |
110 | 93 |
|
3852
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
94 |
^ self newTranscript:#Transcript |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
95 |
|
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
96 |
" |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
97 |
TextCollector newTranscript. |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
98 |
Transcript lineLimit:3000. |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
99 |
" |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
100 |
|
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
101 |
"Modified: 17.2.1997 / 18:20:27 / cg" |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
102 |
! |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
103 |
|
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
104 |
newTranscript:name |
5301 | 105 |
"create and open a new transcript, unless one already exists by that name. |
106 |
The transcript is remembered in a global by that name. |
|
3852
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
107 |
This is a leftOver method from times were the Launcher & Transcript |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
108 |
were two different views. It is no longer recommended." |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
109 |
|
1900
d334ab9d32d5
removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
110 |
|topView transcript defSz f v lines cols| |
0 | 111 |
|
4476 | 112 |
transcript := Smalltalk at:name. |
113 |
(transcript isTextView and:[transcript isOpen and:[transcript device == Screen current]]) ifTrue:[ |
|
114 |
"if there is already an open Transcript on the same device, |
|
115 |
do not open an additional one. |
|
116 |
expecco StandardLibrary <= 2.0.0.3 checked for Transcript>>#isStream and |
|
117 |
tries to opens a new Transcript window for each new Transcribe with expecco >=2.4" |
|
118 |
^ transcript. |
|
119 |
]. |
|
120 |
||
3852
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
121 |
topView := StandardSystemView label:name "minExtent:(100 @ 100)". |
0 | 122 |
|
60 | 123 |
v := HVScrollableView for:self miniScrollerH:true miniScrollerV:false in:topView. |
0 | 124 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
125 |
transcript := v scrolledView. |
|
126 |
"transcript partialLines:false." |
|
127 |
||
128 |
f := transcript font. |
|
60 | 129 |
|
130 |
" |
|
131 |
should add the height of the frame & scrollbars to be exact ... |
|
132 |
" |
|
1900
d334ab9d32d5
removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
133 |
defSz := self defaultTranscriptSize. |
d334ab9d32d5
removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
134 |
cols := defSz x. |
d334ab9d32d5
removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
135 |
lines := defSz y. |
60 | 136 |
topView extent:(((f widthOf:'x') * cols) @ (f height * lines)). |
0 | 137 |
|
3852
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
138 |
transcript beTranscript:name. |
59 | 139 |
|
80 | 140 |
" |
141 |
run it at a slightly higher prio, to allow for |
|
142 |
delayed buffered updates to be performed |
|
143 |
" |
|
144 |
topView openWithPriority:(Processor userSchedulingPriority + 1). |
|
15 | 145 |
|
0 | 146 |
^ transcript |
110 | 147 |
|
148 |
" |
|
3852
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
149 |
TextCollector newTranscript:#T2. |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
150 |
T2 showCR:'Hello world'. |
110 | 151 |
" |
778
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
152 |
|
1026 | 153 |
"Modified: 17.2.1997 / 18:20:27 / cg" |
0 | 154 |
! ! |
155 |
||
2025
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
156 |
!TextCollector class methodsFor:'Signal constants'! |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
157 |
|
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
158 |
transcriptQuerySignal |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
159 |
^ TranscriptQuerySignal |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
160 |
! ! |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
161 |
|
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
162 |
!TextCollector class methodsFor:'debugging'! |
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
163 |
|
4365 | 164 |
debugSendersOfMessagePattern |
165 |
^ DebugSendersOfMessagePattern |
|
166 |
||
167 |
"Created: / 02-02-2012 / 12:05:27 / cg" |
|
168 |
! |
|
169 |
||
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
170 |
debugSendersOfMessagePattern:aGLOBMatchPattern |
4233
ae8979201707
changed: #debugSendersOfMessagePattern:
Claus Gittinger <cg@exept.de>
parents:
4124
diff
changeset
|
171 |
"ever want to know, who sends a particular text-message to the transcript ? |
4365 | 172 |
Call this with a match string and get a halt, when a matching text is sent to the transcript" |
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
173 |
|
4654 | 174 |
DebugSendersOfMessagePattern := aGLOBMatchPattern asNilIfEmpty |
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
175 |
|
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
176 |
" |
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
177 |
self debugSendersOfMessagePattern:'no such*' |
4233
ae8979201707
changed: #debugSendersOfMessagePattern:
Claus Gittinger <cg@exept.de>
parents:
4124
diff
changeset
|
178 |
self debugSendersOfMessagePattern:'remove*' |
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
179 |
self debugSendersOfMessagePattern:nil. |
4284
3e487b994a8b
changed: #debugSendersOfMessagePattern:
Claus Gittinger <cg@exept.de>
parents:
4233
diff
changeset
|
180 |
self debugSendersOfMessagePattern:'*'. |
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
181 |
" |
4233
ae8979201707
changed: #debugSendersOfMessagePattern:
Claus Gittinger <cg@exept.de>
parents:
4124
diff
changeset
|
182 |
|
4365 | 183 |
"Modified: / 02-02-2012 / 12:07:11 / cg" |
184 |
! |
|
185 |
||
4643 | 186 |
timestampMessages |
187 |
^ TimestampMessages |
|
188 |
! |
|
189 |
||
190 |
timestampMessages:aBoolean |
|
191 |
"if true, all messages are shown with a timestamp in front" |
|
192 |
||
193 |
TimestampMessages := aBoolean |
|
194 |
||
195 |
" |
|
196 |
self timestampMessages:true |
|
197 |
self timestampMessages:false. |
|
198 |
" |
|
199 |
! |
|
200 |
||
4365 | 201 |
traceSendersOfMessagePattern |
202 |
^ TraceSendersOfMessagePattern |
|
203 |
||
204 |
"Created: / 02-02-2012 / 12:05:32 / cg" |
|
205 |
! |
|
206 |
||
207 |
traceSendersOfMessagePattern:aGLOBMatchPattern |
|
208 |
"ever want to know, who sends a particular text-message to the transcript ? |
|
209 |
Call this with a match string and get a trace, when a matching text is sent to the transcript" |
|
210 |
||
4654 | 211 |
TraceSendersOfMessagePattern := aGLOBMatchPattern asNilIfEmpty |
4365 | 212 |
|
213 |
" |
|
214 |
self traceSendersOfMessagePattern:'removed unreached*' |
|
215 |
self traceSendersOfMessagePattern:nil. |
|
216 |
self traceSendersOfMessagePattern:'*'. |
|
217 |
" |
|
218 |
||
219 |
"Created: / 02-02-2012 / 11:59:22 / cg" |
|
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
220 |
! ! |
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
221 |
|
928 | 222 |
!TextCollector class methodsFor:'defaults'! |
0 | 223 |
|
1610
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
224 |
defaultCollectSize |
5301 | 225 |
"the number of lines buffered for delayed update. |
226 |
At most this number of lines to be shown are buffered (without redrawing), |
|
227 |
before a redraw is done. Thus, if a lot of output is generated fast, |
|
228 |
the redrawing is performed in chunks. |
|
229 |
This has a significant effect on the performane, |
|
230 |
as the view does not have to scroll and redraw for each |
|
231 |
individual line, but does junp-scrolling instead. |
|
232 |
See also defaultTimeDelay" |
|
233 |
||
234 |
^ DefaultCollectSize ? 1000 |
|
1610
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
235 |
|
5301 | 236 |
"Modified: / 27.7.1998 / 16:14:51 / cg" |
237 |
! |
|
238 |
||
239 |
defaultCollectSize:numberOfLines |
|
240 |
"the number of lines buffered for delayed update. |
|
241 |
At most this number of lines to be shown are buffered (without redrawing), |
|
242 |
before a redraw is done. Thus, if a lot of output is generated fast, |
|
243 |
the redrawing is performed in chunks. |
|
244 |
This has a significant effect on the performane, |
|
245 |
as the view does not have to scroll and redraw for each |
|
246 |
individual line, but does junp-scrolling instead. |
|
247 |
See also defaultTimeDelay" |
|
248 |
||
249 |
DefaultCollectSize := numberOfLines |
|
1610
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
250 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
251 |
"Modified: / 27.7.1998 / 16:14:51 / cg" |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
252 |
! |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
253 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
254 |
defaultLineLimit |
5301 | 255 |
"the number of lines remembered by default. |
256 |
Only the last n lines are remembered and can be seen by scrolling. |
|
257 |
Older lines are forgotten. |
|
258 |
This limit can be changed by the userPreferences dialog" |
|
259 |
||
260 |
^ DefaultLineLimit ? 1000 |
|
261 |
! |
|
59 | 262 |
|
5301 | 263 |
defaultLineLimit:numberOfLines |
264 |
"the number of lines remembered by default. |
|
265 |
Only the last n lines are remembered and can be seen by scrolling. |
|
266 |
Older lines are forgotten. |
|
267 |
This limit can be changed by the userPreferences dialog" |
|
268 |
||
269 |
DefaultLineLimit := numberOfLines |
|
59 | 270 |
! |
271 |
||
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
272 |
defaultTimeDelay |
5301 | 273 |
"the time in seconds to wait & collect by default. |
274 |
At most this number of seconds incoming text is buffered (without redrawing), |
|
275 |
before a redraw is done. Thus, if a lot of output is generated fast, |
|
276 |
the redrawing is performed in chunks. |
|
277 |
This has a significant effect on the performane, |
|
278 |
as the view does not have to scroll and redraw for each |
|
279 |
individual line, but does junp-scrolling instead. |
|
280 |
The value may be a float (eg. 0.5) |
|
281 |
See also defaultCollectSize" |
|
282 |
||
283 |
^ DefaultTimeDelay ? 0.5 |
|
284 |
! |
|
36 | 285 |
|
5301 | 286 |
defaultTimeDelay:seconds |
287 |
"the time in seconds to wait & collect by default. |
|
288 |
At most this number of seconds incoming text is buffered (without redrawing), |
|
289 |
before a redraw is done. Thus, if a lot of output is generated fast, |
|
290 |
the redrawing is performed in chunks. |
|
291 |
This has a significant effect on the performane, |
|
292 |
as the view does not have to scroll and redraw for each |
|
293 |
individual line, but does junp-scrolling instead. |
|
294 |
The argument may be a float (eg. 0.5) |
|
295 |
See also defaultCollectSize" |
|
296 |
||
297 |
DefaultTimeDelay := seconds |
|
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
298 |
! |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
299 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
300 |
defaultTranscriptSize |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
301 |
"the number of cols/lines by which the Transcript should come up" |
110 | 302 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
303 |
^ 70@11 |
110 | 304 |
! ! |
305 |
||
2744 | 306 |
!TextCollector methodsFor:'Compatibility-ST80'! |
1500 | 307 |
|
308 |
deselect |
|
309 |
self unselect |
|
1504
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
310 |
! |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
311 |
|
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
312 |
flush |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
313 |
self endEntry. |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
314 |
super flush |
1500 | 315 |
! ! |
316 |
||
0 | 317 |
!TextCollector methodsFor:'accessing'! |
318 |
||
3710 | 319 |
autoRaise |
320 |
^ autoRaise ? false |
|
321 |
! |
|
322 |
||
323 |
autoRaise:something |
|
324 |
autoRaise := something. |
|
325 |
! |
|
326 |
||
0 | 327 |
collect:aBoolean |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
328 |
"turn on/off collecting - if on, do not output immediately |
15 | 329 |
but collect text and output en-bloque after some time delta" |
0 | 330 |
|
331 |
collecting := aBoolean |
|
332 |
! |
|
333 |
||
1610
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
334 |
collectSize:numberOfLines |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
335 |
"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
|
336 |
the receiver will force update of the view, |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
337 |
whenever that many lines have been collected |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
338 |
(or the updateTimeDelay interval has passed). |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
339 |
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
|
340 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
341 |
collectSize := numberOfLines |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
342 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
343 |
"Modified: / 27.7.1998 / 16:16:00 / cg" |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
344 |
! |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
345 |
|
0 | 346 |
destroyAction:aBlock |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
347 |
"define the action to be performed when I get destroyed. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
348 |
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
|
349 |
when closed. (see TextCollectorclass>>newTranscript)" |
0 | 350 |
|
351 |
destroyAction := aBlock |
|
352 |
! |
|
353 |
||
2103 | 354 |
lineLimit |
355 |
"return the number of text-lines I am supposed to hold" |
|
356 |
||
357 |
^ lineLimit |
|
358 |
||
359 |
" |
|
360 |
Transcript lineLimit:5000 |
|
361 |
Transcript lineLimit |
|
362 |
" |
|
363 |
||
364 |
"Modified: / 16.5.1998 / 01:33:52 / cg" |
|
365 |
! |
|
366 |
||
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
367 |
lineLimit:aNumber |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
368 |
"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
|
369 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
370 |
lineLimit := aNumber |
1611 | 371 |
|
372 |
" |
|
373 |
Transcript lineLimit:5000 |
|
374 |
" |
|
375 |
||
376 |
"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
|
377 |
! |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
378 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
379 |
updateTimeDelay:seconds |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
380 |
"if collect is enabled, the receiver will update its view, |
4643 | 381 |
after that time delay (i.e. it collects output during that period), |
1610
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
382 |
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
|
383 |
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
|
384 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
385 |
timeDelay := seconds |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
386 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
387 |
"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
|
388 |
! ! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
389 |
|
3969
a914bce039b7
category of: #exposeX:y:width:height:
Claus Gittinger <cg@exept.de>
parents:
3958
diff
changeset
|
390 |
!TextCollector methodsFor:'event handling'! |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
391 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
392 |
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
|
393 |
"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
|
394 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
395 |
super exposeX:x y:y width:w height:h. |
4657 | 396 |
"/ self endEntry |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
397 |
! ! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
398 |
|
2750 | 399 |
!TextCollector methodsFor:'initialization & release'! |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
400 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
401 |
destroy |
928 | 402 |
"destroy this view" |
403 |
||
3201 | 404 |
destroyAction value. |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
405 |
super destroy |
928 | 406 |
|
1714 | 407 |
"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
|
408 |
! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
409 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
410 |
editMenu |
928 | 411 |
"return my popUpMenu; thats the superClasses menu, |
412 |
minus any accept item." |
|
413 |
||
1262
d69149b5be1f
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
414 |
<resource: #programMenu> |
1109 | 415 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
416 |
|m idx| |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
417 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
418 |
m := super editMenu. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
419 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
420 |
" |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
421 |
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
|
422 |
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
|
423 |
" |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
424 |
idx := m indexOf:#accept. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
425 |
idx ~~ 0 ifTrue:[ |
928 | 426 |
m remove:idx. |
427 |
(m labels at:(idx - 1)) = '-' ifTrue:[ |
|
428 |
m remove:idx - 1 |
|
429 |
]. |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
430 |
]. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
431 |
^ m |
928 | 432 |
|
1262
d69149b5be1f
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
433 |
"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
|
434 |
! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
435 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
436 |
initialize |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
437 |
super initialize. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
438 |
|
2164
ed46136cb2cf
honor scrollWhenUpdating setting
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
439 |
scrollWhenUpdating := #endOfText. |
ed46136cb2cf
honor scrollWhenUpdating setting
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
440 |
|
928 | 441 |
outstandingLines := nil. |
1562
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
442 |
alwaysAppendAtEnd := true. |
1610
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
443 |
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
|
444 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
445 |
flushPending := inFlush := false. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
446 |
collecting := true. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
447 |
timeDelay := self class defaultTimeDelay. |
4965 | 448 |
access := RecursionLock new name:'TextCollector access lock'. |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
449 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
450 |
lineLimit := self class defaultLineLimit. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
451 |
entryStream := ActorStream new. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
452 |
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
|
453 |
entryStream nextPutAllBlock:[:something | self nextPutAll:something] |
928 | 454 |
|
2086
95ec18a17198
give my access sema a name (for the semaphoreMonitor)
Claus Gittinger <cg@exept.de>
parents:
2025
diff
changeset
|
455 |
"Modified: / 14.12.1999 / 21:13:54 / cg" |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
456 |
! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
457 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
458 |
mapped |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
459 |
"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
|
460 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
461 |
super mapped. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
462 |
self endEntry |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
463 |
! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
464 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
465 |
reinitialize |
2259 | 466 |
"reinit after a snapIn. |
467 |
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
|
468 |
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
|
469 |
|
4645 | 470 |
flushPending := inFlush := false. |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
471 |
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
|
472 |
super reinitialize. |
1467
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
473 |
|
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
474 |
"Modified: / 5.3.1998 / 10:09:14 / stefan" |
2591 | 475 |
! |
476 |
||
477 |
release |
|
478 |
flushBlock notNil ifTrue:[ |
|
479 |
Processor removeTimedBlock:flushBlock. |
|
480 |
flushBlock := nil. |
|
481 |
]. |
|
482 |
outstandingLines := nil. |
|
483 |
outstandingLine := ''. |
|
484 |
||
485 |
super release |
|
486 |
||
487 |
"Modified: / 9.11.1998 / 21:18:17 / cg" |
|
0 | 488 |
! ! |
489 |
||
490 |
!TextCollector methodsFor:'private'! |
|
491 |
||
492 |
checkLineLimit |
|
493 |
"this method checks if the text has become too large (> lineLimit) |
|
494 |
and cuts off some lines at the top if so; it must be called whenever lines |
|
495 |
have been added to the bottom" |
|
496 |
||
2426
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
497 |
|nDel newCursorLine| |
0 | 498 |
|
499 |
lineLimit notNil ifTrue:[ |
|
2426
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
500 |
(cursorLine > lineLimit) ifTrue:[ |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
501 |
nDel := list size - lineLimit. |
4772 | 502 |
self basicListRemoveFromIndex:1 toIndex:nDel. |
2426
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
503 |
newCursorLine := cursorLine - nDel. |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
504 |
firstLineShown := firstLineShown - nDel. |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
505 |
(firstLineShown < 1) ifTrue:[ |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
506 |
newCursorLine := newCursorLine - firstLineShown + 1. |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
507 |
firstLineShown := 1 |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
508 |
]. |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
509 |
self setCursorLine:newCursorLine. |
3320
a820e3101bb6
refresh when removing some lines after hitting linelimit
fm
parents:
3295
diff
changeset
|
510 |
self contentsChanged. |
a820e3101bb6
refresh when removing some lines after hitting linelimit
fm
parents:
3295
diff
changeset
|
511 |
self invalidate. |
2426
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
512 |
] |
3710 | 513 |
]. |
514 |
self autoRaise ifTrue:[ |
|
515 |
self topView |
|
516 |
raise; |
|
517 |
"/ setForegroundWindow; |
|
518 |
yourself. |
|
519 |
]. |
|
3320
a820e3101bb6
refresh when removing some lines after hitting linelimit
fm
parents:
3295
diff
changeset
|
520 |
|
a820e3101bb6
refresh when removing some lines after hitting linelimit
fm
parents:
3295
diff
changeset
|
521 |
"Modified: / 26-07-2006 / 16:02:15 / fm" |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
522 |
! |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
523 |
|
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
524 |
installDelayedUpdate |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
525 |
"arrange for collecting input for some time, |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
526 |
and output all buffered strings at once after a while. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
527 |
This makes output to the transcript much faster on systems |
553 | 528 |
with poor scrolling performance (i.e. dumb vga cards ...)." |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
529 |
|
131 | 530 |
|p| |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
531 |
|
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
532 |
flushPending ifFalse:[ |
553 | 533 |
inFlush ifFalse:[ |
4643 | 534 |
flushPending := true. |
553 | 535 |
" |
536 |
we could run under a process, which dies in the meantime; |
|
537 |
therefore, we have to arrange for the transcript process to |
|
538 |
be interrupted and do the update. |
|
539 |
" |
|
540 |
windowGroup isNil ifTrue:[ |
|
4503 | 541 |
p := Processor timeoutHandlerProcess |
553 | 542 |
] ifFalse:[ |
543 |
p := windowGroup process |
|
544 |
]. |
|
1221
0c2a4231fc9e
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1109
diff
changeset
|
545 |
(p isNil or:[p isSystemProcess]) ifTrue:[ |
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
546 |
self endEntry |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
547 |
] ifFalse:[ |
1711 | 548 |
flushBlock isNil ifTrue:[ |
4650 | 549 |
flushBlock := [self delayedEndEntry]. |
1711 | 550 |
]. |
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
551 |
Processor addTimedBlock:flushBlock for:p afterSeconds:timeDelay. |
3009
7eb1704fa5a6
Avoid dangling references in context
Stefan Vogel <sv@exept.de>
parents:
3006
diff
changeset
|
552 |
]. |
4650 | 553 |
p := nil. "hack: avoid dangling references to p through the home context of flushBlock" |
553 | 554 |
] |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
555 |
] |
553 | 556 |
|
1711 | 557 |
"Modified: / 17.4.1997 / 13:03:15 / stefan" |
558 |
"Modified: / 9.11.1998 / 14:34:07 / cg" |
|
4365 | 559 |
! |
560 |
||
561 |
senderTraceString |
|
562 |
"generate a sender trace string." |
|
563 |
||
564 |
|con| |
|
565 |
||
566 |
"/ skip over intermediate contexts |
|
567 |
"/ con := con sender. |
|
568 |
"/ con := thisContext sender sender. |
|
569 |
"/ [ con receiver == self ] whileTrue:[ |
|
570 |
"/ con := con sender |
|
571 |
"/ ]. |
|
572 |
con := DebugView interestingContextFrom:thisContext sender sender. |
|
573 |
^ con printString |
|
574 |
||
575 |
"Created: / 02-02-2012 / 11:58:17 / cg" |
|
0 | 576 |
! ! |
577 |
||
778
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
578 |
!TextCollector methodsFor:'queries'! |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
579 |
|
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
580 |
current |
4687 | 581 |
"return the current (your screen's) transcript. |
5301 | 582 |
In multiDisplay applications, this need NOT be the main transcript, |
583 |
as each display may have its own transcript. |
|
778
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
584 |
But typically, this is the same as Transcript." |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
585 |
|
2278 | 586 |
|theTranscript app| |
2025
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
587 |
|
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
588 |
theTranscript := TranscriptQuerySignal query. |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
589 |
theTranscript isNil ifTrue:[ |
2278 | 590 |
app := self topView application class current. |
2763
e2fba3262e07
Avoid recursion when getting the Transcript on extra displays
Stefan Vogel <sv@exept.de>
parents:
2750
diff
changeset
|
591 |
(app notNil and:[thisContext isRecursive not]) ifTrue:[ |
2278 | 592 |
theTranscript := (app transcript ? Stderr). |
593 |
] ifFalse:[ |
|
594 |
theTranscript := Stderr. |
|
595 |
] |
|
2025
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
596 |
]. |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
597 |
^ theTranscript |
778
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
598 |
|
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
599 |
" |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
600 |
Transcript current flash |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
601 |
" |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
602 |
|
4687 | 603 |
"Created: / 05-07-1996 / 14:14:34 / cg" |
604 |
"Modified (comment): / 29-08-2013 / 11:04:55 / cg" |
|
4441
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
605 |
! |
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
606 |
|
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
607 |
isStream |
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
608 |
"if I am the Transcript, I am used as a stream. |
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
609 |
See #displayOn:" |
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
610 |
|
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
611 |
^ self == Transcript |
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
612 |
|
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
613 |
" |
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
614 |
Transcript isStream |
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
615 |
" |
4687 | 616 |
! |
617 |
||
618 |
isTextCollector |
|
619 |
^ true |
|
620 |
||
621 |
" |
|
622 |
Transcript isTextCollector |
|
623 |
" |
|
624 |
||
625 |
"Created: / 29-08-2013 / 11:32:46 / cg" |
|
5330 | 626 |
! |
627 |
||
628 |
position |
|
629 |
"for compatibiliy with normal streams; return the column" |
|
630 |
||
631 |
^ cursorCol |
|
778
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
632 |
! ! |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
633 |
|
2450 | 634 |
!TextCollector methodsFor:'scrolling'! |
635 |
||
5136 | 636 |
makeCursorVisible |
5137 | 637 |
(scrollLocked ? false) ifFalse:[ |
5136 | 638 |
access critical:[ |
639 |
super makeCursorVisible |
|
640 |
] |
|
641 |
] |
|
642 |
! |
|
643 |
||
644 |
scrollLock:aBoolean |
|
645 |
aBoolean ifTrue:[ |
|
646 |
scrollWhenUpdating := #endOfText. |
|
647 |
] ifFalse:[ |
|
648 |
scrollWhenUpdating := nil. |
|
649 |
]. |
|
5137 | 650 |
scrollLocked := aBoolean. |
5136 | 651 |
! |
652 |
||
2450 | 653 |
scrollTo:anOrigin redraw:doRedraw |
654 |
access critical:[ |
|
655 |
super scrollTo:anOrigin redraw:doRedraw |
|
656 |
] |
|
657 |
! ! |
|
658 |
||
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
659 |
!TextCollector methodsFor:'stream messages'! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
660 |
|
4106 | 661 |
addLine:line |
662 |
"append a line to the outstanding lines buffer" |
|
663 |
||
664 |
access critical:[ |
|
665 |
outstandingLine size ~~ 0 ifTrue:[ |
|
666 |
outstandingLine := outstandingLine , line |
|
667 |
] ifFalse:[ |
|
4645 | 668 |
(TimestampMessages == true and:[self == Transcript]) ifTrue:[ |
4643 | 669 |
outstandingLine := Timestamp now printString,' ',line |
670 |
] ifFalse:[ |
|
671 |
outstandingLine := line |
|
672 |
] |
|
4106 | 673 |
]. |
4650 | 674 |
"/ self ~~ Transcript ifTrue:['xa' printCR]. |
4106 | 675 |
outstandingLines isNil ifTrue:[ |
676 |
outstandingLines := OrderedCollection with:outstandingLine |
|
677 |
] ifFalse:[ |
|
678 |
outstandingLines add:outstandingLine. |
|
679 |
]. |
|
680 |
outstandingLine := ''. |
|
681 |
||
682 |
collecting ifTrue:[ |
|
4643 | 683 |
flushPending ifFalse:[ |
684 |
self installDelayedUpdate |
|
685 |
] ifTrue:[ |
|
4106 | 686 |
outstandingLines size > collectSize ifTrue:[ |
687 |
self endEntry |
|
688 |
] |
|
689 |
] |
|
690 |
] ifFalse:[ |
|
691 |
self endEntry. |
|
692 |
self cursorReturn. |
|
693 |
self checkLineLimit. |
|
694 |
self cursorToEnd. |
|
695 |
] |
|
696 |
]. |
|
697 |
||
698 |
"Created: / 28.7.1998 / 00:31:46 / cg" |
|
699 |
"Modified: / 28.7.1998 / 00:34:58 / cg" |
|
700 |
! |
|
701 |
||
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
702 |
cr |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
703 |
"output a carriage return, finishing the current line" |
135 | 704 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
705 |
access critical:[ |
4643 | 706 |
|line| |
707 |
||
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
708 |
collecting ifTrue:[ |
4643 | 709 |
line := outstandingLine. |
4645 | 710 |
(TimestampMessages == true and:[self == Transcript]) ifTrue:[ |
4643 | 711 |
outstandingLine size == 0 ifTrue:[ |
712 |
line := Timestamp now printString |
|
713 |
]. |
|
714 |
]. |
|
4650 | 715 |
"/ self ~~ Transcript ifTrue:['xc' printCR]. |
4643 | 716 |
outstandingLines isNil ifTrue:[ |
717 |
outstandingLines := OrderedCollection with:line |
|
718 |
] ifFalse:[ |
|
719 |
outstandingLines add:line. |
|
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
720 |
]. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
721 |
outstandingLine := ''. |
4643 | 722 |
flushPending ifFalse:[ |
723 |
self installDelayedUpdate |
|
724 |
] |
|
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
725 |
] ifFalse:[ |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
726 |
self cursorReturn. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
727 |
self checkLineLimit. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
728 |
self cursorToEnd. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
729 |
]. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
730 |
]. |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
731 |
! |
135 | 732 |
|
4460 | 733 |
display:someObject |
734 |
"dolphin compatibility" |
|
735 |
||
5246 | 736 |
"/ someObject printOn:self. |
737 |
self nextPutAll: someObject asString. |
|
4460 | 738 |
! |
739 |
||
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
740 |
doesNotUnderstand:aMessage |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
741 |
"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
|
742 |
on to the stream which will send the characters via nextPut: |
3006 | 743 |
This way, we understand all Stream messages - great isn't it!!" |
744 |
||
3243 | 745 |
^ aMessage sendTo:entryStream |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
746 |
! |
0 | 747 |
|
4311 | 748 |
ensureCr |
749 |
"if the output position is not already at the beginning of a line, |
|
750 |
output a carriage return" |
|
751 |
||
752 |
|needCR| |
|
753 |
||
754 |
collecting ifTrue:[ |
|
755 |
needCR := outstandingLine notEmptyOrNil |
|
756 |
] ifFalse:[ |
|
757 |
needCR := cursorCol > 0 |
|
758 |
]. |
|
759 |
||
760 |
needCR ifTrue:[ |
|
761 |
self cr. |
|
762 |
]. |
|
763 |
||
764 |
"Created: / 14-09-2011 / 09:01:03 / cg" |
|
765 |
! |
|
766 |
||
5025 | 767 |
format:formatSpec with:args |
768 |
^ entryStream format:formatSpec with:args |
|
769 |
! |
|
770 |
||
0 | 771 |
lineLength |
928 | 772 |
"to make a textCollector (somewhat) compatible with printer |
773 |
streams, support the lineLength query" |
|
774 |
||
4918 | 775 |
^ width // (gc font width) |
928 | 776 |
|
777 |
"Modified: 11.1.1997 / 14:42:41 / cg" |
|
0 | 778 |
! |
779 |
||
780 |
nextPut:something |
|
928 | 781 |
"append somethings printString to my displayed text. |
782 |
This allows TextCollectors to be used Stream-wise" |
|
0 | 783 |
|
1504
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
784 |
|txt| |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
785 |
|
656 | 786 |
(something isCharacter) ifTrue:[ |
787 |
((something == Character cr) or:[something == Character nl]) ifTrue:[ |
|
788 |
^ self cr |
|
789 |
]. |
|
0 | 790 |
]. |
1504
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
791 |
|
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
792 |
txt := something asString. |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
793 |
currentEmphasis notNil ifTrue:[ |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
794 |
txt := txt emphasizeAllWith:currentEmphasis |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
795 |
]. |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
796 |
self show:txt. |
656 | 797 |
|
798 |
"/ flushPending ifTrue:[ |
|
799 |
"/ self endEntry |
|
800 |
"/ ]. |
|
801 |
"/ (something isMemberOf:Character) ifTrue:[ |
|
802 |
"/ ((something == Character cr) or:[something == Character nl]) ifTrue:[ |
|
803 |
"/ ^ self cr |
|
804 |
"/ ]. |
|
805 |
"/ self insertCharAtCursor:something |
|
806 |
"/ ] ifFalse:[ |
|
807 |
"/ self insertStringAtCursor:(something printString). |
|
808 |
"/ self checkLineLimit |
|
809 |
"/ ]. |
|
810 |
"/ device flush |
|
811 |
||
928 | 812 |
"Modified: 11.1.1997 / 14:43:05 / cg" |
0 | 813 |
! |
814 |
||
815 |
nextPutAll:something |
|
928 | 816 |
"append all of something to my displayed text. |
817 |
This allows TextCollectors to be used Stream-wise" |
|
0 | 818 |
|
3958 | 819 |
self show:(currentEmphasis notNil |
820 |
ifTrue:[something emphasizeAllWith:currentEmphasis] |
|
821 |
ifFalse:[something]) |
|
656 | 822 |
|
928 | 823 |
"Modified: 11.1.1997 / 14:43:26 / cg" |
0 | 824 |
! |
825 |
||
5320 | 826 |
nextPutAll:count from:buffer startingAt:initialPosition |
827 |
"append count characters from buffer starting at initialPosition to my displayed text. |
|
828 |
This allows TextCollectors to be used Stream-wise" |
|
829 |
||
830 |
|stringToShow| |
|
831 |
||
832 |
stringToShow := buffer copyFrom:initialPosition to:initialPosition+count-1. |
|
833 |
||
834 |
self show:(currentEmphasis notNil |
|
835 |
ifTrue:[stringToShow emphasizeAllWith:currentEmphasis] |
|
836 |
ifFalse:[stringToShow]). |
|
837 |
^ count. |
|
838 |
||
839 |
"Modified: 11.1.1997 / 14:43:26 / cg" |
|
840 |
! |
|
841 |
||
5130 | 842 |
println |
843 |
"for those used to Java/Javascript, a compatibility message. |
|
844 |
Most useful inside expecco" |
|
845 |
||
846 |
self cr |
|
847 |
! |
|
848 |
||
849 |
println:anObject |
|
850 |
"for those used to Java/Javascript, a compatibility message. |
|
851 |
Most useful inside expecco" |
|
852 |
||
853 |
self showCR:anObject |
|
854 |
! |
|
855 |
||
0 | 856 |
show:anObject |
857 |
"insert the argument aString at current cursor position" |
|
858 |
||
4045 | 859 |
|printString lines| |
0 | 860 |
|
4045 | 861 |
printString := anObject printString. |
928 | 862 |
|
4643 | 863 |
(self == Transcript) ifTrue:[ |
864 |
DebugSendersOfMessagePattern notNil ifTrue:[ |
|
865 |
(DebugSendersOfMessagePattern match:printString string) ifTrue:[ |
|
866 |
"disable all with: DebugSendersOfMessagePattern := nil" |
|
867 |
self halt:('Transcript: text matches: "', printString,'"'). |
|
868 |
]. |
|
4122 | 869 |
]. |
4643 | 870 |
TraceSendersOfMessagePattern notNil ifTrue:[ |
871 |
(TraceSendersOfMessagePattern match:printString string) ifTrue:[ |
|
872 |
printString := self senderTraceString,': ',printString |
|
873 |
]. |
|
4365 | 874 |
]. |
875 |
]. |
|
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
876 |
|
4045 | 877 |
(printString includes:(Character cr)) ifTrue:[ |
878 |
lines := printString asStringCollection. |
|
653 | 879 |
lines keysAndValuesDo:[:nr :line | |
1562
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
880 |
(nr == lines size |
4045 | 881 |
and:[(printString endsWith:(Character cr)) not]) ifTrue:[ |
653 | 882 |
"/ the last one. |
883 |
self show:line |
|
884 |
] ifFalse:[ |
|
885 |
self showCR:line |
|
886 |
]. |
|
887 |
]. |
|
888 |
^ self. |
|
308
b216a5efa2c8
handle show: with a string containing cr's
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
889 |
]. |
b216a5efa2c8
handle show: with a string containing cr's
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
890 |
|
1026 | 891 |
access critical:[ |
4650 | 892 |
"/ self ~~ Transcript ifTrue:['xs' printCR]. |
3295
37cb2b5d579a
Allow for readOnly TextCollectors
Stefan Vogel <sv@exept.de>
parents:
3248
diff
changeset
|
893 |
outstandingLine size ~~ 0 ifTrue:[ |
4045 | 894 |
outstandingLine := outstandingLine , printString |
1026 | 895 |
] ifFalse:[ |
4045 | 896 |
outstandingLine := printString |
653 | 897 |
]. |
1026 | 898 |
collecting ifTrue:[ |
899 |
flushPending ifFalse:[ |
|
900 |
self installDelayedUpdate |
|
1312
eaa44f7649f5
flush after some lines have been collected
Claus Gittinger <cg@exept.de>
parents:
1262
diff
changeset
|
901 |
] ifTrue:[ |
1562
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
902 |
outstandingLines size > collectSize ifTrue:[ |
1312
eaa44f7649f5
flush after some lines have been collected
Claus Gittinger <cg@exept.de>
parents:
1262
diff
changeset
|
903 |
self endEntry |
eaa44f7649f5
flush after some lines have been collected
Claus Gittinger <cg@exept.de>
parents:
1262
diff
changeset
|
904 |
] |
1026 | 905 |
] |
906 |
] ifFalse:[ |
|
907 |
self endEntry |
|
653 | 908 |
] |
1026 | 909 |
]. |
0 | 910 |
|
4411 | 911 |
"Modified: / 24-03-2012 / 20:04:10 / cg" |
4428 | 912 |
"Modified (format): / 02-06-2012 / 01:54:55 / cg" |
1617 | 913 |
! |
914 |
||
915 |
showCR:anObject |
|
916 |
"insert the argument aString at current cursor position, |
|
917 |
and advance to the next line. This is the same as a #show: |
|
918 |
followed by a #cr." |
|
919 |
||
5302 | 920 |
|printString lines crlf| |
1617 | 921 |
|
4647 | 922 |
"/ self ~~ Transcript ifTrue:[ ^ self tshow:anObject]. |
4045 | 923 |
printString := anObject printString. |
924 |
printString size == 0 ifTrue:[ |
|
2689
ddaa98a64bd5
Fix #showCR: when displaying multi-line strings
Stefan Vogel <sv@exept.de>
parents:
2632
diff
changeset
|
925 |
self cr. |
ddaa98a64bd5
Fix #showCR: when displaying multi-line strings
Stefan Vogel <sv@exept.de>
parents:
2632
diff
changeset
|
926 |
^ self. |
1617 | 927 |
]. |
928 |
||
4643 | 929 |
self == Transcript ifTrue:[ |
930 |
DebugSendersOfMessagePattern notNil ifTrue:[ |
|
931 |
(DebugSendersOfMessagePattern match:printString string) ifTrue:[ |
|
932 |
"/ to disable this right from inside the debugger, evaluate: |
|
5454 | 933 |
" |
934 |
DebugSendersOfMessagePattern := nil |
|
935 |
" |
|
4643 | 936 |
self halt:('Transcript: text matches: "', printString, '"'). |
937 |
]. |
|
4365 | 938 |
]. |
4643 | 939 |
TraceSendersOfMessagePattern notNil ifTrue:[ |
940 |
(TraceSendersOfMessagePattern match:printString string) ifTrue:[ |
|
941 |
printString := self senderTraceString,': ',printString |
|
942 |
]. |
|
4122 | 943 |
]. |
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
944 |
]. |
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
945 |
|
5302 | 946 |
crlf := String crlf. |
947 |
(printString includesAny:crlf) ifTrue:[ |
|
4045 | 948 |
lines := printString asStringCollection. |
2689
ddaa98a64bd5
Fix #showCR: when displaying multi-line strings
Stefan Vogel <sv@exept.de>
parents:
2632
diff
changeset
|
949 |
lines do:[:line| |
5302 | 950 |
|lineWithoutEOL| |
951 |
||
4106 | 952 |
(line endsWith:Character nl) ifTrue:[ |
5302 | 953 |
(line endsWith:crlf) ifTrue:[ |
954 |
lineWithoutEOL := line copyButLast:2. |
|
4106 | 955 |
] ifFalse:[ |
5302 | 956 |
lineWithoutEOL := line copyButLast:1. |
4106 | 957 |
] |
2805 | 958 |
] ifFalse:[ |
4106 | 959 |
(line endsWith:Character return) ifTrue:[ |
5302 | 960 |
lineWithoutEOL := line copyButLast:1. |
4106 | 961 |
] ifFalse:[ |
5302 | 962 |
lineWithoutEOL := line |
4106 | 963 |
] |
5302 | 964 |
]. |
965 |
self addLine:lineWithoutEOL. |
|
1617 | 966 |
]. |
967 |
^ self. |
|
968 |
]. |
|
4106 | 969 |
self addLine:printString |
4365 | 970 |
|
4410 | 971 |
"Modified: / 24-03-2012 / 20:00:08 / cg" |
4073 | 972 |
! |
973 |
||
4473 | 974 |
space |
975 |
self show:' ' |
|
976 |
! |
|
977 |
||
4073 | 978 |
tab |
979 |
"append a tab-character to the stream. |
|
980 |
This is only allowed, if the receiver supports writing." |
|
981 |
||
982 |
self nextPut:(Character tab) |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
983 |
! ! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
984 |
|
2746 | 985 |
!TextCollector methodsFor:'stream messages-emphasis'! |
1822
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
986 |
|
2539 | 987 |
bgColor:aColor |
4658 | 988 |
aColor isNil ifTrue:[ |
989 |
currentEmphasis := Text removeEmphasis:#backgroundColor from:currentEmphasis |
|
990 |
] ifFalse:[ |
|
991 |
currentEmphasis := Text addEmphasis:(#backgroundColor->aColor) to:currentEmphasis |
|
992 |
] |
|
2539 | 993 |
! |
994 |
||
1822
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
995 |
bold |
3205 | 996 |
"switch to bold - followup text sent via show/nextPutAll: will be inserted in |
997 |
a bold font." |
|
998 |
||
4658 | 999 |
currentEmphasis := Text addEmphasis:#bold to:currentEmphasis |
1822
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1000 |
! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1001 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1002 |
color:aColor |
4658 | 1003 |
aColor isNil ifTrue:[ |
1004 |
currentEmphasis := Text removeEmphasis:#color from:currentEmphasis |
|
1005 |
] ifFalse:[ |
|
1006 |
currentEmphasis := Text addEmphasis:(#color->aColor) to:currentEmphasis |
|
1007 |
]. |
|
1822
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1008 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1009 |
"Modified: / 26.3.1999 / 14:29:21 / cg" |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1010 |
! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1011 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1012 |
italic |
4658 | 1013 |
currentEmphasis := Text addEmphasis:#italic to:currentEmphasis |
1822
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1014 |
! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1015 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1016 |
normal |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1017 |
currentEmphasis := nil |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1018 |
! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1019 |
|
4659 | 1020 |
notBold |
1021 |
"switch to non-bold - followup text sent via show/nextPutAll: will be inserted in |
|
1022 |
a non-bold font." |
|
1023 |
||
1024 |
currentEmphasis := Text removeEmphasis:#bold from:currentEmphasis |
|
1025 |
! |
|
1026 |
||
1027 |
notItalic |
|
1028 |
"switch to non-italic - followup text sent via show/nextPutAll: will be inserted in |
|
1029 |
a non-italic font." |
|
1030 |
||
1031 |
currentEmphasis := Text removeEmphasis:#italic from:currentEmphasis |
|
1032 |
! |
|
1033 |
||
1034 |
notReverse |
|
1035 |
currentEmphasis := Text removeEmphasis:#color from:currentEmphasis. |
|
1036 |
currentEmphasis := Text removeEmphasis:#backgroundColor from:currentEmphasis. |
|
1037 |
! |
|
1038 |
||
1039 |
notUnderline |
|
1040 |
currentEmphasis := Text removeEmphasis:#underline from:currentEmphasis |
|
1041 |
||
1042 |
"Created: / 26.3.1999 / 14:27:07 / cg" |
|
1043 |
! |
|
1044 |
||
1822
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1045 |
reverse |
4658 | 1046 |
currentEmphasis := Text addEmphasis:(#color->bgColor) to:currentEmphasis. |
1047 |
currentEmphasis := Text addEmphasis:(#backgroundColor->fgColor) to:currentEmphasis. |
|
1822
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1048 |
! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1049 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1050 |
underline |
4658 | 1051 |
currentEmphasis := Text addEmphasis:#underline to:currentEmphasis |
1822
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1052 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1053 |
"Created: / 26.3.1999 / 14:27:07 / cg" |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1054 |
! ! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
1055 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1056 |
!TextCollector methodsFor:'transcript specials'! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1057 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1058 |
beTranscript |
928 | 1059 |
"make the receiver be the systemTranscript; this one |
1060 |
is accessable via the global Transcript and gets relevant |
|
1061 |
system messages from various places." |
|
1062 |
||
3852
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
1063 |
self beTranscript:#Transcript |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
1064 |
|
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
1065 |
"Modified: / 2.11.1997 / 22:34:47 / cg" |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
1066 |
! |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
1067 |
|
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
1068 |
beTranscript:name |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
1069 |
"make the receiver be the systemTranscript; this one |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
1070 |
is accessable via the global Transcript and gets relevant |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
1071 |
system messages from various places." |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
1072 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1073 |
|fg bg cFg cBg| |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1074 |
|
3852
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
1075 |
Smalltalk at:name put:self. |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1076 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1077 |
" |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1078 |
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
|
1079 |
" |
1421
afef284eadc4
only reset Transcript to stdErr, if I really am the transcript.
ca
parents:
1389
diff
changeset
|
1080 |
self destroyAction:[ |
3852
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
1081 |
self == (Smalltalk at:name) ifTrue:[ |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
1082 |
Smalltalk at:name put:Stderr |
1421
afef284eadc4
only reset Transcript to stdErr, if I really am the transcript.
ca
parents:
1389
diff
changeset
|
1083 |
] |
afef284eadc4
only reset Transcript to stdErr, if I really am the transcript.
ca
parents:
1389
diff
changeset
|
1084 |
]. |
0 | 1085 |
|
928 | 1086 |
"/ user may prefer a special color for this one; |
1087 |
"/ look into the style definitions ... |
|
1088 |
||
1389 | 1089 |
fg := styleSheet colorAt:'transcript.foregroundColor' default:self foregroundColor. |
1090 |
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
|
1091 |
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
|
1092 |
self viewBackground:bg. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1093 |
|
1389 | 1094 |
cFg := styleSheet colorAt:'transcript.cursorForegroundColor' default:bg. |
1095 |
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
|
1096 |
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
|
1097 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1098 |
"self lineLimit:1000. " "or whatever you think makes sense" |
928 | 1099 |
|
1389 | 1100 |
"Modified: / 2.11.1997 / 22:34:47 / cg" |
2928
24991431c7e0
added #clear (to clear its contents)
Claus Gittinger <cg@exept.de>
parents:
2831
diff
changeset
|
1101 |
! |
24991431c7e0
added #clear (to clear its contents)
Claus Gittinger <cg@exept.de>
parents:
2831
diff
changeset
|
1102 |
|
4643 | 1103 |
beginEntry |
1104 |
"noop for now, ST80 compatibility" |
|
1105 |
||
1106 |
^ self |
|
1107 |
||
1108 |
"Created: / 4.3.1998 / 11:08:14 / stefan" |
|
1109 |
! |
|
1110 |
||
2928
24991431c7e0
added #clear (to clear its contents)
Claus Gittinger <cg@exept.de>
parents:
2831
diff
changeset
|
1111 |
clear |
3119 | 1112 |
self endEntry. |
2928
24991431c7e0
added #clear (to clear its contents)
Claus Gittinger <cg@exept.de>
parents:
2831
diff
changeset
|
1113 |
self contents:nil. |
24991431c7e0
added #clear (to clear its contents)
Claus Gittinger <cg@exept.de>
parents:
2831
diff
changeset
|
1114 |
|
24991431c7e0
added #clear (to clear its contents)
Claus Gittinger <cg@exept.de>
parents:
2831
diff
changeset
|
1115 |
" |
24991431c7e0
added #clear (to clear its contents)
Claus Gittinger <cg@exept.de>
parents:
2831
diff
changeset
|
1116 |
Transcript clear |
24991431c7e0
added #clear (to clear its contents)
Claus Gittinger <cg@exept.de>
parents:
2831
diff
changeset
|
1117 |
" |
3774 | 1118 |
! |
1119 |
||
4650 | 1120 |
delayedEndEntry |
1121 |
"flush collected output; displaying all that has been buffered so far" |
|
1122 |
||
1123 |
"/ self ~~ Transcript ifTrue:[ 'de0' printCR ]. |
|
1124 |
inFlush ifTrue:[ |
|
1125 |
"/ self ~~ Transcript ifTrue:[ 'deX' printCR ]. |
|
1126 |
^ self |
|
1127 |
]. |
|
1128 |
||
1129 |
"/ self ~~ Transcript ifTrue:[ 'de1' printCR ]. |
|
1130 |
access owner == Processor activeProcess ifTrue:[ |
|
1131 |
"/ self ~~ Transcript ifTrue:[ 'de2' printCR ]. |
|
1132 |
self installDelayedUpdate. |
|
1133 |
^ self |
|
1134 |
]. |
|
1135 |
||
1136 |
self endEntry |
|
1137 |
! |
|
1138 |
||
4643 | 1139 |
endEntry |
1140 |
"flush collected output; displaying all that has been buffered so far" |
|
1141 |
||
4961 | 1142 |
|nLines lines device| |
4643 | 1143 |
|
4965 | 1144 |
((outstandingLines isEmptyOrNil) and:[outstandingLine isEmptyOrNil]) ifTrue:[ |
4650 | 1145 |
"/ self ~~ Transcript ifTrue:[ 'e- ' print. thisContext sender selector printCR ]. |
1146 |
^ self |
|
1147 |
]. |
|
4965 | 1148 |
shown ifFalse:[ |
1149 |
"/ when iconified or not yet shown, keep |
|
1150 |
"/ collecting. But not too much ... |
|
1151 |
outstandingLines size < 300 ifTrue:[ |
|
1152 |
"/ self ~~ Transcript ifTrue:[ 'eC' printCR ]. |
|
1153 |
access critical:[ |
|
1154 |
flushPending ifFalse:[ |
|
1155 |
self installDelayedUpdate. |
|
1156 |
]. |
|
1157 |
]. |
|
1158 |
^ self |
|
1159 |
] |
|
1160 |
]. |
|
4650 | 1161 |
|
4961 | 1162 |
device := self graphicsDevice. |
4963 | 1163 |
(device isNil or:[device isOpen not or:[self drawableId isNil]]) ifTrue:[ |
4961 | 1164 |
"on snapshot load, Transcript may not yet be re-created. |
1165 |
Write to Stderr then." |
|
1166 |
Stderr notNil ifTrue:[ |
|
4963 | 1167 |
outstandingLines do:[:eachLine| |
1168 |
eachLine printOn:Stderr. |
|
1169 |
]. |
|
4961 | 1170 |
outstandingLines := nil. |
1171 |
outstandingLine notNil ifTrue:[ |
|
1172 |
outstandingLine printOn:Stderr. |
|
1173 |
outstandingLine := nil. |
|
1174 |
]. |
|
1175 |
Stderr cr. |
|
1176 |
]. |
|
1177 |
^ self. |
|
1178 |
]. |
|
1179 |
||
4650 | 1180 |
"/ self ~~ Transcript ifTrue:[ 'e ' print. |
1181 |
"/ thisContext fullPrintAll. |
|
1182 |
"/ ]. |
|
4643 | 1183 |
|
4650 | 1184 |
"/ access owner == Processor activeProcess ifTrue:[ |
1185 |
"/self ~~ Transcript ifTrue:[ 'eI' printCR ]. |
|
1186 |
"/ self installDelayedUpdate. |
|
1187 |
"/ ^ self |
|
1188 |
"/ ]. |
|
4643 | 1189 |
|
1190 |
access critical:[ |
|
1191 |
collecting ifTrue:[ |
|
1192 |
flushBlock notNil ifTrue:[ |
|
1193 |
Processor removeTimedBlock:flushBlock. |
|
1194 |
]. |
|
4650 | 1195 |
"/ flushPending ifFalse:[ |
1196 |
"/self ~~ Transcript ifTrue:[ 'eP' printCR ]. |
|
1197 |
"/ ^ self |
|
1198 |
"/ ]. |
|
4643 | 1199 |
]. |
1200 |
||
4650 | 1201 |
"/ self ~~ Transcript ifTrue:[ 'e1' printCR ]. |
4643 | 1202 |
inFlush ifFalse:[ |
4650 | 1203 |
"/ self ~~ Transcript ifTrue:[ 'e2' printCR ]. |
4643 | 1204 |
inFlush := true. |
1205 |
[ |
|
1206 |
flushPending := false. |
|
5147 | 1207 |
self withAutoIndent:false do:[ |
4650 | 1208 |
"/ self ~~ Transcript ifTrue:[ 'e3 "' print. outstandingLine print. '" ' print. outstandingLine asByteArray hexPrintString print. ' ' printCR. |
1209 |
"/ (outstandingLines ? #()) do:[:l | '"' print. l print. '" ' print. l asByteArray hexPrintString printCR ]]. |
|
1210 |
(nLines := outstandingLines size) ~~ 0 ifTrue:[ |
|
1211 |
"/ self ~~ Transcript ifTrue:[ 'e4' printCR.]. |
|
4643 | 1212 |
"insert the bunch of lines - if any" |
1213 |
lines := outstandingLines. |
|
1214 |
outstandingLines := nil. |
|
1215 |
||
4650 | 1216 |
"/ self ~~ Transcript ifTrue:[ 'e5 ' print. nLines printCR.]. |
4643 | 1217 |
(nLines ~~ 0) ifTrue:[ |
1218 |
self isInInsertMode ifTrue:[ |
|
4650 | 1219 |
"/ self ~~ Transcript ifTrue:[ (nLines > 1 and:[(lines second ? '') startsWith:'111']) ifTrue:['e6a' printCR.self halt.]]. |
4643 | 1220 |
self insertLines:lines withCR:true. |
4650 | 1221 |
"/ self ~~ Transcript ifTrue:[ (nLines > 1 and:[(lines second ? '') startsWith:'111']) ifTrue:['e6a' printCR.self halt.]]. |
4643 | 1222 |
] ifFalse:[ |
1223 |
self replaceLines:lines withCR:true |
|
1224 |
]. |
|
1225 |
alwaysAppendAtEnd ifTrue:[ |
|
1226 |
self cursorToEnd. |
|
1227 |
]. |
|
1228 |
(cursorLine >= (firstLineShown + nFullLinesShown)) ifTrue:[ |
|
5137 | 1229 |
scrollLocked ifFalse:[ |
1230 |
self withCursorOffDo:[ |
|
1231 |
self scrollDown:nLines |
|
1232 |
] |
|
1233 |
]. |
|
4643 | 1234 |
]. |
1235 |
]. |
|
1236 |
]. |
|
1237 |
||
4650 | 1238 |
"/ self ~~ Transcript ifTrue:[ (nLines > 1 and:[(lines second ? '') startsWith:'111']) ifTrue:['e7a' printCR.self halt.]]. |
4643 | 1239 |
"and the last partial line - if any" |
1240 |
outstandingLine size ~~ 0 ifTrue:[ |
|
1241 |
self isInInsertMode ifTrue:[ |
|
1242 |
self insertStringAtCursor:outstandingLine. |
|
1243 |
] ifFalse:[ |
|
1244 |
self replaceStringAtCursor:outstandingLine. |
|
1245 |
]. |
|
1246 |
outstandingLine := ''. |
|
1247 |
]. |
|
1248 |
self checkLineLimit. |
|
1249 |
"/ device flush. |
|
5147 | 1250 |
]. |
4643 | 1251 |
] ensure:[ |
1252 |
inFlush := false. |
|
1253 |
] |
|
1254 |
]. |
|
4657 | 1255 |
"/ flushPending ifTrue:[ |
1256 |
"/ flushPending := false. |
|
1257 |
"/ self installDelayedUpdate |
|
1258 |
"/ ] |
|
4643 | 1259 |
]. |
1260 |
||
1261 |
"Modified: / 9.11.1998 / 21:17:56 / cg" |
|
1262 |
! |
|
1263 |
||
3774 | 1264 |
flash |
1265 |
"make sure everything is visible, before flashing" |
|
1266 |
||
1267 |
self endEntry. |
|
1268 |
super flash. |
|
5408 | 1269 |
! |
1270 |
||
1271 |
flash:message withColor:flashColor |
|
1272 |
"make sure everything is visible, before flashing" |
|
1273 |
||
1274 |
self endEntry. |
|
1275 |
super flash:message withColor:flashColor. |
|
0 | 1276 |
! ! |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1277 |
|
928 | 1278 |
!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
|
1279 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1280 |
version |
5408 | 1281 |
^ '$Header$' |
3958 | 1282 |
! |
1283 |
||
1284 |
version_CVS |
|
5408 | 1285 |
^ '$Header$' |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1286 |
! ! |
2632 | 1287 |
|
4503 | 1288 |
|
2025
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
1289 |
TextCollector initialize! |