EditTextView.st
branchdelegated_gc_text-view-selection-refactoring
changeset 5296 588057883532
parent 5294 d53a2bdc1569
parent 5295 867e53cc61c6
child 5299 cc8c9190c081
--- a/EditTextView.st	Wed Dec 31 11:25:27 2014 +0100
+++ b/EditTextView.st	Mon Feb 16 08:12:24 2015 +0000
@@ -11,6 +11,8 @@
 "
 "{ Package: 'stx:libwidg' }"
 
+"{ NameSpace: Smalltalk }"
+
 TextView subclass:#EditTextView
 	instanceVariableNames:'cursorLine cursorVisibleLine cursorCol cursorShown
 		prevCursorState readOnly modifiedChannel fixedSize exceptionBlock
@@ -1271,12 +1273,13 @@
     ^ self modifiedChannel
 !
 
-st80Mode:aBoolean
+st80Mode:aBooleanOrNil
     "set/clear the st80Mode flag.
      If on, the cursor wraps at the line end (like in vi or st80);
-     if off, we have the Rand-editor behavior (random access)"
-
-    st80Mode := aBoolean
+     if off, we have the Rand-editor behavior (random access)
+     if nil, the setting follows the current userPref setting."
+
+    st80Mode := aBooleanOrNil
 
     "Created: / 09-11-2010 / 13:55:50 / cg"
 !
@@ -1946,7 +1949,6 @@
     aBoolean == cursorShown ifTrue:[
         ^ cursorShown
     ].
-
     oldState := cursorShown.
 
     aBoolean ifTrue:[
@@ -5741,8 +5743,8 @@
     "in addition to however my superclass thinks how a focusView is to be
      displayed, show the cursor when I got the focus"
 
+    self hasKeyboardFocus:true.
     self showCursor.
-    self hasKeyboardFocus:true.
     super showFocus:explicit
 
     "Modified: 11.12.1996 / 16:56:54 / cg"
@@ -6042,8 +6044,8 @@
     cursorLine := 1.
     cursorVisibleLine := 1.
     cursorCol := 1.
-    cursorLineHolder := 1 asValue.
-    cursorColHolder := 1 asValue.
+    cursorLineHolder := ValueHolder with:1.
+    cursorColHolder := ValueHolder with:1.
     modifiedChannel := ValueHolder with:false.
     acceptChannel := ValueHolder with:false.
     acceptChannel addDependent:self.
@@ -6052,8 +6054,8 @@
     tabMeansNextField := false.
     "/ autoIndent := UserPreferences current autoIndentInCodeView.
     autoIndent := false.
-    editMode := EditMode insertMode asValue.
-    learnMode := false asValue.
+    editMode := ValueHolder with:EditMode insertMode.
+    learnMode := ValueHolder with:false.
     trimBlankLines := self st80EditMode not.
     cursorMovementWhenUpdating := #beginOfText.
     lastReplacementInfo := LastReplacementInfo new.
@@ -6062,7 +6064,7 @@
     self allowDrop:true.        "/ readOnly tested in #canDrop:
 
     undoSupport := UndoSupport for:self.
-    codeAspectHolder := nil asValue.
+    codeAspectHolder := ValueHolder with:nil.
 
     "Modified: / 27-09-2013 / 09:41:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
@@ -6138,7 +6140,7 @@
     "a holder returning true, if in learn mode"
 
     learnMode isNil ifTrue:[
-        learnMode := false asValue
+        learnMode := ValueHolder with:false
     ].
     ^ learnMode
 !
@@ -7067,9 +7069,9 @@
     modal := false "(UserPreferences current searchDialogIsModal)".
     lastSearchDirection := #forward.
     ign := lastSearchIgnoredCase ? LastSearchIgnoredCase ? true.
-    caseHolder := ign asValue.
-    patternHolder := '' asValue.
-    replacePatternHolder := '' asValue.
+    caseHolder := ValueHolder with:ign.
+    patternHolder := ValueHolder with:''.
+    replacePatternHolder := ValueHolder with:''.
     lastSearchPattern notNil ifTrue:[
         initialString := lastSearchPattern
     ].
@@ -7362,6 +7364,8 @@
 !EditTextView methodsFor:'private'!
 
 beep
+    "output an audible beep or bell on my screen device"
+
     UserPreferences current beepInEditor ifTrue:[                
         super beep
     ]
@@ -7437,6 +7441,9 @@
 !
 
 st80EditMode
+    "If on, the cursor wraps at the line end (like in vi or st80);
+     if off, we have the Rand-editor behavior (random access)"
+
     ^ st80Mode ? (UserPreferences current st80EditMode)
 !
 
@@ -8971,11 +8978,11 @@
 !EditTextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.628 2014-12-05 13:39:25 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.633 2015-02-16 01:09:27 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.628 2014-12-05 13:39:25 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.633 2015-02-16 01:09:27 cg Exp $'
 !
 
 version_HG