TextColl.st
changeset 60 f3c738c24ce6
parent 59 450ce95a72a4
child 63 f4eaf04d1eaf
--- a/TextColl.st	Mon Oct 10 04:03:47 1994 +0100
+++ b/TextColl.st	Fri Oct 28 04:25:37 1994 +0100
@@ -23,7 +23,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libwidg/Attic/TextColl.st,v 1.10 1994-10-10 03:03:08 claus Exp $
+$Header: /cvs/stx/stx/libwidg/Attic/TextColl.st,v 1.11 1994-10-28 03:25:29 claus Exp $
 '!
 
 !TextCollector class methodsFor:'documentation'!
@@ -44,7 +44,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libwidg/Attic/TextColl.st,v 1.10 1994-10-10 03:03:08 claus Exp $
+$Header: /cvs/stx/stx/libwidg/Attic/TextColl.st,v 1.11 1994-10-28 03:25:29 claus Exp $
 "
 !
 
@@ -56,15 +56,16 @@
     Its main use in the system is the Transcript, but it can also be used for
     things like trace-windows etc.
 
-    If collecting is turned on, a Textcollector will not immediately display 
+    If collecting is turned on, a textcollector will not immediately display 
     entered text, but wait for some short time (timeDelay) and collect incoming 
     data - finally updating the whole chunk in one piece. 
     This helps slow display devices, which would otherwise scroll a lot. 
     (on fast displays this is less of a problem).
 
-    The total number of lines kept is controlled by lineLimit, if more lines are 
-    entered at the bottom, the textcollector will forget lines at the top. 
-    Linelimit can also be set to nil (i.e. no limit), but you may need a lot 
+    The total number of lines kept is controlled by lineLimit, if more lines 
+    than this limit are added at the bottom, the textcollector will forget lines 
+    at the top. 
+    You can set linelimit to nil (i.e. no limit), but you may need a lot 
     of memory then ...
 "
 ! !
@@ -77,6 +78,12 @@
     ^ 600
 ! 
 
+defaultTranscriptSize
+    "the number of cols/lines by which the Transcript should come up"
+
+    ^ 70@11
+! 
+
 defaultTimeDelay
     "the time in seconds to wait & collect by default"
 
@@ -86,30 +93,38 @@
 !TextCollector class methodsFor:'instance creation'!
 
 newTranscript
-    |topView transcript f v fg bg cFg cBg|
+    |topView transcript f v fg bg cFg cBg lines cols|
 
     topView := StandardSystemView label:'Transcript' minExtent:(100 @ 100).
     topView icon:(Form fromFile:'SmalltalkX.xbm').
 
-    v := ScrollableView for:self in:topView.
+    v := HVScrollableView for:self miniScrollerH:true miniScrollerV:false in:topView.
     v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
     transcript := v scrolledView.
     "transcript partialLines:false."
 
     f := transcript font.
-    topView extent:(((f widthOf:'x') * 70) @ (f height * 10)).
+
+    "
+     should add the height of the frame & scrollbars to be exact ...
+    "
+    cols := self defaultTranscriptSize x.
+    lines := self defaultTranscriptSize y.
+    topView extent:(((f widthOf:'x') * cols) @ (f height * lines)).
 
     Smalltalk at:#Transcript put:transcript.
 
-    "fancy feature: whenever Transcript is closed, reset to StdError"
+    "
+     fancy feature: whenever Transcript is closed, reset to StdError
+    "
     transcript destroyAction:[Smalltalk at:#Transcript put:Stderr].
 
-    fg := StyleSheet at:'transcriptForegroundColor' default:transcript foregroundColor.
-    bg := StyleSheet at:'transcriptBackgroundColor' default:transcript backgroundColor.
+    fg := StyleSheet colorAt:'transcriptForegroundColor' default:transcript foregroundColor.
+    bg := StyleSheet colorAt:'transcriptBackgroundColor' default:transcript backgroundColor.
     transcript foregroundColor:fg backgroundColor:bg.
 
-    cFg := StyleSheet at:'transcriptCursorForegroundColor' default:bg.
-    cBg := StyleSheet at:'transcriptCursorBackgroundColor' default:fg.
+    cFg := StyleSheet colorAt:'transcriptCursorForegroundColor' default:bg.
+    cBg := StyleSheet colorAt:'transcriptCursorBackgroundColor' default:fg.
     transcript cursorForegroundColor:cFg backgroundColor:cBg. 
 
     topView open.