VT100TerminalView.st
changeset 978 8f6dee49a562
parent 976 40af522dda86
child 998 4915be34a1d7
--- a/VT100TerminalView.st	Sat Jun 20 18:21:30 1998 +0200
+++ b/VT100TerminalView.st	Sat Jun 20 20:28:31 1998 +0200
@@ -95,15 +95,20 @@
     (parameters at:1) == 1 ifTrue:[
         "/ ESC-[-1-m  -> bold
 
-        currentEmphasis := #bold.
+        self bold.
         ^ self.
     ].
-    currentEmphasis := nil.
+    (parameters at:1) == 7 ifTrue:[
+        "/ ESC-[-7-m  -> revers
 
-"/    displayMode _ anInteger!!
+        self reverse.
+        ^ self.
+    ].
+    "/ ESC-[-any-m  -> normal
+    self normal.
 
     "Created: / 10.6.1998 / 15:01:16 / cg"
-    "Modified: / 12.6.1998 / 22:26:30 / cg"
+    "Modified: / 20.6.1998 / 20:14:26 / cg"
 !
 
 insertCaharcters
@@ -123,22 +128,25 @@
     "Move to the locations indicated by the first and second parameters."
 
     self moveToX: ((parameters at: 2) max: 1) y: ((parameters at: 1) max: 1).
-    self endOfSequence
 
     "Created: / 10.6.1998 / 14:40:01 / cg"
+    "Modified: / 20.6.1998 / 18:49:12 / cg"
 !
 
 moveToX: xLocation y: yLocation
     "Position the cursor at the location given by xLocation and yLocation.
      Ignore the command if the parameters are outside the allowable range."
 
-    (xLocation < 1 or: [xLocation > numberOfColumns]) ifTrue: [^self].
-    (yLocation < 1 or: [yLocation > numberOfLines]) ifTrue: [^self].
+"/ Transcript show:'numberOfColumns '; showCR:numberOfColumns.
+"/ Transcript show:'numberOfLines '; showCR:numberOfLines.
+
+"/    (xLocation < 1 or: [xLocation > numberOfColumns]) ifTrue: [^self].
+"/    (yLocation < 1 or: [yLocation > numberOfLines]) ifTrue: [^self].
 
     self cursorVisibleLine:yLocation col:xLocation.
 
     "Created: / 10.6.1998 / 14:40:49 / cg"
-    "Modified: / 12.6.1998 / 23:04:40 / cg"
+    "Modified: / 20.6.1998 / 20:27:11 / cg"
 !
 
 reportTerminalType
@@ -165,21 +173,27 @@
 
     |l1 c1 l2 c2|
 
+
     l1 := (parameters at: 1).
     l2 := (parameters at: 2).
+"/ Transcript show:'resetDefaults:'; show:l1;show:' ';showCR:l2.
     (l1 ~~ 0 and:[l2 ~~ 0]) ifTrue:[
         rangeStartLine := l1.
         rangeEndLine := l2.
     ] ifFalse:[
-        self halt.
+"/        self halt.
     ].
 
-"/    autoLineFeed _ false.
-"/    autoMargin _ true.
-"/    displayMode _ 0.                "Normal display"!! !!
+"/    (rangeStartLine == 1 and:[rangeEndLine == numberOfLines]) ifTrue:[
+"/        rangeEndLine := rangeStartLine := nil.
+"/    ].
+
+"/    autoLineFeed := false.
+"/    autoMargin := true.
+"/    displayMode := 0.                "Normal display"!! !!
 
     "Created: / 10.6.1998 / 14:50:53 / cg"
-    "Modified: / 12.6.1998 / 21:24:48 / cg"
+    "Modified: / 20.6.1998 / 20:28:26 / cg"
 ! !
 
 !VT100TerminalView methodsFor:'initialization'!
@@ -255,11 +269,11 @@
             state := #gotESC. ^ self 
         ].
         (char == Character nl) ifTrue:[ 
-            self doCursorDown:1.
-            ^ self endEntry.
+            self endEntry.
+            ^ self doCursorDown:1.
         ].
         (char == Character return) ifTrue:[ 
-            rangeEndLine ~~ numberOfLines ifTrue:[
+            (rangeEndLine notNil and:[rangeEndLine ~~ numberOfLines]) ifTrue:[
                 self endEntry.
                 self cursorToBeginOfLine.
             ] ifFalse:[
@@ -280,6 +294,14 @@
             self reportTerminalType.
             ^ self 
         ].
+        char asciiValue < 32 ifTrue:[
+            char ~~ Character tab ifTrue:[
+                char asciiValue ~~ 0 ifTrue:[
+                    Transcript show:'unhandled control key: '; showCR:char storeString.
+                ].
+                ^ self.
+            ]
+        ].
         ^ super nextPut:char
     ].
 
@@ -338,6 +360,14 @@
             self reportTerminalType.
             ^ self endOfSequence
         ].
+        char == $= ifTrue: [
+            "/ ESC-=
+            ^ self doNothing
+        ].
+        char == $< ifTrue: [
+            "/ ESC-<
+            ^ self doNothing
+        ].
         ^ self doNothing
     ].
 
@@ -345,6 +375,10 @@
         "/ Currently, we are in ESC-[ state.  
         "/ Decide what to do on the basis of the parameter char.
 
+        char == $? ifTrue: [
+            state := #gotCSI2.
+            ^ self
+        ].
         char == $; ifTrue:[
             currentParam := (currentParam + 1) min: 8.
             ^ self
@@ -417,10 +451,6 @@
             self resetDefaults.
             ^ self endOfSequence
         ].
-        char == $? ifTrue: [
-            state := #gotCSI2.
-            ^ self
-        ].
         ^ self doNothing
     ].
 
@@ -457,7 +487,7 @@
 
     self doNothing
 
-    "Modified: / 13.6.1998 / 18:13:25 / cg"
+    "Modified: / 20.6.1998 / 20:26:42 / cg"
 ! !
 
 !VT100TerminalView methodsFor:'queries'!
@@ -471,5 +501,5 @@
 !VT100TerminalView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/VT100TerminalView.st,v 1.16 1998-06-20 15:36:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/VT100TerminalView.st,v 1.17 1998-06-20 18:28:31 cg Exp $'
 ! !