VT100TerminalView.st
changeset 1001 7fe14ad43ae3
parent 998 4915be34a1d7
child 1016 2d8e8b9bb9a5
--- a/VT100TerminalView.st	Tue Jul 21 20:12:32 1998 +0200
+++ b/VT100TerminalView.st	Tue Jul 21 20:13:07 1998 +0200
@@ -69,11 +69,16 @@
 clearLines
     "Clear some part of the current line, as indicated by the first parameter."
 
-    (parameters at: 1) = 0 ifTrue: [^self doClearToEndOfLine].
-    (parameters at: 1) = 1 ifTrue: [^self doClearFromBeginningOfLine].
-    (parameters at: 1) = 2 ifTrue: [^self doClearEntireLine]
+    |arg|
+
+    arg := parameters at: 1.
+
+    arg = 0 ifTrue: [^self doClearToEndOfLine].
+    arg = 1 ifTrue: [^self doClearFromBeginningOfLine].
+    arg = 2 ifTrue: [^self doClearEntireLine]
 
     "Created: / 10.6.1998 / 14:44:22 / cg"
+    "Modified: / 21.7.1998 / 20:07:42 / cg"
 !
 
 deleteCharacters
@@ -111,6 +116,21 @@
     "Modified: / 20.6.1998 / 20:14:26 / cg"
 !
 
+doClearDisplay
+    "Clear some part of the current screen, as indicated by the first parameter."
+
+    |arg|
+
+    arg := parameters at: 1.
+
+    arg = 0 ifTrue: [^self doClearToEndOfScreen].
+    arg = 1 ifTrue: [^self doClearFromBeginningOfScreen].
+    arg = 2 ifTrue: [^self doClearEntireScreen]
+
+    "Created: / 21.7.1998 / 20:05:07 / cg"
+    "Modified: / 21.7.1998 / 20:07:36 / cg"
+!
+
 insertCaharcters
     "Insert the appropriate number of spaces at the position
      indicated by the cursor."
@@ -264,37 +284,45 @@
         "/ Currently, we are in initial state.  
         "/ Decide what to do on the basis of the parameter char.
 
-        (char == Character esc) ifTrue:[ 
-            self endEntry.
-            state := #gotESC. ^ self 
-        ].
-        (char == Character nl) ifTrue:[ 
-            self endEntry.
-            ^ self doCursorDown:1.
-        ].
-        (char == Character return) ifTrue:[ 
-            (rangeEndLine notNil and:[rangeEndLine ~~ numberOfLines]) ifTrue:[
+        char asciiValue < 32 ifTrue:[
+            (char == Character esc) ifTrue:[ 
+                self endEntry.
+                state := #gotESC. ^ self 
+            ].
+            (char == Character nl) ifTrue:[ 
                 self endEntry.
-                self cursorToBeginOfLine.
-            ] ifFalse:[
-                state := #gotReturn.
+                ^ self doCursorDown:1.
+            ].
+            (char == Character return) ifTrue:[ 
+                (rangeEndLine notNil and:[rangeEndLine ~~ numberOfLines]) ifTrue:[
+                    self endEntry.
+                    self cursorToBeginOfLine.
+                ] ifFalse:[
+                    state := #gotReturn.
+                ].
+                ^ self.
             ].
-            ^ self.
-        ].
-        (char == Character backspace) ifTrue:[ 
-            self endEntry.
-            ^ self cursorLeft. "/ doBackspace
-        ].
-        (char == Character bell) ifTrue:[
-            self beep.
-            ^ self 
-        ].
-        (char == (Character value:5)) ifTrue:[
-            "/ terminal-type query
-            self reportTerminalType.
-            ^ self 
-        ].
-        char asciiValue < 32 ifTrue:[
+            (char == Character backspace) ifTrue:[ 
+                self endEntry.
+                ^ self cursorLeft. "/ doBackspace
+            ].
+            (char == Character bell) ifTrue:[
+                self beep.
+                ^ self 
+            ].
+            (char == (Character value:5)) ifTrue:[
+                "/ terminal-type query
+                self reportTerminalType.
+                ^ self 
+            ].
+            (char == (Character value:16rf)) ifTrue:[
+                "/ SO
+                ^ self 
+            ].
+            (char == (Character value:16re)) ifTrue:[
+                "/ SI
+                ^ self 
+            ].
             char ~~ Character tab ifTrue:[
                 char asciiValue ~~ 0 ifTrue:[
                     Transcript show:'unhandled control key: '; showCR:char storeString.
@@ -487,7 +515,7 @@
 
     self doNothing
 
-    "Modified: / 20.6.1998 / 20:26:42 / cg"
+    "Modified: / 21.7.1998 / 20:11:30 / cg"
 ! !
 
 !VT100TerminalView methodsFor:'queries'!
@@ -501,5 +529,5 @@
 !VT100TerminalView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/VT100TerminalView.st,v 1.18 1998-07-21 17:34:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/VT100TerminalView.st,v 1.19 1998-07-21 18:12:56 cg Exp $'
 ! !