EditTextView.st
changeset 324 9eec6d69e155
parent 323 58102e6bc087
child 331 c58f0c52d2d7
--- a/EditTextView.st	Wed Feb 07 18:42:12 1996 +0100
+++ b/EditTextView.st	Wed Feb 07 19:32:04 1996 +0100
@@ -13,8 +13,8 @@
 TextView subclass:#EditTextView
 	instanceVariableNames:'cursorLine cursorVisibleLine cursorCol cursorShown
 		prevCursorState readOnly modified fixedSize exceptionBlock
-		cursorFgColor cursorBgColor cursorType undoAction
-		typeOfSelection lastString lastReplacement lastAction replacing
+		cursorFgColor cursorBgColor cursorType undoAction typeOfSelection
+		lastString lastReplacement lastAction replacing
 		showMatchingParenthesis hasKeyboardFocus acceptAction lockUpdates
 		tabMeansNextField'
 	classVariableNames:'DefaultCursorForegroundColor DefaultCursorBackgroundColor
@@ -2094,7 +2094,7 @@
     "
     (('[fF][0-9]' match:key)
     or:['[fF][0-9][0-9]' match:key]) ifTrue:[
-        device shiftDown ifFalse:[
+        self sensor shiftDown ifFalse:[
             fKeyMacros := Smalltalk at:#FunctionKeySequences.
             fKeyMacros notNil ifTrue:[
                 (fKeyMacros includesKey:key) ifTrue:[
@@ -2194,7 +2194,7 @@
     ].
 
     (key == #Return)    ifTrue:[
-        device shiftDown ifTrue:[
+        self sensor shiftDown ifTrue:[
             self unselect. self cursorReturn. ^self
         ].
         readOnly ifTrue:[
@@ -2216,15 +2216,19 @@
     ].
 
     (key == #Tab) ifTrue:[
-        device shiftDown ifTrue:[
+        self tabMeansNextField ifTrue:[^ super keyPress:key x:x y:y].
+
+        self sensor shiftDown ifTrue:[
             "
              the old version used shift-tab as backtab,
              however, backtab was seldom used.
              An alternative is to make it a non-inserting tab ...
             "
-            "/ self unselect. self cursorBacktab. ^self
-            self unselect. self cursorTab. ^self
+            "/ self unselect. self cursorBacktab.
+            self unselect. self cursorTab. 
+            ^self
         ].
+
         "
          uncomment line below, if you like RAND/INed/MAXed editor behavior
          (where tab-key is only cursor positioning)
@@ -2232,7 +2236,8 @@
          complained ....
         "
         "/ self unselect. self cursorTab. ^self
-        self unselect. self insertTabAtCursor. ^self
+        self unselect. self insertTabAtCursor. 
+        ^self
     ].
 
     (key == #BackSpace) ifTrue:[
@@ -2298,7 +2303,7 @@
     ].
     super keyPress:key x:x y:y
 
-    "Modified: 16.12.1995 / 13:11:45 / cg"
+    "Modified: 7.2.1996 / 19:26:28 / cg"
 !
 
 mapped
@@ -2775,12 +2780,14 @@
 
 !EditTextView methodsFor:'queries'!
 
-canTab
+tabMeansNextField
     "return true, if a Tab character should shift focus."
 
     "if not readOnly, I want my tab keys ..."
 
     ^ readOnly or:[tabMeansNextField]
+
+    "Created: 7.2.1996 / 19:15:31 / cg"
 !
 
 widthOfContents
@@ -3192,5 +3199,5 @@
 !EditTextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.43 1996-02-07 17:42:12 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.44 1996-02-07 18:32:04 cg Exp $'
 ! !