--- a/TextView.st Fri Sep 09 07:06:20 2016 +0200
+++ b/TextView.st Sun Sep 11 06:53:06 2016 +0200
@@ -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'!
@@ -1009,6 +1009,13 @@
searchBarActionBlock:something
searchBarActionBlock := something.
+!
+
+textView
+ "added to allow sending textView in any context, where either
+ a TextView or a CodeView2 can be encountered. Sigh."
+
+ ^ self
! !
!TextView methodsFor:'accessing-behavior'!
@@ -1187,12 +1194,34 @@
^ selectionBgColor
!
+selectionBackgroundColor:aColor
+ "set the selection-background color.
+ The default is defined by the styleSheet;
+ typically black-on-green for color displays and white-on-black for b&w displays."
+
+ selectionBgColor := aColor onDevice:device.
+ self hasSelection ifTrue:[
+ self invalidate
+ ]
+!
+
selectionForegroundColor
"return the selection-foreground color."
^ selectionFgColor
!
+selectionForegroundColor:aColor
+ "set the selection-foreground color.
+ The default is defined by the styleSheet;
+ typically black-on-green for color displays and white-on-black for b&w displays."
+
+ selectionFgColor := aColor onDevice:device.
+ self hasSelection ifTrue:[
+ self invalidate
+ ]
+!
+
selectionForegroundColor:color1 backgroundColor:color2
"set both the selection-foreground and cursor background colors.
The default is defined by the styleSheet;