TextCollector.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 05 Jun 2014 08:22:27 +0100
branchdelegated_gc_text-view-selection-refactoring
changeset 5087 001f9ac320b2
parent 5086 6f3514837c99
parent 5023 a18a03c5c572
child 5129 9549b0a1dbf5
permissions -rw-r--r--
Merged 6f3514837c99 and a18a03c5c572 (branch delegated_gc)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5023
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
     1
"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
     3
	      All Rights Reserved
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
     4
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    10
 hereby transferred.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    11
"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    12
'From Smalltalk/X, Version:6.2.3.0 on 20-03-2014 at 21:05:01'                   !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    13
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    14
"{ Package: 'stx:libwidg' }"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    15
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    16
EditTextView subclass:#TextCollector
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:'entryStream lineLimit destroyAction outstandingLines
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    18
		outstandingLine flushBlock flushPending inFlush collecting
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    19
		timeDelay access currentEmphasis alwaysAppendAtEnd collectSize
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    20
		autoRaise'
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    21
	classVariableNames:'TranscriptQuerySignal DebugSendersOfMessagePattern
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    22
		TraceSendersOfMessagePattern TimestampMessages'
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    23
	poolDictionaries:''
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    24
	category:'Views-Text'
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    25
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    26
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    27
!TextCollector class methodsFor:'documentation'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    28
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    29
copyright
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    30
"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    31
 COPYRIGHT (c) 1989 by Claus Gittinger
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    32
	      All Rights Reserved
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    33
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    34
 This software is furnished under a license and may be used
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    35
 only in accordance with the terms of that license and with the
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    36
 inclusion of the above copyright notice.   This software may not
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    37
 be provided or otherwise made available to, or used by, any
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    38
 other person.  No title to or ownership of the software is
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    39
 hereby transferred.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    40
