TextView.st
changeset 3308 4c2c30b357c6
parent 3304 bd0991615b04
child 3315 1b42d2f8dcbc
equal deleted inserted replaced
3307:83c2866e511e 3308:4c2c30b357c6
    18 		clickCol clickCount expandingTop wordStartCol wordStartLine
    18 		clickCol clickCount expandingTop wordStartCol wordStartLine
    19 		wordEndCol wordEndLine selectionFgColor selectionBgColor
    19 		wordEndCol wordEndLine selectionFgColor selectionBgColor
    20 		selectStyle directoryForFileDialog defaultFileNameForFileDialog
    20 		selectStyle directoryForFileDialog defaultFileNameForFileDialog
    21 		externalEncoding contentsWasSaved searchAction lastSearchPattern
    21 		externalEncoding contentsWasSaved searchAction lastSearchPattern
    22 		lastSearchIgnoredCase lastSearchDirection
    22 		lastSearchIgnoredCase lastSearchDirection
    23 		parenthesisSpecification dropSource dragIsActive saveAction'
    23 		parenthesisSpecification dropSource dragIsActive saveAction
       
    24 		st80SelectMode'
    24 	classVariableNames:'DefaultViewBackground DefaultSelectionForegroundColor
    25 	classVariableNames:'DefaultViewBackground DefaultSelectionForegroundColor
    25 		DefaultSelectionBackgroundColor
    26 		DefaultSelectionBackgroundColor
    26 		DefaultAlternativeSelectionForegroundColor
    27 		DefaultAlternativeSelectionForegroundColor
    27 		DefaultAlternativeSelectionBackgroundColor MatchDelayTime
    28 		DefaultAlternativeSelectionBackgroundColor MatchDelayTime
    28 		WordSelectCatchesBlanks ST80Selections LastSearchPatterns
    29 		WordSelectCatchesBlanks LastSearchPatterns
    29 		NumRememberedSearchPatterns LastSearchIgnoredCase
    30 		NumRememberedSearchPatterns LastSearchIgnoredCase
    30 		DefaultParenthesisSpecification'
    31 		DefaultParenthesisSpecification'
    31 	poolDictionaries:''
    32 	poolDictionaries:''
    32 	category:'Views-Text'
    33 	category:'Views-Text'
    33 !
    34 !
   254 lastSearchIgnoredCase
   255 lastSearchIgnoredCase
   255     ^ LastSearchIgnoredCase
   256     ^ LastSearchIgnoredCase
   256 !
   257 !
   257 
   258 
   258 st80SelectMode
   259 st80SelectMode
   259     ^ ST80Selections
   260     ^ UserPreferences current st80SelectMode
   260 
   261 
   261     "Modified: / 6.1.1999 / 14:19:26 / cg"
   262     "Modified: / 03-07-2006 / 16:26:44 / cg"
   262 !
   263 !
   263 
   264 
   264 st80SelectMode:aBoolean
   265 st80SelectMode:aBoolean
   265     ST80Selections := aBoolean
   266     UserPreferences current st80SelectMode:aBoolean
   266 
   267 
   267     "Created: / 7.1.1999 / 13:35:24 / cg"
   268     "Created: / 07-01-1999 / 13:35:24 / cg"
       
   269     "Modified: / 03-07-2006 / 16:27:01 / cg"
   268 !
   270 !
   269 
   271 
   270 updateStyleCache
   272 updateStyleCache
   271     "extract values from the styleSheet and cache them in class variables"
   273     "extract values from the styleSheet and cache them in class variables"
   272 
   274 
   284     DefaultAlternativeSelectionForegroundColor := DefaultSelectionForegroundColor.
   286     DefaultAlternativeSelectionForegroundColor := DefaultSelectionForegroundColor.
   285     DefaultAlternativeSelectionBackgroundColor := DefaultSelectionBackgroundColor.
   287     DefaultAlternativeSelectionBackgroundColor := DefaultSelectionBackgroundColor.
   286     DefaultFont := StyleSheet fontAt:'textView.font'.
   288     DefaultFont := StyleSheet fontAt:'textView.font'.
   287     MatchDelayTime := 0.6.
   289     MatchDelayTime := 0.6.
   288     WordSelectCatchesBlanks := StyleSheet at:'text.wordSelectCatchesBlanks' default:false.
   290     WordSelectCatchesBlanks := StyleSheet at:'text.wordSelectCatchesBlanks' default:false.
   289     ST80Selections := StyleSheet at:'text.st80Selections' default:false.
   291 
   290 
   292     "Modified: / 03-07-2006 / 16:29:42 / cg"
   291     "Modified: / 31.10.1997 / 13:17:16 / cg"
       
   292 ! !
   293 ! !
   293 
   294 
   294 !TextView class methodsFor:'interface specs'!
   295 !TextView class methodsFor:'interface specs'!
   295 
   296 
   296 searchDialogSpec
   297 searchDialogSpec
  1223 doubleClickX:x y:y
  1224 doubleClickX:x y:y
  1224     "double-click - select word under pointer"
  1225     "double-click - select word under pointer"
  1225 
  1226 
  1226     |sel ch matchCol scanCol fwdScan|
  1227     |sel ch matchCol scanCol fwdScan|
  1227 
  1228 
  1228     ST80Selections == true ifTrue:[
  1229     self class st80SelectMode ifTrue:[
  1229         "/ st80 selects:
  1230         "/ st80 selects:
  1230         "/   if clicked right after a parenthesis -> select to matching parenthesis
  1231         "/   if clicked right after a parenthesis -> select to matching parenthesis
  1231         "/   if clicked at beginning of the line  -> select that line
  1232         "/   if clicked at beginning of the line  -> select that line
  1232         "/   if clicked at the top of the text    -> select all
  1233         "/   if clicked at the top of the text    -> select all
  1233         "/
  1234         "/
  1376         wordEndCol := selectionEndCol - 1
  1377         wordEndCol := selectionEndCol - 1
  1377     ] ifFalse:[
  1378     ] ifFalse:[
  1378         wordEndCol := selectionEndCol
  1379         wordEndCol := selectionEndCol
  1379     ]
  1380     ]
  1380 
  1381 
  1381     "Created: 11.9.1997 / 04:12:55 / cg"
  1382     "Created: / 11-09-1997 / 04:12:55 / cg"
  1382     "Modified: 19.9.1997 / 06:43:10 / cg"
  1383     "Modified: / 03-07-2006 / 16:28:08 / cg"
  1383 !
  1384 !
  1384 
  1385 
  1385 extendSelectionToX:x y:y
  1386 extendSelectionToX:x y:y
  1386     "mouse-move while button was pressed - handle selection changes"
  1387     "mouse-move while button was pressed - handle selection changes"
  1387 
  1388 
  3810 
  3811 
  3811 selectionStartLine
  3812 selectionStartLine
  3812     ^ selectionStartLine
  3813     ^ selectionStartLine
  3813 !
  3814 !
  3814 
  3815 
       
  3816 st80SelectMode
       
  3817     ^ st80SelectMode ? UserPreferences current st80SelectMode
       
  3818 
       
  3819     "Created: / 03-07-2006 / 16:30:59 / cg"
       
  3820 !
       
  3821 
  3815 unselect
  3822 unselect
  3816     "unselect - if there was a selection redraw that area"
  3823     "unselect - if there was a selection redraw that area"
  3817 
  3824 
  3818     |startLine endLine startVisLine endVisLine|
  3825     |startLine endLine startVisLine endVisLine|
  3819 
  3826 
  3871 ! !
  3878 ! !
  3872 
  3879 
  3873 !TextView class methodsFor:'documentation'!
  3880 !TextView class methodsFor:'documentation'!
  3874 
  3881 
  3875 version
  3882 version
  3876     ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.266 2006-04-18 11:27:38 stefan Exp $'
  3883     ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.267 2006-07-03 14:32:03 cg Exp $'
  3877 ! !
  3884 ! !
  3878 
  3885 
  3879 TextView initialize!
  3886 TextView initialize!