TextView.st
branchjv
changeset 5981 50c1bb3e9f98
parent 5849 878eeb6b2cd3
parent 5955 72e55279ce07
child 6085 4ecbe3a93aec
--- a/TextView.st	Fri Nov 18 21:10:35 2016 +0000
+++ b/TextView.st	Fri Nov 18 21:15:56 2016 +0000
@@ -14,26 +14,26 @@
 "{ NameSpace: Smalltalk }"
 
 ListView subclass:#TextView
-        instanceVariableNames:'selectionStartLine selectionStartCol selectionEndLine
-                selectionEndCol clickPos clickStartLine clickStartCol clickLine
-                clickCol clickCount expandingTop wordStartCol wordStartLine
-                wordEndCol wordEndLine selectionFgColor selectionBgColor
-                selectStyle directoryForFileDialog defaultFileNameForFileDialog
-                externalEncoding contentsWasSaved searchAction lastSearchPattern
-                lastSearchWasMatch lastSearchIgnoredCase lastSearchDirection
-                lastSearchWasVariableSearch parenthesisSpecification dropSource
-                dragIsActive saveAction st80SelectMode searchBarActionBlock'
-        classVariableNames:'DefaultViewBackground DefaultSelectionForegroundColor
-                DefaultSelectionBackgroundColor
-                DefaultAlternativeSelectionForegroundColor
-                DefaultAlternativeSelectionBackgroundColor MatchDelayTime
-                WordSelectCatchesBlanks LastSearchPatterns
-                NumRememberedSearchPatterns LastSearchIgnoredCase
-                LastSearchWasMatch DefaultParenthesisSpecification
-                LastSearchWasMatchWithRegex LastSearchWasWrapAtEndOfText
-                LastSearchWasReplace LastSearchReplacedString'
-        poolDictionaries:''
-        category:'Views-Text'
+	instanceVariableNames:'selectionStartLine selectionStartCol selectionEndLine
+		selectionEndCol clickPos clickStartLine clickStartCol clickLine
+		clickCol clickCount expandingTop wordStartCol wordStartLine
+		wordEndCol wordEndLine selectionFgColor selectionBgColor
+		selectStyle directoryForFileDialog defaultFileNameForFileDialog
+		externalEncoding contentsWasSaved searchAction lastSearchPattern
+		lastSearchWasMatch lastSearchIgnoredCase lastSearchDirection
+		lastSearchWasVariableSearch parenthesisSpecification dropSource
+		dragIsActive saveAction st80SelectMode searchBarActionBlock'
+	classVariableNames:'DefaultViewBackground DefaultSelectionForegroundColor
+		DefaultSelectionBackgroundColor
+		DefaultAlternativeSelectionForegroundColor
+		DefaultAlternativeSelectionBackgroundColor MatchDelayTime
+		WordSelectCatchesBlanks LastSearchPatterns
+		NumRememberedSearchPatterns LastSearchIgnoredCase
+		LastSearchWasMatch DefaultParenthesisSpecification
+		LastSearchWasMatchWithRegex LastSearchWasWrapAtEndOfText
+		LastSearchWasReplace LastSearchReplacedString'
+	poolDictionaries:''
+	category:'Views-Text'
 !
 
 !TextView class methodsFor:'documentation'!
@@ -404,10 +404,10 @@
 
     <resource: #canvas>
 
-    ^
+    ^ 
     #(FullSpec
        name: searchDialogSpec
-       window:
+       window: 
       (WindowSpec
 	 label: 'String search'
 	 name: 'String search'
@@ -415,7 +415,7 @@
 	 max: (Point 1280 1024)
          bounds: (Rectangle 0 0 475 376)
        )
-       component:
+       component: 
       (SpecCollection
 	 collection: (
 	  (LabelSpec
@@ -461,7 +461,7 @@
 		 )
                 (ViewSpec
                    name: 'MatchBox'
-                   component:
+                   component: 
                   (SpecCollection
                      collection: (
                       (CheckBoxSpec
@@ -484,7 +484,7 @@
                          translateLabel: true
                        )
                       )
-
+                    
                    )
                    extent: (Point 475 24)
 		 )
@@ -577,10 +577,10 @@
 			 acceptOnReturn: true
 			 acceptOnTab: true
 			 acceptOnPointerLeave: true
-                         extent: (Point 297 24)
+                         extent: (Point 318 24)
 		       )
 		      )
-
+                    
 		   )
                    extent: (Point 475 24)
                  )
@@ -607,12 +607,12 @@
                    extent: (Point 475 24)
 		 )
 		)
-
+              
 	     )
 	   )
 	  (HorizontalPanelViewSpec
 	     name: 'horizontalPanelView'
-             layout: (LayoutFrame 0 0.0 -32 1.0 -16 1.0 0 1.0)
+             layout: (LayoutFrame 0 0.0 -36 1.0 -16 1.0 0 1.0)
 	     level: 0
 	     horizontalLayout: fitSpace
 	     verticalLayout: center
@@ -653,12 +653,12 @@
                    useDefaultExtent: true
 		 )
 		)
-
+              
 	     )
 	     keepSpaceForOSXResizeHandleH: true
 	   )
 	  )
-
+        
        )
      )
 ! !
@@ -1013,7 +1013,10 @@
 
 textView
     "added to allow sending textView in any context, where either
-     a TextView or a CodeView2 can be encountered. Sigh."
+     a TextView or a CodeView2 can be encountered. 
+     Sigh - all of this because CodeView2 wraps a textView, and does not forward
+     all messages. 
+     Thus, the codeView2 framework always sends codeView2 textView doSomething"
      
     ^ self
 ! !
@@ -1083,7 +1086,7 @@
 
 setContents:something
     "set the contents (either a string or a Collection of strings)
-     dont change the position (i.e. do not scroll) or the selection."
+     don't change the position (i.e. do not scroll) or the selection."
 
     |selStartLine selStartCol selEndLine selEndCol selStyle|
 
@@ -2084,8 +2087,13 @@
 
     self withWaitCursorDo:[
         fp := FontPanel new.
-        fp withChangeFontInViewsAllCheckBox:true.
-        newFont := fp fontFromUserInitial:gc font.
+        newFont := 
+            fp  fontFromUserInitial:gc font 
+                    title:nil
+                    filter:nil
+                    encoding:nil
+                    enabled:true
+                    withChangeAllOption:true.
     ].
     newFont notNil ifTrue:[
 	self font:newFont.
@@ -2096,12 +2104,12 @@
             fontPrefs := userPrefs fontPreferences.
             fontPrefs isNil ifTrue:[ fontPrefs := newFontPrefs := Dictionary new ].
 
-            TextView defaultFont:newFont.
             fontPrefs at:#Text put:(newFont storeString).
             newFontPrefs notNil ifTrue:[ userPrefs fontPreferences:newFontPrefs ].
             userPrefs beModified.
-            DebugView newDebugger.
+            "/ DebugView newDebugger.
             TextView allSubInstances do:[:v |
+                v class defaultFont:newFont.
                 v font:newFont
             ].
         ].