|
|
Class: TextCollector
Object
|
+--GraphicsContext
|
+--DeviceGraphicsContext
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--ListView
|
+--TextView
|
+--EditTextView
|
+--TextCollector
|
+--TerminalView
|
+--Workspace
- Package:
- stx:libwidg
- Category:
- Views-Text
- Version:
- rev:
1.104
date: 2009/12/03 10:45:15
- user: stefan
- file: TextCollector.st directory: libwidg
- module: stx stc-classLibrary: libwidg
- Author:
- Claus Gittinger
a view for editable text, which also understands some stream messages.
Instances of this view can take the place of a stream and display the
received text.
Its main use in the system is the Transcript, but it can also be used for
things like trace-windows, errorLogs etc.
If collecting is turned on, a textcollector will not immediately display
entered text, but wait for some short time (timeDelay) and collect incoming
data - finally updating the whole chunk in one piece.
This helps slow display devices, which would otherwise scroll a lot.
(on fast displays this is less of a problem).
The total number of lines kept is controlled by lineLimit, if more lines
than this limit are added at the bottom, the textcollector will forget lines
at the top.
You can set linelimit to nil (i.e. no limit), but you may need a lot
of memory then ...
[StyleSheet paramters (transcript only):]
transcriptForegroundColor defaults to textForegroundColor
transcriptBackgroundColor' defaults to textBackgroundColor.
transcriptCursorForegroundColor
transcriptCursorBackgroundColor
CodeView
EditTextView
ActorStream
Signal constants
-
transcriptQuerySignal
-
debugging
-
debugSendersOfMessagePattern: aGLOBMatchPattern
-
ever want to know, who sends a particular message to the transcript ?
Call this with a match string and get a halt, when the message is next sent
defaults
-
defaultCollectSize
-
the number of lines buffered for delayed update
-
defaultLineLimit
-
the number of lines remembered by default
-
defaultTimeDelay
-
the time in seconds to wait & collect by default
-
defaultTranscriptSize
-
the number of cols/lines by which the Transcript should come up
instance creation
-
initialize
-
-
newTranscript
-
create and open a new transcript.
This is a leftOver method from times were the Launcher & Transcript
were two different views. It is no longer recommended.
-
newTranscript: name
-
create and open a new transcript.
This is a leftOver method from times were the Launcher & Transcript
were two different views. It is no longer recommended.
Compatibility-ST80
-
deselect
-
-
flush
-
accessing
-
autoRaise
-
-
autoRaise: something
-
-
beginEntry
-
noop for now, ST80 compatibility
-
collect: aBoolean
-
turn on/off collecting - if on, do not output immediately
but collect text and output en-bloque after some time delta
-
collectSize: numberOfLines
-
set the collect buffer size. If collect is enabled,
the receiver will force update of the view,
whenever that many lines have been collected
(or the updateTimeDelay interval has passed).
With collect turned off, an immediate update is performed.
-
destroyAction: aBlock
-
define the action to be performed when I get destroyed.
This is a special feature, to allow resetting Transcript to Stderr
when closed. (see TextCollectorclass>>newTranscript)
-
endEntry
-
flush collected output; displaying all that has been buffered so far
-
lineLimit
-
return the number of text-lines I am supposed to hold
-
lineLimit: aNumber
-
define the number of text-lines I am supposed to hold
-
updateTimeDelay: seconds
-
if collect is enabled, the receiver will update its view,
after that time delay (i.e. it collects more output during that period),
or when collectSize lines have been collected without update.
With collect turned off, an immediate update is performed.
event handling
-
exposeX: x y: y width: w height: h
-
flush buffered text when exposed
initialization & release
-
destroy
-
destroy this view
-
editMenu
-
return my popUpMenu; thats the superClasses menu,
minus any accept item.
-
initialize
-
-
mapped
-
view became visible - show collected lines (if any)
-
reinitialize
-
reinit after a snapIn.
recreate access-semaphore; image could have been save (theoretically)
with the semaphore locked - in this case, we had a deadlock
-
release
-
private
-
checkLineLimit
-
this method checks if the text has become too large (> lineLimit)
and cuts off some lines at the top if so; it must be called whenever lines
have been added to the bottom
-
installDelayedUpdate
-
arrange for collecting input for some time,
and output all buffered strings at once after a while.
This makes output to the transcript much faster on systems
with poor scrolling performance (i.e. dumb vga cards ...).
queries
-
current
-
return the current (your screens) transcript.
In multiDisplay applications, this need NOT be the main transcript.
But typically, this is the same as Transcript.
scrolling
-
scrollTo: anOrigin redraw: doRedraw
-
stream messages
-
addLine: line
-
append a line to the outstanding lines buffer
-
cr
-
output a carriage return, finishing the current line
-
doesNotUnderstand: aMessage
-
this is funny: all message we do not understand, are passed
on to the stream which will send the characters via nextPut:
This way, we understand all Stream messages - great isn't it!
-
lineLength
-
to make a textCollector (somewhat) compatible with printer
streams, support the lineLength query
-
nextPut: something
-
append somethings printString to my displayed text.
This allows TextCollectors to be used Stream-wise
-
nextPutAll: something
-
append all of something to my displayed text.
This allows TextCollectors to be used Stream-wise
-
show: anObject
-
insert the argument aString at current cursor position
-
showCR: anObject
-
insert the argument aString at current cursor position,
and advance to the next line. This is the same as a #show:
followed by a #cr.
-
tab
-
append a tab-character to the stream.
This is only allowed, if the receiver supports writing.
stream messages-emphasis
-
bgColor: aColor
-
-
bold
-
switch to bold - followup text sent via show/nextPutAll: will be inserted in
a bold font.
-
color: aColor
-
-
italic
-
-
normal
-
-
reverse
-
-
underline
-
transcript specials
-
beTranscript
-
make the receiver be the systemTranscript; this one
is accessable via the global Transcript and gets relevant
system messages from various places.
-
beTranscript: name
-
make the receiver be the systemTranscript; this one
is accessable via the global Transcript and gets relevant
system messages from various places.
-
clear
-
-
flash
-
make sure everything is visible, before flashing
|