"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    41
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    42
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    43
documentation
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    44
"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    45
    a view for editable text, which also understands some stream messages.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    46
    Instances of this view can take the place of a stream and display the 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    47
    received text.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    48
    Its main use in the system is the Transcript, but it can also be used for
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    49
    things like trace-windows, errorLogs etc.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    50
    It is also inherited by TerminalView, which especially uses the buffering and
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    51
    delayed output features for high performance output (compare to a windows console).
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    52
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    53
    If collecting is turned on, a textcollector will not immediately display 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    54
    entered text, but wait for some short time (timeDelay) and collect incoming 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    55
    data - finally updating the whole chunk in one piece. 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    56
    This helps slow display devices, which would otherwise scroll a lot. 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    57
    (on fast displays this is less of a problem).
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    58
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    59
    The total number of lines kept is controlled by lineLimit, if more lines 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    60
    than this limit are added at the bottom, the textcollector will forget lines 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    61
    at the top. You can set linelimit to nil (i.e. no limit), but you may need a lot 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    62
    of memory then ...
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    63
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    64
    [StyleSheet paramters (transcript only):]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    65
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    66
        transcriptForegroundColor       defaults to textForegroundColor
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    67
        transcriptBackgroundColor'      defaults to textBackgroundColor.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    68
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    69
        transcriptCursorForegroundColor
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    70
        transcriptCursorBackgroundColor
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    71
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    72
    [author:]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    73
        Claus Gittinger
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    74
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    75
    [see also:]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    76
        CodeView EditTextView
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    77
        ActorStream
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    78
"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    79
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    80
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    81
!TextCollector class methodsFor:'instance creation'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    82
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    83
initialize
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    84
    TranscriptQuerySignal := QuerySignal new.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    85
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    86
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    87
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    88
newTranscript
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    89
    "create and open a new transcript.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    90
     This is a leftOver method from times were the Launcher & Transcript
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    91
     were two different views. It is no longer recommended."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    92
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    93
    ^ self newTranscript:#Transcript
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    94
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    95
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    96
     TextCollector newTranscript.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    97
     Transcript lineLimit:3000.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    98
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    99
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   100
    "Modified: 17.2.1997 / 18:20:27 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   101
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   102
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   103
newTranscript:name
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   104
    "create and open a new transcript.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   105
     This is a leftOver method from times were the Launcher & Transcript
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   106
     were two different views. It is no longer recommended."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   107
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   108
    |topView transcript defSz f v lines cols|
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   109
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   110
    transcript := Smalltalk at:name.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   111
    (transcript isTextView and:[transcript isOpen and:[transcript device == Screen current]]) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   112
        "if there is already an open Transcript on the same device, 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   113
         do not open an additional one.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   114
         expecco StandardLibrary <= 2.0.0.3 checked for Transcript>>#isStream and
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   115
         tries to opens a new Transcript window for each new Transcribe with expecco >=2.4"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   116
        ^ transcript.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   117
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   118
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   119
    topView := StandardSystemView label:name "minExtent:(100 @ 100)".
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   120
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   121
    v := HVScrollableView for:self miniScrollerH:true miniScrollerV:false in:topView.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   122
    v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   123
    transcript := v scrolledView.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   124
    "transcript partialLines:false."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   125
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   126
    f := transcript font.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   127
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   128
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   129
     should add the height of the frame & scrollbars to be exact ...
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   130
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   131
    defSz := self defaultTranscriptSize.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   132
    cols := defSz x.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   133
    lines := defSz y.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   134
    topView extent:(((f widthOf:'x') * cols) @ (f height * lines)).
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   135
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   136
    transcript beTranscript:name.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   137
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   138
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   139
     run it at a slightly higher prio, to allow for
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   140
     delayed buffered updates to be performed
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   141
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   142
    topView openWithPriority:(Processor userSchedulingPriority + 1).
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   143
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   144
    ^ transcript
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   145
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   146
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   147
     TextCollector newTranscript:#T2.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   148
     T2 showCR:'Hello world'.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   149
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   150
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   151
    "Modified: 17.2.1997 / 18:20:27 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   152
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   153
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   154
!TextCollector class methodsFor:'Signal constants'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   155
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   156
transcriptQuerySignal
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   157
    ^ TranscriptQuerySignal
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   158
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   159
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   160
!TextCollector class methodsFor:'debugging'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   161
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   162
debugSendersOfMessagePattern
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   163
    ^ DebugSendersOfMessagePattern
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   164
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   165
    "Created: / 02-02-2012 / 12:05:27 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   166
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   167
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   168
debugSendersOfMessagePattern:aGLOBMatchPattern
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   169
    "ever want to know, who sends a particular text-message to the transcript ?
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   170
     Call this with a match string and get a halt, when a matching text is sent to the transcript"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   171
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   172
    DebugSendersOfMessagePattern := aGLOBMatchPattern asNilIfEmpty
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   173
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   174
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   175
     self debugSendersOfMessagePattern:'no such*'
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   176
     self debugSendersOfMessagePattern:'remove*'
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   177
     self debugSendersOfMessagePattern:nil.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   178
     self debugSendersOfMessagePattern:'*'.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   179
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   180
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   181
    "Modified: / 02-02-2012 / 12:07:11 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   182
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   183
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   184
timestampMessages
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   185
    ^ TimestampMessages
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   186
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   187
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   188
timestampMessages:aBoolean
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   189
    "if true, all messages are shown with a timestamp in front"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   190
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   191
    TimestampMessages := aBoolean 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   192
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   193
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   194
     self timestampMessages:true
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   195
     self timestampMessages:false.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   196
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   197
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   198
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   199
traceSendersOfMessagePattern
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   200
    ^ TraceSendersOfMessagePattern
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   201
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   202
    "Created: / 02-02-2012 / 12:05:32 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   203
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   204
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   205
traceSendersOfMessagePattern:aGLOBMatchPattern
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   206
    "ever want to know, who sends a particular text-message to the transcript ?
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   207
     Call this with a match string and get a trace, when a matching text is sent to the transcript"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   208
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   209
    TraceSendersOfMessagePattern := aGLOBMatchPattern asNilIfEmpty
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   210
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   211
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   212
     self traceSendersOfMessagePattern:'removed unreached*'
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   213
     self traceSendersOfMessagePattern:nil.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   214
     self traceSendersOfMessagePattern:'*'.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   215
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   216
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   217
    "Created: / 02-02-2012 / 11:59:22 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   218
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   219
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   220
!TextCollector class methodsFor:'defaults'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   221
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   222
defaultCollectSize
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   223
    "the number of lines buffered for delayed update"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   224
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   225
    ^ 1000
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   226
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   227
    "Modified: / 27.7.1998 / 16:14:51 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   228
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   229
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   230
defaultLineLimit
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   231
    "the number of lines remembered by default"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   232
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   233
    ^ 1000
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   234
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   235
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   236
defaultTimeDelay
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   237
    "the time in seconds to wait & collect by default"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   238
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   239
    ^ 0.2 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   240
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   241
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   242
defaultTranscriptSize
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   243
    "the number of cols/lines by which the Transcript should come up"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   244
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   245
    ^ 70@11
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   246
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   247
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   248
!TextCollector methodsFor:'Compatibility-ST80'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   249
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   250
deselect
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   251
    self unselect
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   252
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   253
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   254
flush
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   255
    self endEntry.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   256
    super flush
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   257
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   258
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   259
!TextCollector methodsFor:'accessing'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   260
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   261
autoRaise
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   262
    ^ autoRaise ? false
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   263
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   264
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   265
autoRaise:something
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   266
    autoRaise := something.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   267
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   268
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   269
collect:aBoolean
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   270
    "turn on/off collecting - if on, do not output immediately
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   271
     but collect text and output en-bloque after some time delta"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   272
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   273
    collecting := aBoolean
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   274
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   275
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   276
collectSize:numberOfLines
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   277
    "set the collect buffer size. If collect is enabled,
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   278
     the receiver will force update of the view, 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   279
     whenever that many lines have been collected
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   280
     (or the updateTimeDelay interval has passed).
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   281
     With collect turned off, an immediate update is performed."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   282
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   283
    collectSize := numberOfLines
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   284
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   285
    "Modified: / 27.7.1998 / 16:16:00 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   286
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   287
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   288
destroyAction:aBlock
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   289
    "define the action to be performed when I get destroyed.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   290
     This is a special feature, to allow resetting Transcript to Stderr
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   291
     when closed. (see TextCollectorclass>>newTranscript)"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   292
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   293
    destroyAction := aBlock
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   294
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   295
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   296
lineLimit
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   297
    "return the number of text-lines I am supposed to hold"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   298
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   299
    ^ lineLimit
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   300
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   301
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   302
     Transcript lineLimit:5000
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   303
     Transcript lineLimit
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   304
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   305
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   306
    "Modified: / 16.5.1998 / 01:33:52 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   307
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   308
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   309
lineLimit:aNumber
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   310
    "define the number of text-lines I am supposed to hold"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   311
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   312
    lineLimit := aNumber
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   313
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   314
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   315
     Transcript lineLimit:5000
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   316
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   317
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   318
    "Modified: / 16.5.1998 / 01:33:52 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   319
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   320
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   321
updateTimeDelay:seconds
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   322
    "if collect is enabled, the receiver will update its view, 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   323
     after that time delay (i.e. it collects output during that period),
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   324
     or when collectSize lines have been collected without update.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   325
     With collect turned off, an immediate update is performed."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   326
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   327
    timeDelay := seconds
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   328
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   329
    "Modified: / 27.7.1998 / 16:16:41 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   330
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   331
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   332
!TextCollector methodsFor:'event handling'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   333
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   334
exposeX:x y:y width:w height:h
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   335
    "flush buffered text when exposed"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   336
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   337
    super exposeX:x y:y width:w height:h.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   338
    "/ self endEntry
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   339
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   340
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   341
!TextCollector methodsFor:'initialization & release'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   342
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   343
destroy
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   344
    "destroy this view"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   345
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   346
    destroyAction value.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   347
    super destroy
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   348
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   349
    "Modified: / 9.11.1998 / 21:18:17 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   350
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   351
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   352
editMenu
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   353
    "return my popUpMenu; thats the superClasses menu,
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   354
     minus any accept item."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   355
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   356
    <resource: #programMenu>
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   357
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   358
    |m idx|
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   359
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   360
    m := super editMenu.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   361
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   362
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   363
     textcollectors do not support #accept
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   364
     remove it from the menu (and the preceeding separating line)
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   365
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   366
    idx := m indexOf:#accept.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   367
    idx ~~ 0 ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   368
        m remove:idx.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   369
        (m labels at:(idx - 1)) = '-' ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   370
            m remove:idx - 1
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   371
        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   372
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   373
    ^ m
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   374
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   375
    "Modified: 3.7.1997 / 13:54:11 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   376
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   377
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   378
initialize
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   379
    super initialize.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   380
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   381
    scrollWhenUpdating := #endOfText.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   382
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   383
    outstandingLines := nil.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   384
    alwaysAppendAtEnd := true.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   385
    collectSize := self class defaultCollectSize.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   386
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   387
    flushPending := inFlush := false.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   388
    collecting := true.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   389
    timeDelay := self class defaultTimeDelay.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   390
    access := RecursionLock new name:'TextCollector access lock'.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   391
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   392
    lineLimit := self class defaultLineLimit.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   393
    entryStream := ActorStream new.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   394
    entryStream nextPutBlock:[:something | self nextPut:something].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   395
    entryStream nextPutAllBlock:[:something | self nextPutAll:something]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   396
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   397
    "Modified: / 14.12.1999 / 21:13:54 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   398
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   399
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   400
mapped
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   401
    "view became visible - show collected lines (if any)"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   402
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   403
    super mapped.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   404
    self endEntry
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   405
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   406
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   407
reinitialize
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   408
    "reinit after a snapIn.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   409
     recreate access-semaphore; image could have been save (theoretically)
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   410
     with the semaphore locked - in this case, we had a deadlock"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   411
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   412
    flushPending := inFlush := false.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   413
    access := RecursionLock new. "/ Semaphore forMutualExclusion.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   414
    super reinitialize.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   415
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   416
    "Modified: / 5.3.1998 / 10:09:14 / stefan"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   417
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   418
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   419
release
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   420
    flushBlock notNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   421
        Processor removeTimedBlock:flushBlock.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   422
        flushBlock := nil.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   423
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   424
    outstandingLines := nil.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   425
    outstandingLine := ''.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   426
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   427
    super release
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   428
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   429
    "Modified: / 9.11.1998 / 21:18:17 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   430
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   431
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   432
!TextCollector methodsFor:'private'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   433
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   434
checkLineLimit
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   435
    "this method checks if the text has become too large (> lineLimit)
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   436
     and cuts off some lines at the top if so; it must be called whenever lines
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   437
     have been added to the bottom"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   438
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   439
    |nDel newCursorLine|
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   440
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   441
    lineLimit notNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   442
        (cursorLine > lineLimit) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   443
            nDel := list size - lineLimit.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   444
            self basicListRemoveFromIndex:1 toIndex:nDel.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   445
            newCursorLine := cursorLine - nDel.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   446
            firstLineShown := firstLineShown - nDel.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   447
            (firstLineShown < 1) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   448
                newCursorLine := newCursorLine - firstLineShown + 1.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   449
                firstLineShown := 1
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   450
            ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   451
            self setCursorLine:newCursorLine.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   452
            self contentsChanged.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   453
            self invalidate.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   454
        ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   455
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   456
    self autoRaise ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   457
        self topView 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   458
            raise;
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   459
            "/ setForegroundWindow;
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   460
            yourself.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   461
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   462
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   463
    "Modified: / 26-07-2006 / 16:02:15 / fm"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   464
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   465
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   466
installDelayedUpdate
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   467
    "arrange for collecting input for some time,
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   468
     and output all buffered strings at once after a while.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   469
     This makes output to the transcript much faster on systems
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   470
     with poor scrolling performance (i.e. dumb vga cards ...)."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   471
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   472
    |p|
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   473
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   474
    flushPending ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   475
        inFlush ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   476
            flushPending := true.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   477
            "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   478
             we could run under a process, which dies in the meantime;
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   479
             therefore, we have to arrange for the transcript process to
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   480
             be interrupted and do the update.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   481
            "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   482
            windowGroup isNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   483
                p := Processor timeoutHandlerProcess
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   484
            ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   485
                p := windowGroup process
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   486
            ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   487
            (p isNil or:[p isSystemProcess]) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   488
                self endEntry
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   489
            ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   490
                flushBlock isNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   491
                    flushBlock := [self delayedEndEntry].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   492
                ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   493
                Processor addTimedBlock:flushBlock for:p afterSeconds:timeDelay.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   494
            ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   495
            p := nil.   "hack: avoid dangling references to p through the home context of flushBlock"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   496
        ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   497
    ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   498
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   499
    "Modified: / 17.4.1997 / 13:03:15 / stefan"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   500
    "Modified: / 9.11.1998 / 14:34:07 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   501
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   502
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   503
senderTraceString
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   504
    "generate a sender trace string."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   505
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   506
    |con|
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   507
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   508
    "/ skip over intermediate contexts
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   509
"/    con := con sender.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   510
"/    con := thisContext sender sender.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   511
"/    [ con receiver == self ] whileTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   512
"/        con := con sender
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   513
"/    ].     
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   514
    con := DebugView interestingContextFrom:thisContext sender sender.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   515
    ^ con printString
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   516
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   517
    "Created: / 02-02-2012 / 11:58:17 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   518
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   519
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   520
!TextCollector methodsFor:'queries'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   521
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   522
current
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   523
    "return the current (your screen's) transcript.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   524
     In multiDisplay applications, this need NOT be the main transcript.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   525
     But typically, this is the same as Transcript."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   526
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   527
    |theTranscript app|
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   528
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   529
    theTranscript := TranscriptQuerySignal query.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   530
    theTranscript isNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   531
        app := self topView application class current.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   532
        (app notNil and:[thisContext isRecursive not]) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   533
            theTranscript := (app transcript ? Stderr).
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   534
        ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   535
            theTranscript := Stderr.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   536
        ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   537
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   538
    ^ theTranscript
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   539
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   540
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   541
     Transcript current flash
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   542
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   543
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   544
    "Created: / 05-07-1996 / 14:14:34 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   545
    "Modified (comment): / 29-08-2013 / 11:04:55 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   546
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   547
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   548
isStream
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   549
    "if I am the Transcript, I am used as a stream.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   550
     See #displayOn:"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   551
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   552
    ^ self == Transcript
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   553
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   554
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   555
        Transcript isStream
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   556
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   557
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   558
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   559
isTextCollector
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   560
    ^ true
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   561
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   562
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   563
     Transcript isTextCollector
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   564
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   565
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   566
    "Created: / 29-08-2013 / 11:32:46 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   567
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   568
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   569
!TextCollector methodsFor:'scrolling'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   570
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   571
scrollTo:anOrigin redraw:doRedraw
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   572
    access critical:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   573
        super scrollTo:anOrigin redraw:doRedraw
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   574
    ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   575
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   576
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   577
!TextCollector methodsFor:'stream messages'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   578
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   579
addLine:line
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   580
    "append a line to the outstanding lines buffer"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   581
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   582
    access critical:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   583
        outstandingLine size ~~ 0 ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   584
            outstandingLine := outstandingLine , line
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   585
        ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   586
            (TimestampMessages == true and:[self == Transcript]) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   587
                outstandingLine := Timestamp now printString,' ',line
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   588
            ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   589
                outstandingLine := line
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   590
            ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   591
        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   592
        "/ self ~~ Transcript ifTrue:['xa' printCR].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   593
        outstandingLines isNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   594
            outstandingLines := OrderedCollection with:outstandingLine
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   595
        ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   596
            outstandingLines add:outstandingLine.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   597
        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   598
        outstandingLine := ''.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   599
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   600
        collecting ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   601
            flushPending ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   602
                self installDelayedUpdate
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   603
            ] ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   604
                outstandingLines size > collectSize ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   605
                    self endEntry
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   606
                ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   607
            ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   608
        ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   609
            self endEntry.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   610
            self cursorReturn.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   611
            self checkLineLimit.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   612
            self cursorToEnd.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   613
        ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   614
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   615
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   616
    "Created: / 28.7.1998 / 00:31:46 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   617
    "Modified: / 28.7.1998 / 00:34:58 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   618
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   619
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   620
cr
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   621
    "output a carriage return, finishing the current line"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   622
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   623
    access critical:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   624
        |line|
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   625
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   626
        collecting ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   627
            line := outstandingLine.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   628
            (TimestampMessages == true and:[self == Transcript]) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   629
                outstandingLine size == 0 ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   630
                    line := Timestamp now printString
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   631
                ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   632
            ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   633
            "/ self ~~ Transcript ifTrue:['xc' printCR].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   634
            outstandingLines isNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   635
                outstandingLines := OrderedCollection with:line
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   636
            ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   637
                outstandingLines add:line.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   638
            ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   639
            outstandingLine := ''.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   640
            flushPending ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   641
                self installDelayedUpdate
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   642
            ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   643
        ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   644
            self cursorReturn.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   645
            self checkLineLimit.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   646
            self cursorToEnd.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   647
        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   648
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   649
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   650
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   651
display:someObject
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   652
    "dolphin compatibility"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   653
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   654
    someObject printOn:self.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   655
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   656
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   657
doesNotUnderstand:aMessage
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   658
    "this is funny: all message we do not understand, are passed
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   659
     on to the stream which will send the characters via nextPut:
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   660
     This way, we understand all Stream messages - great isn't it!!"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   661
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   662
    ^ aMessage sendTo:entryStream
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   663
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   664
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   665
ensureCr
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   666
    "if the output position is not already at the beginning of a line,
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   667
     output a carriage return"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   668
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   669
    |needCR|
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   670
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   671
    collecting ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   672
        needCR := outstandingLine notEmptyOrNil
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   673
    ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   674
        needCR := cursorCol > 0
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   675
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   676
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   677
    needCR ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   678
        self cr.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   679
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   680
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   681
    "Created: / 14-09-2011 / 09:01:03 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   682
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   683
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   684
lineLength
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   685
    "to make a textCollector (somewhat) compatible with printer
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   686
     streams, support the lineLength query"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   687
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   688
    ^ width // (gc font width)
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   689
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   690
    "Modified: 11.1.1997 / 14:42:41 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   691
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   692
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   693
nextPut:something
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   694
    "append somethings printString to my displayed text.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   695
     This allows TextCollectors to be used Stream-wise"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   696
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   697
    |txt|
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   698
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   699
    (something isCharacter) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   700
        ((something == Character cr) or:[something == Character nl]) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   701
            ^ self cr
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   702
        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   703
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   704
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   705
    txt := something asString.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   706
    currentEmphasis notNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   707
        txt := txt emphasizeAllWith:currentEmphasis
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   708
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   709
    self show:txt.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   710
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   711
"/    flushPending ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   712
"/        self endEntry
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   713
"/    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   714
"/    (something isMemberOf:Character) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   715
"/        ((something == Character cr) or:[something == Character nl]) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   716
"/            ^ self cr
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   717
"/        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   718
"/        self insertCharAtCursor:something
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   719
"/    ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   720
"/        self insertStringAtCursor:(something printString).
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   721
"/        self checkLineLimit
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   722
"/    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   723
"/    device flush
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   724
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   725
    "Modified: 11.1.1997 / 14:43:05 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   726
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   727
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   728
nextPutAll:something
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   729
    "append all of something to my displayed text.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   730
     This allows TextCollectors to be used Stream-wise"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   731
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   732
    self show:(currentEmphasis notNil 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   733
                ifTrue:[something emphasizeAllWith:currentEmphasis]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   734
                ifFalse:[something])
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   735
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   736
    "Modified: 11.1.1997 / 14:43:26 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   737
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   738
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   739
show:anObject
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   740
    "insert the argument aString at current cursor position"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   741
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   742
    |printString lines|
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   743
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   744
    printString := anObject printString.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   745
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   746
    (self == Transcript) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   747
        DebugSendersOfMessagePattern notNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   748
            (DebugSendersOfMessagePattern match:printString string) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   749
                "disable all with: DebugSendersOfMessagePattern := nil"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   750
                self halt:('Transcript: text matches: "', printString,'"').
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   751
            ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   752
        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   753
        TraceSendersOfMessagePattern notNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   754
            (TraceSendersOfMessagePattern match:printString string) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   755
                printString := self senderTraceString,': ',printString
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   756
            ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   757
        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   758
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   759
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   760
    (printString includes:(Character cr)) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   761
        lines := printString asStringCollection.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   762
        lines keysAndValuesDo:[:nr :line |
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   763
            (nr == lines size 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   764
            and:[(printString endsWith:(Character cr)) not]) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   765
                "/ the last one.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   766
                self show:line
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   767
            ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   768
                self showCR:line
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   769
            ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   770
        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   771
        ^ self.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   772
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   773
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   774
    access critical:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   775
        "/ self ~~ Transcript ifTrue:['xs' printCR].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   776
        outstandingLine size ~~ 0 ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   777
            outstandingLine := outstandingLine , printString
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   778
        ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   779
            outstandingLine := printString
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   780
        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   781
        collecting ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   782
            flushPending ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   783
                self installDelayedUpdate
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   784
            ] ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   785
                outstandingLines size > collectSize ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   786
                    self endEntry
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   787
                ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   788
            ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   789
        ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   790
            self endEntry
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   791
        ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   792
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   793
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   794
    "Modified: / 24-03-2012 / 20:04:10 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   795
    "Modified (format): / 02-06-2012 / 01:54:55 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   796
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   797
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   798
showCR:anObject
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   799
    "insert the argument aString at current cursor position,
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   800
     and advance to the next line. This is the same as a #show:
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   801
     followed by a #cr."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   802
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   803
    |printString lines|
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   804
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   805
"/ self ~~ Transcript ifTrue:[ ^ self tshow:anObject].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   806
    printString := anObject printString.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   807
    printString size == 0 ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   808
        self cr.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   809
        ^ self.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   810
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   811
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   812
    self == Transcript ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   813
        DebugSendersOfMessagePattern notNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   814
            (DebugSendersOfMessagePattern match:printString string) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   815
                "/ to disable this right from inside the debugger, evaluate:
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   816
                "/     DebugSendersOfMessagePattern := nil
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   817
                self halt:('Transcript: text matches: "', printString, '"').
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   818
            ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   819
        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   820
        TraceSendersOfMessagePattern notNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   821
            (TraceSendersOfMessagePattern match:printString string) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   822
                printString := self senderTraceString,': ',printString
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   823
            ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   824
        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   825
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   826
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   827
    (printString includesAny:(String crlf)) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   828
        lines := printString asStringCollection.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   829
        lines do:[:line|
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   830
            (line endsWith:Character nl) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   831
                (line endsWith:(String crlf)) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   832
                    self addLine:(line copyButLast:2).
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   833
                ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   834
                    self addLine:(line copyButLast:1).
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   835
                ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   836
            ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   837
                (line endsWith:Character return) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   838
                    self addLine:(line copyButLast:1).
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   839
                ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   840
                    self addLine:line
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   841
                ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   842
            ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   843
        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   844
        ^ self.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   845
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   846
    self addLine:printString
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   847
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   848
    "Modified: / 24-03-2012 / 20:00:08 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   849
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   850
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   851
space
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   852
    self show:' '
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   853
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   854
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   855
tab
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   856
    "append a tab-character to the stream.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   857
     This is only allowed, if the receiver supports writing."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   858
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   859
    self nextPut:(Character tab)
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   860
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   861
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   862
!TextCollector methodsFor:'stream messages-emphasis'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   863
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   864
bgColor:aColor
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   865
    aColor isNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   866
        currentEmphasis := Text removeEmphasis:#backgroundColor from:currentEmphasis
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   867
    ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   868
        currentEmphasis := Text addEmphasis:(#backgroundColor->aColor) to:currentEmphasis
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   869
    ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   870
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   871
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   872
bold
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   873
    "switch to bold - followup text sent via show/nextPutAll: will be inserted in
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   874
     a bold font."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   875
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   876
    currentEmphasis := Text addEmphasis:#bold to:currentEmphasis
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   877
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   878
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   879
color:aColor
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   880
    aColor isNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   881
        currentEmphasis := Text removeEmphasis:#color from:currentEmphasis
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   882
    ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   883
        currentEmphasis := Text addEmphasis:(#color->aColor) to:currentEmphasis
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   884
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   885
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   886
    "Modified: / 26.3.1999 / 14:29:21 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   887
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   888
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   889
italic
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   890
    currentEmphasis := Text addEmphasis:#italic to:currentEmphasis
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   891
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   892
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   893
normal
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   894
    currentEmphasis := nil
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   895
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   896
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   897
notBold
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   898
    "switch to non-bold - followup text sent via show/nextPutAll: will be inserted in
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   899
     a non-bold font."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   900
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   901
    currentEmphasis := Text removeEmphasis:#bold from:currentEmphasis
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   902
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   903
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   904
notItalic
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   905
    "switch to non-italic - followup text sent via show/nextPutAll: will be inserted in
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   906
     a non-italic font."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   907
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   908
    currentEmphasis := Text removeEmphasis:#italic from:currentEmphasis
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   909
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   910
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   911
notReverse
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   912
    currentEmphasis := Text removeEmphasis:#color from:currentEmphasis.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   913
    currentEmphasis := Text removeEmphasis:#backgroundColor from:currentEmphasis.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   914
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   915
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   916
notUnderline
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   917
    currentEmphasis := Text removeEmphasis:#underline from:currentEmphasis
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   918
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   919
    "Created: / 26.3.1999 / 14:27:07 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   920
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   921
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   922
reverse
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   923
    currentEmphasis := Text addEmphasis:(#color->bgColor) to:currentEmphasis.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   924
    currentEmphasis := Text addEmphasis:(#backgroundColor->fgColor) to:currentEmphasis.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   925
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   926
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   927
underline
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   928
    currentEmphasis := Text addEmphasis:#underline to:currentEmphasis
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   929
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   930
    "Created: / 26.3.1999 / 14:27:07 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   931
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   932
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   933
!TextCollector methodsFor:'transcript specials'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   934
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   935
beTranscript
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   936
    "make the receiver be the systemTranscript; this one
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   937
     is accessable via the global Transcript and gets relevant
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   938
     system messages from various places."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   939
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   940
    self beTranscript:#Transcript
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   941
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   942
    "Modified: / 2.11.1997 / 22:34:47 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   943
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   944
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   945
beTranscript:name
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   946
    "make the receiver be the systemTranscript; this one
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   947
     is accessable via the global Transcript and gets relevant
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   948
     system messages from various places."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   949
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   950
    |fg bg cFg cBg|
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   951
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   952
    Smalltalk at:name put:self.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   953
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   954
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   955
     fancy feature: whenever Transcript is closed, reset to StdError
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   956
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   957
    self destroyAction:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   958
        self == (Smalltalk at:name) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   959
            Smalltalk at:name put:Stderr
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   960
        ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   961
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   962
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   963
    "/ user may prefer a special color for this one;
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   964
    "/ look into the style definitions ...
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   965
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   966
    fg := styleSheet colorAt:'transcript.foregroundColor' default:self foregroundColor.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   967
    bg := styleSheet colorAt:'transcript.backgroundColor' default:self backgroundColor.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   968
    self foregroundColor:fg backgroundColor:bg.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   969
    self viewBackground:bg.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   970
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   971
    cFg := styleSheet colorAt:'transcript.cursorForegroundColor' default:bg.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   972
    cBg := styleSheet colorAt:'transcript.cursorBackgroundColor' default:fg.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   973
    self cursorForegroundColor:cFg backgroundColor:cBg. 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   974
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   975
    "self lineLimit:1000. " "or whatever you think makes sense"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   976
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   977
    "Modified: / 2.11.1997 / 22:34:47 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   978
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   979
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   980
beginEntry
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   981
    "noop for now, ST80 compatibility"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   982
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   983
    ^ self
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   984
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   985
    "Created: / 4.3.1998 / 11:08:14 / stefan"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   986
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   987
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   988
clear
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   989
    self endEntry.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   990
    self contents:nil.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   991
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   992
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   993
     Transcript clear
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   994
    "
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   995
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   996
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   997
delayedEndEntry
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   998
    "flush collected output; displaying all that has been buffered so far"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   999
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1000
    "/ self ~~ Transcript ifTrue:[ 'de0' printCR ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1001
    inFlush ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1002
        "/ self ~~ Transcript ifTrue:[ 'deX' printCR ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1003
        ^ self
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1004
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1005
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1006
    "/ self ~~ Transcript ifTrue:[ 'de1' printCR ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1007
    access owner == Processor activeProcess ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1008
        "/ self ~~ Transcript ifTrue:[ 'de2' printCR ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1009
        self installDelayedUpdate.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1010
        ^ self
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1011
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1012
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1013
    self endEntry
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1014
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1015
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1016
endEntry
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1017
    "flush collected output; displaying all that has been buffered so far"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1018
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1019
    |nLines lines device|
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1020
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1021
    ((outstandingLines isEmptyOrNil) and:[outstandingLine isEmptyOrNil]) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1022
        "/ self ~~ Transcript ifTrue:[ 'e- ' print. thisContext sender selector printCR ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1023
        ^ self
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1024
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1025
    shown ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1026
        "/ when iconified or not yet shown, keep
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1027
        "/ collecting. But not too much ...
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1028
        outstandingLines size < 300 ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1029
            "/ self ~~ Transcript ifTrue:[ 'eC' printCR ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1030
            access critical:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1031
                flushPending ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1032
                    self installDelayedUpdate.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1033
                ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1034
            ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1035
            ^ self
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1036
        ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1037
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1038
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1039
    device := self graphicsDevice.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1040
    (device isNil or:[device isOpen not or:[self drawableId isNil]]) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1041
        "on snapshot load, Transcript may not yet be re-created.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1042
         Write to Stderr then."
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1043
        Stderr notNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1044
            outstandingLines do:[:eachLine|
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1045
                eachLine printOn:Stderr.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1046
            ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1047
            outstandingLines := nil.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1048
            outstandingLine notNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1049
                outstandingLine printOn:Stderr.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1050
                outstandingLine := nil.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1051
            ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1052
            Stderr cr.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1053
        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1054
        ^ self.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1055
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1056
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1057
    "/ self ~~ Transcript ifTrue:[ 'e ' print. 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1058
    "/    thisContext fullPrintAll.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1059
    "/ ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1060
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1061
"/    access owner == Processor activeProcess ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1062
"/self ~~ Transcript ifTrue:[ 'eI' printCR ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1063
"/        self installDelayedUpdate.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1064
"/        ^ self
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1065
"/    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1066
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1067
    access critical:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1068
        collecting ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1069
            flushBlock notNil ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1070
                Processor removeTimedBlock:flushBlock.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1071
            ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1072
"/            flushPending ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1073
"/self ~~ Transcript ifTrue:[ 'eP' printCR ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1074
"/                ^ self
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1075
"/            ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1076
        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1077
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1078
        "/ self ~~ Transcript ifTrue:[ 'e1' printCR ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1079
        inFlush ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1080
            "/ self ~~ Transcript ifTrue:[ 'e2' printCR ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1081
            inFlush := true.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1082
            [
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1083
                flushPending := false.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1084
                "/ self ~~ Transcript ifTrue:[ 'e3 "' print. outstandingLine print. '" ' print. outstandingLine asByteArray hexPrintString print. ' ' printCR. 
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1085
                "/                             (outstandingLines ? #()) do:[:l | '"' print. l print. '" ' print. l asByteArray hexPrintString printCR ]].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1086
                (nLines := outstandingLines size) ~~ 0 ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1087
                    "/ self ~~ Transcript ifTrue:[ 'e4' printCR.].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1088
                    "insert the bunch of lines - if any"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1089
                    lines := outstandingLines.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1090
                    outstandingLines := nil.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1091
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1092
                    "/ self ~~ Transcript ifTrue:[ 'e5 ' print. nLines printCR.].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1093
                    (nLines ~~ 0) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1094
                        self isInInsertMode ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1095
                            "/ self ~~ Transcript ifTrue:[ (nLines > 1 and:[(lines second ? '') startsWith:'111']) ifTrue:['e6a' printCR.self halt.]].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1096
                            self insertLines:lines withCR:true.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1097
                            "/ self ~~ Transcript ifTrue:[ (nLines > 1 and:[(lines second ? '') startsWith:'111']) ifTrue:['e6a' printCR.self halt.]].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1098
                        ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1099
                            self replaceLines:lines withCR:true
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1100
                        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1101
                        alwaysAppendAtEnd ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1102
                            self cursorToEnd.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1103
                        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1104
                        (cursorLine >= (firstLineShown + nFullLinesShown)) ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1105
                            self withCursorOffDo:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1106
                                self scrollDown:nLines
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1107
                            ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1108
                        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1109
                    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1110
                ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1111
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1112
                "/ self ~~ Transcript ifTrue:[ (nLines > 1 and:[(lines second ? '') startsWith:'111']) ifTrue:['e7a' printCR.self halt.]].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1113
                "and the last partial line - if any"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1114
                outstandingLine size ~~ 0 ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1115
                    self isInInsertMode ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1116
                        self insertStringAtCursor:outstandingLine.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1117
                    ] ifFalse:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1118
                        self replaceStringAtCursor:outstandingLine.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1119
                    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1120
                    outstandingLine := ''.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1121
                ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1122
                self checkLineLimit.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1123
                "/ device flush.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1124
            ] ensure:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1125
                inFlush := false.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1126
            ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1127
        ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1128
"/        flushPending ifTrue:[
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1129
"/            flushPending := false.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1130
"/            self installDelayedUpdate
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1131
"/        ]
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1132
    ].
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1133
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1134
    "Modified: / 9.11.1998 / 21:17:56 / cg"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1135
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1136
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1137
flash
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1138
    "make sure everything is visible, before flashing"
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1139
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1140
    self endEntry.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1141
    super flash.
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1142
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1143
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1144
!TextCollector class methodsFor:'documentation'!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1145
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1146
version
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1147
    ^ '$Header: /cvs/stx/stx/libwidg/TextCollector.st,v 1.134.2.1 2014-05-08 08:30:56 stefan Exp $'
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1148
!
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1149
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1150
version_CVS
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1151
    ^ '$Header: /cvs/stx/stx/libwidg/TextCollector.st,v 1.134.2.1 2014-05-08 08:30:56 stefan Exp $'
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1152
! !
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1153
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1154
a18a03c5c572 GC is delegated instead of inherited
Stefan Vogel <sv@exept.de>
parents:
diff changeset
  1155
TextCollector initialize!