author | Stefan Vogel <sv@exept.de> |
Tue, 12 Feb 2013 14:23:25 +0100 | |
changeset 4503 | 08d33a9017e2 |
parent 4476 | 9f306f7859b9 |
child 4563 | 8a07934c6a20 |
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 |
||
0 | 14 |
EditTextView subclass:#TextCollector |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
15 |
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
|
16 |
outstandingLine flushBlock flushPending inFlush collecting |
3710 | 17 |
timeDelay access currentEmphasis alwaysAppendAtEnd collectSize |
18 |
autoRaise' |
|
4365 | 19 |
classVariableNames:'TranscriptQuerySignal DebugSendersOfMessagePattern |
20 |
TraceSendersOfMessagePattern' |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
21 |
poolDictionaries:'' |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
22 |
category:'Views-Text' |
0 | 23 |
! |
24 |
||
928 | 25 |
!TextCollector class methodsFor:'documentation'! |
15 | 26 |
|
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
27 |
copyright |
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 |
COPYRIGHT (c) 1989 by Claus Gittinger |
59 | 30 |
All Rights Reserved |
34
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 |
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
|
33 |
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
|
34 |
inclusion of the above copyright notice. This software may not |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
35 |
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
|
36 |
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
|
37 |
hereby transferred. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
38 |
" |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
39 |
! |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
40 |
|
15 | 41 |
documentation |
42 |
" |
|
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
43 |
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
|
44 |
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
|
45 |
received text. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
46 |
Its main use in the system is the Transcript, but it can also be used for |
110 | 47 |
things like trace-windows, errorLogs etc. |
0 | 48 |
|
60 | 49 |
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
|
50 |
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
|
51 |
data - finally updating the whole chunk in one piece. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
52 |
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
|
53 |
(on fast displays this is less of a problem). |
15 | 54 |
|
60 | 55 |
The total number of lines kept is controlled by lineLimit, if more lines |
56 |
than this limit are added at the bottom, the textcollector will forget lines |
|
57 |
at the top. |
|
58 |
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
|
59 |
of memory then ... |
77 | 60 |
|
586 | 61 |
[StyleSheet paramters (transcript only):] |
62 |
||
63 |
transcriptForegroundColor defaults to textForegroundColor |
|
64 |
transcriptBackgroundColor' defaults to textBackgroundColor. |
|
77 | 65 |
|
586 | 66 |
transcriptCursorForegroundColor |
67 |
transcriptCursorBackgroundColor |
|
77 | 68 |
|
586 | 69 |
[author:] |
70 |
Claus Gittinger |
|
71 |
||
72 |
[see also:] |
|
73 |
CodeView EditTextView |
|
74 |
ActorStream |
|
15 | 75 |
" |
76 |
! ! |
|
0 | 77 |
|
928 | 78 |
!TextCollector class methodsFor:'instance creation'! |
0 | 79 |
|
2025
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
80 |
initialize |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
81 |
TranscriptQuerySignal := QuerySignal new. |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
82 |
|
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
83 |
! |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
84 |
|
0 | 85 |
newTranscript |
778
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
86 |
"create and open a new transcript. |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
87 |
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
|
88 |
were two different views. It is no longer recommended." |
110 | 89 |
|
3852
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
90 |
^ self newTranscript:#Transcript |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
91 |
|
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
92 |
" |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
93 |
TextCollector newTranscript. |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
94 |
Transcript lineLimit:3000. |
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 |
"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
|
98 |
! |
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 |
newTranscript:name |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
101 |
"create and open a new transcript. |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
102 |
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
|
103 |
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
|
104 |
|
1900
d334ab9d32d5
removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
105 |
|topView transcript defSz f v lines cols| |
0 | 106 |
|
4476 | 107 |
transcript := Smalltalk at:name. |
108 |
(transcript isTextView and:[transcript isOpen and:[transcript device == Screen current]]) ifTrue:[ |
|
109 |
"if there is already an open Transcript on the same device, |
|
110 |
do not open an additional one. |
|
111 |
expecco StandardLibrary <= 2.0.0.3 checked for Transcript>>#isStream and |
|
112 |
tries to opens a new Transcript window for each new Transcribe with expecco >=2.4" |
|
113 |
^ transcript. |
|
114 |
]. |
|
115 |
||
3852
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
116 |
topView := StandardSystemView label:name "minExtent:(100 @ 100)". |
0 | 117 |
|
60 | 118 |
v := HVScrollableView for:self miniScrollerH:true miniScrollerV:false in:topView. |
0 | 119 |
v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
120 |
transcript := v scrolledView. |
|
121 |
"transcript partialLines:false." |
|
122 |
||
123 |
f := transcript font. |
|
60 | 124 |
|
125 |
" |
|
126 |
should add the height of the frame & scrollbars to be exact ... |
|
127 |
" |
|
1900
d334ab9d32d5
removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
128 |
defSz := self defaultTranscriptSize. |
d334ab9d32d5
removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
129 |
cols := defSz x. |
d334ab9d32d5
removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents:
1822
diff
changeset
|
130 |
lines := defSz y. |
60 | 131 |
topView extent:(((f widthOf:'x') * cols) @ (f height * lines)). |
0 | 132 |
|
3852
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
133 |
transcript beTranscript:name. |
59 | 134 |
|
80 | 135 |
" |
136 |
run it at a slightly higher prio, to allow for |
|
137 |
delayed buffered updates to be performed |
|
138 |
" |
|
139 |
topView openWithPriority:(Processor userSchedulingPriority + 1). |
|
15 | 140 |
|
0 | 141 |
^ transcript |
110 | 142 |
|
143 |
" |
|
3852
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
144 |
TextCollector newTranscript:#T2. |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
145 |
T2 showCR:'Hello world'. |
110 | 146 |
" |
778
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
147 |
|
1026 | 148 |
"Modified: 17.2.1997 / 18:20:27 / cg" |
0 | 149 |
! ! |
150 |
||
2025
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
151 |
!TextCollector class methodsFor:'Signal constants'! |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
152 |
|
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
153 |
transcriptQuerySignal |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
154 |
^ TranscriptQuerySignal |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
155 |
! ! |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
156 |
|
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
157 |
!TextCollector class methodsFor:'debugging'! |
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
158 |
|
4365 | 159 |
debugSendersOfMessagePattern |
160 |
^ DebugSendersOfMessagePattern |
|
161 |
||
162 |
"Created: / 02-02-2012 / 12:05:27 / cg" |
|
163 |
! |
|
164 |
||
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
165 |
debugSendersOfMessagePattern:aGLOBMatchPattern |
4233
ae8979201707
changed: #debugSendersOfMessagePattern:
Claus Gittinger <cg@exept.de>
parents:
4124
diff
changeset
|
166 |
"ever want to know, who sends a particular text-message to the transcript ? |
4365 | 167 |
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
|
168 |
|
4365 | 169 |
DebugSendersOfMessagePattern := |
170 |
(aGLOBMatchPattern isEmpty |
|
171 |
ifTrue:[ nil ] |
|
172 |
ifFalse:[ aGLOBMatchPattern ]) |
|
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
173 |
|
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
174 |
" |
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
175 |
self debugSendersOfMessagePattern:'no such*' |
4233
ae8979201707
changed: #debugSendersOfMessagePattern:
Claus Gittinger <cg@exept.de>
parents:
4124
diff
changeset
|
176 |
self debugSendersOfMessagePattern:'remove*' |
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
177 |
self debugSendersOfMessagePattern:nil. |
4284
3e487b994a8b
changed: #debugSendersOfMessagePattern:
Claus Gittinger <cg@exept.de>
parents:
4233
diff
changeset
|
178 |
self debugSendersOfMessagePattern:'*'. |
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
179 |
" |
4233
ae8979201707
changed: #debugSendersOfMessagePattern:
Claus Gittinger <cg@exept.de>
parents:
4124
diff
changeset
|
180 |
|
4365 | 181 |
"Modified: / 02-02-2012 / 12:07:11 / cg" |
182 |
! |
|
183 |
||
184 |
traceSendersOfMessagePattern |
|
185 |
^ TraceSendersOfMessagePattern |
|
186 |
||
187 |
"Created: / 02-02-2012 / 12:05:32 / cg" |
|
188 |
! |
|
189 |
||
190 |
traceSendersOfMessagePattern:aGLOBMatchPattern |
|
191 |
"ever want to know, who sends a particular text-message to the transcript ? |
|
192 |
Call this with a match string and get a trace, when a matching text is sent to the transcript" |
|
193 |
||
194 |
TraceSendersOfMessagePattern := |
|
195 |
(aGLOBMatchPattern isEmpty |
|
196 |
ifTrue:[ nil ] |
|
197 |
ifFalse:[ aGLOBMatchPattern ]) |
|
198 |
||
199 |
" |
|
200 |
self traceSendersOfMessagePattern:'removed unreached*' |
|
201 |
self traceSendersOfMessagePattern:nil. |
|
202 |
self traceSendersOfMessagePattern:'*'. |
|
203 |
" |
|
204 |
||
205 |
"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
|
206 |
! ! |
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
207 |
|
928 | 208 |
!TextCollector class methodsFor:'defaults'! |
0 | 209 |
|
1610
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
210 |
defaultCollectSize |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
211 |
"the number of lines buffered for delayed update" |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
212 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
213 |
^ 50 |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
214 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
215 |
"Modified: / 27.7.1998 / 16:14:51 / cg" |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
216 |
! |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
217 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
218 |
defaultLineLimit |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
219 |
"the number of lines remembered by default" |
59 | 220 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
221 |
^ 600 |
59 | 222 |
! |
223 |
||
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
224 |
defaultTimeDelay |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
225 |
"the time in seconds to wait & collect by default" |
36 | 226 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
227 |
^ 0.3 |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
228 |
! |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
229 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
230 |
defaultTranscriptSize |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
231 |
"the number of cols/lines by which the Transcript should come up" |
110 | 232 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
233 |
^ 70@11 |
110 | 234 |
! ! |
235 |
||
2744 | 236 |
!TextCollector methodsFor:'Compatibility-ST80'! |
1500 | 237 |
|
238 |
deselect |
|
239 |
self unselect |
|
1504
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
240 |
! |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
241 |
|
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
242 |
flush |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
243 |
self endEntry. |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
244 |
super flush |
1500 | 245 |
! ! |
246 |
||
0 | 247 |
!TextCollector methodsFor:'accessing'! |
248 |
||
3710 | 249 |
autoRaise |
250 |
^ autoRaise ? false |
|
251 |
! |
|
252 |
||
253 |
autoRaise:something |
|
254 |
autoRaise := something. |
|
255 |
! |
|
256 |
||
1467
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
257 |
beginEntry |
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
258 |
"noop for now, ST80 compatibility" |
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
259 |
|
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
260 |
^ self |
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
261 |
|
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
262 |
"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
|
263 |
! |
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
264 |
|
0 | 265 |
collect:aBoolean |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
266 |
"turn on/off collecting - if on, do not output immediately |
15 | 267 |
but collect text and output en-bloque after some time delta" |
0 | 268 |
|
269 |
collecting := aBoolean |
|
270 |
! |
|
271 |
||
1610
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
272 |
collectSize:numberOfLines |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
273 |
"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
|
274 |
the receiver will force update of the view, |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
275 |
whenever that many lines have been collected |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
276 |
(or the updateTimeDelay interval has passed). |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
277 |
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
|
278 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
279 |
collectSize := numberOfLines |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
280 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
281 |
"Modified: / 27.7.1998 / 16:16:00 / cg" |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
282 |
! |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
283 |
|
0 | 284 |
destroyAction:aBlock |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
285 |
"define the action to be performed when I get destroyed. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
286 |
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
|
287 |
when closed. (see TextCollectorclass>>newTranscript)" |
0 | 288 |
|
289 |
destroyAction := aBlock |
|
290 |
! |
|
291 |
||
292 |
endEntry |
|
928 | 293 |
"flush collected output; displaying all that has been buffered so far" |
0 | 294 |
|
36 | 295 |
|nLines lines| |
0 | 296 |
|
133 | 297 |
shown ifFalse:[ |
1971 | 298 |
"/ when iconified or not yet shown, keep |
299 |
"/ collecting. But not too much ... |
|
300 |
outstandingLines size < 300 ifTrue:[ |
|
301 |
flushPending ifFalse:[ |
|
302 |
self installDelayedUpdate. |
|
303 |
]. |
|
304 |
^ self |
|
305 |
] |
|
133 | 306 |
]. |
1971 | 307 |
|
119 | 308 |
inFlush ifTrue:[^ self]. |
2831 | 309 |
collecting ifTrue:[ |
310 |
flushBlock notNil ifTrue:[ |
|
311 |
Processor removeTimedBlock:flushBlock. |
|
312 |
]. |
|
313 |
flushPending ifFalse:[^ self]. |
|
1714 | 314 |
]. |
15 | 315 |
|
52 | 316 |
access critical:[ |
653 | 317 |
inFlush := true. |
1491
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
318 |
[ |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
319 |
flushPending := false. |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
320 |
outstandingLines size ~~ 0 ifTrue:[ |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
321 |
"insert the bunch of lines - if any" |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
322 |
lines := outstandingLines. |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
323 |
outstandingLines := nil. |
36 | 324 |
|
1491
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
325 |
nLines := lines size. |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
326 |
(nLines ~~ 0) ifTrue:[ |
3248 | 327 |
self isInInsertMode ifTrue:[ |
1565
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
328 |
self insertLines:lines withCR:true. |
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
329 |
] ifFalse:[ |
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
330 |
self replaceLines:lines withCR:true |
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
331 |
]. |
1562
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
332 |
alwaysAppendAtEnd ifTrue:[ |
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
333 |
self cursorToEnd. |
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
334 |
]. |
2371 | 335 |
(cursorLine >= (firstLineShown + nFullLinesShown)) ifTrue:[ |
336 |
self withCursorOffDo:[ |
|
1491
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
337 |
self scrollDown:nLines |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
338 |
] |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
339 |
]. |
653 | 340 |
]. |
341 |
]. |
|
928 | 342 |
|
1491
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
343 |
"and the last partial line - if any" |
3295
37cb2b5d579a
Allow for readOnly TextCollectors
Stefan Vogel <sv@exept.de>
parents:
3248
diff
changeset
|
344 |
outstandingLine size ~~ 0 ifTrue:[ |
3248 | 345 |
self isInInsertMode ifTrue:[ |
1565
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
346 |
self insertStringAtCursor:outstandingLine. |
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
347 |
] ifFalse:[ |
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
348 |
self replaceStringAtCursor:outstandingLine. |
9109e9848c6f
care for insertMode when handling collected text.
Claus Gittinger <cg@exept.de>
parents:
1562
diff
changeset
|
349 |
]. |
1491
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
350 |
outstandingLine := ''. |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
351 |
]. |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
352 |
self checkLineLimit. |
2632 | 353 |
"/ device flush. |
2520
aed8069b4477
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
2450
diff
changeset
|
354 |
] ensure:[ |
1491
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
355 |
inFlush := false. |
0445841f7852
care for unwind (clear inFlush flag)
Claus Gittinger <cg@exept.de>
parents:
1489
diff
changeset
|
356 |
] |
119 | 357 |
]. |
358 |
flushPending ifTrue:[ |
|
653 | 359 |
flushPending := false. |
360 |
self installDelayedUpdate |
|
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
361 |
] |
653 | 362 |
|
1714 | 363 |
"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
|
364 |
! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
365 |
|
2103 | 366 |
lineLimit |
367 |
"return the number of text-lines I am supposed to hold" |
|
368 |
||
369 |
^ lineLimit |
|
370 |
||
371 |
" |
|
372 |
Transcript lineLimit:5000 |
|
373 |
Transcript lineLimit |
|
374 |
" |
|
375 |
||
376 |
"Modified: / 16.5.1998 / 01:33:52 / cg" |
|
377 |
! |
|
378 |
||
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
379 |
lineLimit:aNumber |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
380 |
"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
|
381 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
382 |
lineLimit := aNumber |
1611 | 383 |
|
384 |
" |
|
385 |
Transcript lineLimit:5000 |
|
386 |
" |
|
387 |
||
388 |
"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
|
389 |
! |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
390 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
391 |
updateTimeDelay:seconds |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
392 |
"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
|
393 |
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
|
394 |
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
|
395 |
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
|
396 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
397 |
timeDelay := seconds |
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
398 |
|
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
399 |
"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
|
400 |
! ! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
401 |
|
3969
a914bce039b7
category of: #exposeX:y:width:height:
Claus Gittinger <cg@exept.de>
parents:
3958
diff
changeset
|
402 |
!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
|
403 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
404 |
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
|
405 |
"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
|
406 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
407 |
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
|
408 |
self endEntry |
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 |
|
2750 | 411 |
!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
|
412 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
413 |
destroy |
928 | 414 |
"destroy this view" |
415 |
||
3201 | 416 |
destroyAction value. |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
417 |
super destroy |
928 | 418 |
|
1714 | 419 |
"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
|
420 |
! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
421 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
422 |
editMenu |
928 | 423 |
"return my popUpMenu; thats the superClasses menu, |
424 |
minus any accept item." |
|
425 |
||
1262
d69149b5be1f
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
426 |
<resource: #programMenu> |
1109 | 427 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
428 |
|m idx| |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
429 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
430 |
m := super editMenu. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
431 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
432 |
" |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
433 |
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
|
434 |
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
|
435 |
" |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
436 |
idx := m indexOf:#accept. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
437 |
idx ~~ 0 ifTrue:[ |
928 | 438 |
m remove:idx. |
439 |
(m labels at:(idx - 1)) = '-' ifTrue:[ |
|
440 |
m remove:idx - 1 |
|
441 |
]. |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
442 |
]. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
443 |
^ m |
928 | 444 |
|
1262
d69149b5be1f
resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents:
1221
diff
changeset
|
445 |
"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
|
446 |
! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
447 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
448 |
initialize |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
449 |
super initialize. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
450 |
|
2164
ed46136cb2cf
honor scrollWhenUpdating setting
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
451 |
scrollWhenUpdating := #endOfText. |
ed46136cb2cf
honor scrollWhenUpdating setting
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
452 |
|
928 | 453 |
outstandingLines := nil. |
1562
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
454 |
alwaysAppendAtEnd := true. |
1610
b05a3e405b33
allow change of collectSize and updateTimeDelay.
Claus Gittinger <cg@exept.de>
parents:
1598
diff
changeset
|
455 |
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
|
456 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
457 |
flushPending := inFlush := false. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
458 |
collecting := true. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
459 |
timeDelay := self class defaultTimeDelay. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
460 |
access := RecursionLock new. "/ Semaphore forMutualExclusion. |
2086
95ec18a17198
give my access sema a name (for the semaphoreMonitor)
Claus Gittinger <cg@exept.de>
parents:
2025
diff
changeset
|
461 |
access 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
|
462 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
463 |
lineLimit := self class defaultLineLimit. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
464 |
entryStream := ActorStream new. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
465 |
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
|
466 |
entryStream nextPutAllBlock:[:something | self nextPutAll:something] |
928 | 467 |
|
2086
95ec18a17198
give my access sema a name (for the semaphoreMonitor)
Claus Gittinger <cg@exept.de>
parents:
2025
diff
changeset
|
468 |
"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
|
469 |
! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
470 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
471 |
mapped |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
472 |
"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
|
473 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
474 |
super mapped. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
475 |
self endEntry |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
476 |
! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
477 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
478 |
reinitialize |
2259 | 479 |
"reinit after a snapIn. |
480 |
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
|
481 |
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
|
482 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
483 |
flushPending := false. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
484 |
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
|
485 |
super reinitialize. |
1467
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
486 |
|
5c09bb2dadef
Add (dummy fore now) #beginEntry for ST80 compat.
Stefan Vogel <sv@exept.de>
parents:
1421
diff
changeset
|
487 |
"Modified: / 5.3.1998 / 10:09:14 / stefan" |
2591 | 488 |
! |
489 |
||
490 |
release |
|
491 |
flushBlock notNil ifTrue:[ |
|
492 |
Processor removeTimedBlock:flushBlock. |
|
493 |
flushBlock := nil. |
|
494 |
]. |
|
495 |
outstandingLines := nil. |
|
496 |
outstandingLine := ''. |
|
497 |
||
498 |
super release |
|
499 |
||
500 |
"Modified: / 9.11.1998 / 21:18:17 / cg" |
|
0 | 501 |
! ! |
502 |
||
503 |
!TextCollector methodsFor:'private'! |
|
504 |
||
505 |
checkLineLimit |
|
506 |
"this method checks if the text has become too large (> lineLimit) |
|
507 |
and cuts off some lines at the top if so; it must be called whenever lines |
|
508 |
have been added to the bottom" |
|
509 |
||
2426
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
510 |
|nDel newCursorLine| |
0 | 511 |
|
512 |
lineLimit notNil ifTrue:[ |
|
2426
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
513 |
(cursorLine > lineLimit) ifTrue:[ |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
514 |
nDel := list size - lineLimit. |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
515 |
list removeFromIndex:1 toIndex:nDel. |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
516 |
newCursorLine := cursorLine - nDel. |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
517 |
firstLineShown := firstLineShown - nDel. |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
518 |
(firstLineShown < 1) ifTrue:[ |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
519 |
newCursorLine := newCursorLine - firstLineShown + 1. |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
520 |
firstLineShown := 1 |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
521 |
]. |
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
522 |
self setCursorLine:newCursorLine. |
3320
a820e3101bb6
refresh when removing some lines after hitting linelimit
fm
parents:
3295
diff
changeset
|
523 |
self contentsChanged. |
a820e3101bb6
refresh when removing some lines after hitting linelimit
fm
parents:
3295
diff
changeset
|
524 |
self invalidate. |
2426
281067d406c7
eliminated direct write-access to cursorLine
Claus Gittinger <cg@exept.de>
parents:
2371
diff
changeset
|
525 |
] |
3710 | 526 |
]. |
527 |
self autoRaise ifTrue:[ |
|
528 |
self topView |
|
529 |
raise; |
|
530 |
"/ setForegroundWindow; |
|
531 |
yourself. |
|
532 |
]. |
|
3320
a820e3101bb6
refresh when removing some lines after hitting linelimit
fm
parents:
3295
diff
changeset
|
533 |
|
a820e3101bb6
refresh when removing some lines after hitting linelimit
fm
parents:
3295
diff
changeset
|
534 |
"Modified: / 26-07-2006 / 16:02:15 / fm" |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
535 |
! |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
536 |
|
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
537 |
installDelayedUpdate |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
538 |
"arrange for collecting input for some time, |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
539 |
and output all buffered strings at once after a while. |
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
540 |
This makes output to the transcript much faster on systems |
553 | 541 |
with poor scrolling performance (i.e. dumb vga cards ...)." |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
542 |
|
131 | 543 |
|p| |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
544 |
|
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
545 |
flushPending ifFalse:[ |
553 | 546 |
flushPending := true. |
547 |
inFlush ifFalse:[ |
|
548 |
" |
|
549 |
we could run under a process, which dies in the meantime; |
|
550 |
therefore, we have to arrange for the transcript process to |
|
551 |
be interrupted and do the update. |
|
552 |
" |
|
553 |
windowGroup isNil ifTrue:[ |
|
4503 | 554 |
p := Processor timeoutHandlerProcess |
553 | 555 |
] ifFalse:[ |
556 |
p := windowGroup process |
|
557 |
]. |
|
1221
0c2a4231fc9e
Move #isSystemProcess from ProcessorScheduler to Process.
Stefan Vogel <sv@exept.de>
parents:
1109
diff
changeset
|
558 |
(p isNil or:[p isSystemProcess]) ifTrue:[ |
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
559 |
self endEntry |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
560 |
] ifFalse:[ |
1711 | 561 |
flushBlock isNil ifTrue:[ |
562 |
flushBlock := [self endEntry]. |
|
563 |
]. |
|
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
564 |
Processor addTimedBlock:flushBlock for:p afterSeconds:timeDelay. |
3009
7eb1704fa5a6
Avoid dangling references in context
Stefan Vogel <sv@exept.de>
parents:
3006
diff
changeset
|
565 |
]. |
7eb1704fa5a6
Avoid dangling references in context
Stefan Vogel <sv@exept.de>
parents:
3006
diff
changeset
|
566 |
p := nil. "avoid dangling references to p through the home context of flushBlock" |
553 | 567 |
] |
34
c4b386a8cc57
critical-lock; allows show:/showCr: from multiple processes
claus
parents:
22
diff
changeset
|
568 |
] |
553 | 569 |
|
1711 | 570 |
"Modified: / 17.4.1997 / 13:03:15 / stefan" |
571 |
"Modified: / 9.11.1998 / 14:34:07 / cg" |
|
4365 | 572 |
! |
573 |
||
574 |
senderTraceString |
|
575 |
"generate a sender trace string." |
|
576 |
||
577 |
|con| |
|
578 |
||
579 |
"/ skip over intermediate contexts |
|
580 |
"/ con := con sender. |
|
581 |
"/ con := thisContext sender sender. |
|
582 |
"/ [ con receiver == self ] whileTrue:[ |
|
583 |
"/ con := con sender |
|
584 |
"/ ]. |
|
585 |
con := DebugView interestingContextFrom:thisContext sender sender. |
|
586 |
^ con printString |
|
587 |
||
588 |
"Created: / 02-02-2012 / 11:58:17 / cg" |
|
0 | 589 |
! ! |
590 |
||
778
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
591 |
!TextCollector methodsFor:'queries'! |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
592 |
|
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
593 |
current |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
594 |
"return the current (your screens) transcript. |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
595 |
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
|
596 |
But typically, this is the same as Transcript." |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
597 |
|
2278 | 598 |
|theTranscript app| |
2025
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
599 |
|
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
600 |
theTranscript := TranscriptQuerySignal query. |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
601 |
theTranscript isNil ifTrue:[ |
2278 | 602 |
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
|
603 |
(app notNil and:[thisContext isRecursive not]) ifTrue:[ |
2278 | 604 |
theTranscript := (app transcript ? Stderr). |
605 |
] ifFalse:[ |
|
606 |
theTranscript := Stderr. |
|
607 |
] |
|
2025
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
608 |
]. |
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
609 |
^ theTranscript |
778
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
610 |
|
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
611 |
" |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
612 |
Transcript current flash |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
613 |
" |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
614 |
|
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
615 |
"Created: 5.7.1996 / 14:14:34 / cg" |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
616 |
"Modified: 5.7.1996 / 14:14:52 / cg" |
4441
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
617 |
! |
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
618 |
|
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
619 |
isStream |
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
620 |
"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
|
621 |
See #displayOn:" |
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
622 |
|
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
623 |
^ self == Transcript |
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
624 |
|
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
625 |
" |
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
626 |
Transcript isStream |
fb138fb5cf04
#isStream answers true for Transcript
Stefan Vogel <sv@exept.de>
parents:
4428
diff
changeset
|
627 |
" |
778
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
628 |
! ! |
3a8fabcf1872
added #current (for: Transcript current)
Claus Gittinger <cg@exept.de>
parents:
656
diff
changeset
|
629 |
|
2450 | 630 |
!TextCollector methodsFor:'scrolling'! |
631 |
||
632 |
scrollTo:anOrigin redraw:doRedraw |
|
633 |
access critical:[ |
|
634 |
super scrollTo:anOrigin redraw:doRedraw |
|
635 |
] |
|
636 |
! ! |
|
637 |
||
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
638 |
!TextCollector methodsFor:'stream messages'! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
639 |
|
4106 | 640 |
addLine:line |
641 |
"append a line to the outstanding lines buffer" |
|
642 |
||
643 |
access critical:[ |
|
644 |
outstandingLine size ~~ 0 ifTrue:[ |
|
645 |
outstandingLine := outstandingLine , line |
|
646 |
] ifFalse:[ |
|
647 |
outstandingLine := line |
|
648 |
]. |
|
649 |
outstandingLines isNil ifTrue:[ |
|
650 |
outstandingLines := OrderedCollection with:outstandingLine |
|
651 |
] ifFalse:[ |
|
652 |
outstandingLines add:outstandingLine. |
|
653 |
]. |
|
654 |
outstandingLine := ''. |
|
655 |
||
656 |
collecting ifTrue:[ |
|
657 |
flushPending ifTrue:[ |
|
658 |
outstandingLines size > collectSize ifTrue:[ |
|
659 |
self endEntry |
|
660 |
] |
|
661 |
] ifFalse:[ |
|
662 |
self installDelayedUpdate |
|
663 |
] |
|
664 |
] ifFalse:[ |
|
665 |
self endEntry. |
|
666 |
self cursorReturn. |
|
667 |
self checkLineLimit. |
|
668 |
self cursorToEnd. |
|
669 |
] |
|
670 |
]. |
|
671 |
||
672 |
"Created: / 28.7.1998 / 00:31:46 / cg" |
|
673 |
"Modified: / 28.7.1998 / 00:34:58 / cg" |
|
674 |
! |
|
675 |
||
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
676 |
cr |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
677 |
"output a carriage return, finishing the current line" |
135 | 678 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
679 |
access critical:[ |
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
680 |
collecting ifTrue:[ |
928 | 681 |
outstandingLine notNil ifTrue:[ "/ mhmh - is never nil |
682 |
outstandingLines isNil ifTrue:[ |
|
683 |
outstandingLines := OrderedCollection with:outstandingLine |
|
684 |
] ifFalse:[ |
|
685 |
outstandingLines add:outstandingLine. |
|
686 |
] |
|
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
687 |
]. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
688 |
outstandingLine := ''. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
689 |
] ifFalse:[ |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
690 |
self cursorReturn. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
691 |
self checkLineLimit. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
692 |
self cursorToEnd. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
693 |
]. |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
694 |
]. |
135 | 695 |
|
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
696 |
collecting ifTrue:[ |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
697 |
flushPending ifFalse:[ |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
698 |
self installDelayedUpdate |
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
699 |
] |
2831 | 700 |
]. |
834
0da7c9923d1b
prevent scheduler from being suspended
Claus Gittinger <cg@exept.de>
parents:
778
diff
changeset
|
701 |
|
928 | 702 |
"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
|
703 |
! |
135 | 704 |
|
4460 | 705 |
display:someObject |
706 |
"dolphin compatibility" |
|
707 |
||
708 |
someObject printOn:self. |
|
709 |
! |
|
710 |
||
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
711 |
doesNotUnderstand:aMessage |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
712 |
"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
|
713 |
on to the stream which will send the characters via nextPut: |
3006 | 714 |
This way, we understand all Stream messages - great isn't it!!" |
715 |
||
3243 | 716 |
^ aMessage sendTo:entryStream |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
717 |
! |
0 | 718 |
|
4311 | 719 |
ensureCr |
720 |
"if the output position is not already at the beginning of a line, |
|
721 |
output a carriage return" |
|
722 |
||
723 |
|needCR| |
|
724 |
||
725 |
collecting ifTrue:[ |
|
726 |
needCR := outstandingLine notEmptyOrNil |
|
727 |
] ifFalse:[ |
|
728 |
needCR := cursorCol > 0 |
|
729 |
]. |
|
730 |
||
731 |
needCR ifTrue:[ |
|
732 |
self cr. |
|
733 |
]. |
|
734 |
||
735 |
"Created: / 14-09-2011 / 09:01:03 / cg" |
|
736 |
! |
|
737 |
||
0 | 738 |
lineLength |
928 | 739 |
"to make a textCollector (somewhat) compatible with printer |
740 |
streams, support the lineLength query" |
|
741 |
||
0 | 742 |
^ width // (font width) |
928 | 743 |
|
744 |
"Modified: 11.1.1997 / 14:42:41 / cg" |
|
0 | 745 |
! |
746 |
||
747 |
nextPut:something |
|
928 | 748 |
"append somethings printString to my displayed text. |
749 |
This allows TextCollectors to be used Stream-wise" |
|
0 | 750 |
|
1504
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
751 |
|txt| |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
752 |
|
656 | 753 |
(something isCharacter) ifTrue:[ |
754 |
((something == Character cr) or:[something == Character nl]) ifTrue:[ |
|
755 |
^ self cr |
|
756 |
]. |
|
0 | 757 |
]. |
1504
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
758 |
|
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
759 |
txt := something asString. |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
760 |
currentEmphasis notNil ifTrue:[ |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
761 |
txt := txt emphasizeAllWith:currentEmphasis |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
762 |
]. |
3101f410e230
rudimentary support for (some) emphasis messages
Claus Gittinger <cg@exept.de>
parents:
1500
diff
changeset
|
763 |
self show:txt. |
656 | 764 |
|
765 |
"/ flushPending ifTrue:[ |
|
766 |
"/ self endEntry |
|
767 |
"/ ]. |
|
768 |
"/ (something isMemberOf:Character) ifTrue:[ |
|
769 |
"/ ((something == Character cr) or:[something == Character nl]) ifTrue:[ |
|
770 |
"/ ^ self cr |
|
771 |
"/ ]. |
|
772 |
"/ self insertCharAtCursor:something |
|
773 |
"/ ] ifFalse:[ |
|
774 |
"/ self insertStringAtCursor:(something printString). |
|
775 |
"/ self checkLineLimit |
|
776 |
"/ ]. |
|
777 |
"/ device flush |
|
778 |
||
928 | 779 |
"Modified: 11.1.1997 / 14:43:05 / cg" |
0 | 780 |
! |
781 |
||
782 |
nextPutAll:something |
|
928 | 783 |
"append all of something to my displayed text. |
784 |
This allows TextCollectors to be used Stream-wise" |
|
0 | 785 |
|
3958 | 786 |
self show:(currentEmphasis notNil |
787 |
ifTrue:[something emphasizeAllWith:currentEmphasis] |
|
788 |
ifFalse:[something]) |
|
656 | 789 |
|
928 | 790 |
"Modified: 11.1.1997 / 14:43:26 / cg" |
0 | 791 |
! |
792 |
||
793 |
show:anObject |
|
794 |
"insert the argument aString at current cursor position" |
|
795 |
||
4045 | 796 |
|printString lines| |
0 | 797 |
|
4045 | 798 |
printString := anObject printString. |
928 | 799 |
|
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
800 |
DebugSendersOfMessagePattern notNil ifTrue:[ |
4122 | 801 |
(DebugSendersOfMessagePattern match:printString string) ifTrue:[ |
4428 | 802 |
"disable all with: DebugSendersOfMessagePattern := nil" |
4411 | 803 |
self halt:('Transcript: text matches: "', printString,'"'). |
4122 | 804 |
]. |
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
805 |
]. |
4365 | 806 |
TraceSendersOfMessagePattern notNil ifTrue:[ |
807 |
(TraceSendersOfMessagePattern match:printString string) ifTrue:[ |
|
808 |
printString := self senderTraceString,': ',printString |
|
809 |
]. |
|
810 |
]. |
|
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
811 |
|
4045 | 812 |
(printString includes:(Character cr)) ifTrue:[ |
813 |
lines := printString asStringCollection. |
|
653 | 814 |
lines keysAndValuesDo:[:nr :line | |
1562
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
815 |
(nr == lines size |
4045 | 816 |
and:[(printString endsWith:(Character cr)) not]) ifTrue:[ |
653 | 817 |
"/ the last one. |
818 |
self show:line |
|
819 |
] ifFalse:[ |
|
820 |
self showCR:line |
|
821 |
]. |
|
822 |
]. |
|
823 |
^ self. |
|
308
b216a5efa2c8
handle show: with a string containing cr's
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
824 |
]. |
b216a5efa2c8
handle show: with a string containing cr's
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
825 |
|
1026 | 826 |
access critical:[ |
3295
37cb2b5d579a
Allow for readOnly TextCollectors
Stefan Vogel <sv@exept.de>
parents:
3248
diff
changeset
|
827 |
outstandingLine size ~~ 0 ifTrue:[ |
4045 | 828 |
outstandingLine := outstandingLine , printString |
1026 | 829 |
] ifFalse:[ |
4045 | 830 |
outstandingLine := printString |
653 | 831 |
]. |
1026 | 832 |
collecting ifTrue:[ |
833 |
flushPending ifFalse:[ |
|
834 |
self installDelayedUpdate |
|
1312
eaa44f7649f5
flush after some lines have been collected
Claus Gittinger <cg@exept.de>
parents:
1262
diff
changeset
|
835 |
] ifTrue:[ |
1562
9b7557a81849
made the number of buffered lines an instVar.
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
836 |
outstandingLines size > collectSize ifTrue:[ |
1312
eaa44f7649f5
flush after some lines have been collected
Claus Gittinger <cg@exept.de>
parents:
1262
diff
changeset
|
837 |
self endEntry |
eaa44f7649f5
flush after some lines have been collected
Claus Gittinger <cg@exept.de>
parents:
1262
diff
changeset
|
838 |
] |
1026 | 839 |
] |
840 |
] ifFalse:[ |
|
841 |
self endEntry |
|
653 | 842 |
] |
1026 | 843 |
]. |
0 | 844 |
|
4411 | 845 |
"Modified: / 24-03-2012 / 20:04:10 / cg" |
4428 | 846 |
"Modified (format): / 02-06-2012 / 01:54:55 / cg" |
1617 | 847 |
! |
848 |
||
849 |
showCR:anObject |
|
850 |
"insert the argument aString at current cursor position, |
|
851 |
and advance to the next line. This is the same as a #show: |
|
852 |
followed by a #cr." |
|
853 |
||
4045 | 854 |
|printString lines| |
1617 | 855 |
|
4045 | 856 |
printString := anObject printString. |
857 |
printString size == 0 ifTrue:[ |
|
2689
ddaa98a64bd5
Fix #showCR: when displaying multi-line strings
Stefan Vogel <sv@exept.de>
parents:
2632
diff
changeset
|
858 |
self cr. |
ddaa98a64bd5
Fix #showCR: when displaying multi-line strings
Stefan Vogel <sv@exept.de>
parents:
2632
diff
changeset
|
859 |
^ self. |
1617 | 860 |
]. |
861 |
||
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
862 |
DebugSendersOfMessagePattern notNil ifTrue:[ |
4122 | 863 |
(DebugSendersOfMessagePattern match:printString string) ifTrue:[ |
4410 | 864 |
self halt:('Transcript: text matches: "', printString, '"'). |
4365 | 865 |
]. |
866 |
]. |
|
867 |
TraceSendersOfMessagePattern notNil ifTrue:[ |
|
868 |
(TraceSendersOfMessagePattern match:printString string) ifTrue:[ |
|
869 |
printString := self senderTraceString,': ',printString |
|
4122 | 870 |
]. |
4105
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
871 |
]. |
c2c3a96f8757
debug support: who sends a message
Claus Gittinger <cg@exept.de>
parents:
4073
diff
changeset
|
872 |
|
4045 | 873 |
(printString includesAny:(String with:(Character cr) with:(Character return))) ifTrue:[ |
874 |
lines := printString asStringCollection. |
|
2689
ddaa98a64bd5
Fix #showCR: when displaying multi-line strings
Stefan Vogel <sv@exept.de>
parents:
2632
diff
changeset
|
875 |
lines do:[:line| |
4106 | 876 |
(line endsWith:Character nl) ifTrue:[ |
877 |
(line endsWith:Character return) ifTrue:[ |
|
878 |
self addLine:(line copyWithoutLast:2). |
|
879 |
] ifFalse:[ |
|
880 |
self addLine:(line copyWithoutLast:1). |
|
881 |
] |
|
2805 | 882 |
] ifFalse:[ |
4106 | 883 |
(line endsWith:Character return) ifTrue:[ |
884 |
self addLine:(line copyWithoutLast:1). |
|
885 |
] ifFalse:[ |
|
886 |
self addLine:line |
|
887 |
] |
|
2805 | 888 |
] |
1617 | 889 |
]. |
890 |
^ self. |
|
891 |
]. |
|
4106 | 892 |
self addLine:printString |
4365 | 893 |
|
4410 | 894 |
"Modified: / 24-03-2012 / 20:00:08 / cg" |
4073 | 895 |
! |
896 |
||
4473 | 897 |
space |
898 |
self show:' ' |
|
899 |
! |
|
900 |
||
4073 | 901 |
tab |
902 |
"append a tab-character to the stream. |
|
903 |
This is only allowed, if the receiver supports writing." |
|
904 |
||
905 |
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
|
906 |
! ! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
907 |
|
2746 | 908 |
!TextCollector methodsFor:'stream messages-emphasis'! |
1822
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
909 |
|
2539 | 910 |
bgColor:aColor |
911 |
currentEmphasis := #backgroundColor->aColor |
|
912 |
! |
|
913 |
||
1822
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
914 |
bold |
3205 | 915 |
"switch to bold - followup text sent via show/nextPutAll: will be inserted in |
916 |
a bold font." |
|
917 |
||
1822
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
918 |
currentEmphasis := #bold |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
919 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
920 |
"Modified: / 26.3.1999 / 14:28:58 / cg" |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
921 |
! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
922 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
923 |
color:aColor |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
924 |
currentEmphasis := #color->aColor |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
925 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
926 |
"Modified: / 26.3.1999 / 14:29:21 / cg" |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
927 |
! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
928 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
929 |
italic |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
930 |
currentEmphasis := #italic |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
931 |
! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
932 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
933 |
normal |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
934 |
currentEmphasis := nil |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
935 |
! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
936 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
937 |
reverse |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
938 |
currentEmphasis := Array with:#color->bgColor |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
939 |
with:#backgroundColor->fgColor. |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
940 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
941 |
"Created: / 20.6.1998 / 20:10:45 / cg" |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
942 |
! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
943 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
944 |
underline |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
945 |
currentEmphasis := #underline |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
946 |
|
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
947 |
"Created: / 26.3.1999 / 14:27:07 / cg" |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
948 |
! ! |
9abf58839e67
added #color: and #underline
Claus Gittinger <cg@exept.de>
parents:
1714
diff
changeset
|
949 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
950 |
!TextCollector methodsFor:'transcript specials'! |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
951 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
952 |
beTranscript |
928 | 953 |
"make the receiver be the systemTranscript; this one |
954 |
is accessable via the global Transcript and gets relevant |
|
955 |
system messages from various places." |
|
956 |
||
3852
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
957 |
self beTranscript:#Transcript |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
958 |
|
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
959 |
"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
|
960 |
! |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
961 |
|
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
962 |
beTranscript:name |
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
963 |
"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
|
964 |
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
|
965 |
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
|
966 |
|
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
967 |
|fg bg cFg cBg| |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
968 |
|
3852
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
969 |
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
|
970 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
971 |
" |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
972 |
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
|
973 |
" |
1421
afef284eadc4
only reset Transcript to stdErr, if I really am the transcript.
ca
parents:
1389
diff
changeset
|
974 |
self destroyAction:[ |
3852
8322d7c41f1c
refactored newTranscript to allow for another transcript to be opened
Claus Gittinger <cg@exept.de>
parents:
3774
diff
changeset
|
975 |
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
|
976 |
Smalltalk at:name put:Stderr |
1421
afef284eadc4
only reset Transcript to stdErr, if I really am the transcript.
ca
parents:
1389
diff
changeset
|
977 |
] |
afef284eadc4
only reset Transcript to stdErr, if I really am the transcript.
ca
parents:
1389
diff
changeset
|
978 |
]. |
0 | 979 |
|
928 | 980 |
"/ user may prefer a special color for this one; |
981 |
"/ look into the style definitions ... |
|
982 |
||
1389 | 983 |
fg := styleSheet colorAt:'transcript.foregroundColor' default:self foregroundColor. |
984 |
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
|
985 |
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
|
986 |
self viewBackground:bg. |
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
987 |
|
1389 | 988 |
cFg := styleSheet colorAt:'transcript.cursorForegroundColor' default:bg. |
989 |
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
|
990 |
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
|
991 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
992 |
"self lineLimit:1000. " "or whatever you think makes sense" |
928 | 993 |
|
1389 | 994 |
"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
|
995 |
! |
24991431c7e0
added #clear (to clear its contents)
Claus Gittinger <cg@exept.de>
parents:
2831
diff
changeset
|
996 |
|
24991431c7e0
added #clear (to clear its contents)
Claus Gittinger <cg@exept.de>
parents:
2831
diff
changeset
|
997 |
clear |
3119 | 998 |
self endEntry. |
2928
24991431c7e0
added #clear (to clear its contents)
Claus Gittinger <cg@exept.de>
parents:
2831
diff
changeset
|
999 |
self contents:nil. |
24991431c7e0
added #clear (to clear its contents)
Claus Gittinger <cg@exept.de>
parents:
2831
diff
changeset
|
1000 |
|
24991431c7e0
added #clear (to clear its contents)
Claus Gittinger <cg@exept.de>
parents:
2831
diff
changeset
|
1001 |
" |
24991431c7e0
added #clear (to clear its contents)
Claus Gittinger <cg@exept.de>
parents:
2831
diff
changeset
|
1002 |
Transcript clear |
24991431c7e0
added #clear (to clear its contents)
Claus Gittinger <cg@exept.de>
parents:
2831
diff
changeset
|
1003 |
" |
3774 | 1004 |
! |
1005 |
||
1006 |
flash |
|
1007 |
"make sure everything is visible, before flashing" |
|
1008 |
||
1009 |
self endEntry. |
|
1010 |
super flash. |
|
0 | 1011 |
! ! |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1012 |
|
928 | 1013 |
!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
|
1014 |
|
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1015 |
version |
4503 | 1016 |
^ '$Header: /cvs/stx/stx/libwidg/TextCollector.st,v 1.116 2013-02-12 13:23:25 stefan Exp $' |
3958 | 1017 |
! |
1018 |
||
1019 |
version_CVS |
|
4503 | 1020 |
^ '$Header: /cvs/stx/stx/libwidg/TextCollector.st,v 1.116 2013-02-12 13:23:25 stefan Exp $' |
363
d780a45df2d4
MVC operation: scroll to bottom when model changes the text.
Stefan Vogel <sv@exept.de>
parents:
308
diff
changeset
|
1021 |
! ! |
2632 | 1022 |
|
4503 | 1023 |
|
2025
0c9729befabc
allow current transcript to be reassigned temporarily
Claus Gittinger <cg@exept.de>
parents:
2024
diff
changeset
|
1024 |
TextCollector initialize! |