TextView.st
changeset 1349 09db5ecfb437
parent 1337 70043e6a8f08
child 1353 5dac6aa6ac96
equal deleted inserted replaced
1348:b90e7cd72391 1349:09db5ecfb437
     7  inclusion of the above copyright notice.   This software may not
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
       
    12 
       
    13 'From Smalltalk/X, Version:3.2.1 on 14-oct-1997 at 11:22:55 pm'                 !
    12 
    14 
    13 ListView subclass:#TextView
    15 ListView subclass:#TextView
    14 	instanceVariableNames:'selectionStartLine selectionStartCol selectionEndLine
    16 	instanceVariableNames:'selectionStartLine selectionStartCol selectionEndLine
    15 		selectionEndCol clickStartLine clickStartCol clickLine clickCol
    17 		selectionEndCol clickStartLine clickStartCol clickLine clickCol
    16 		clickCount expandingTop wordStartCol wordStartLine wordEndCol
    18 		clickCount expandingTop wordStartCol wordStartLine wordEndCol
  1272     "save the contents into a file named fileName"
  1274     "save the contents into a file named fileName"
  1273  
  1275  
  1274     self withCursor:Cursor write do:[
  1276     self withCursor:Cursor write do:[
  1275         |aStream msg|
  1277         |aStream msg|
  1276 
  1278 
  1277         aStream := FileStream newFileNamed:fileName.
  1279         FileStream openErrorSignal catch:[
       
  1280             aStream := FileStream newFileNamed:fileName.
       
  1281         ].
  1278         aStream isNil ifTrue:[
  1282         aStream isNil ifTrue:[
  1279             msg := resources string:'cannot write file %1 !!' with:fileName.
  1283             msg := resources string:'cannot write file %1 !!' with:fileName.
  1280             self warn:(msg , '\\(' , FileStream lastErrorString , ')' ) withCRs
  1284             self warn:(msg , '\\(' , FileStream lastErrorString , ')' ) withCRs
  1281         ] ifFalse:[
  1285         ] ifFalse:[
  1282             self
  1286             self
  1283 	        fileOutContentsOn:aStream 
  1287                 fileOutContentsOn:aStream 
  1284 	        compressTabs:true 
  1288                 compressTabs:true 
  1285 	        encoding:externalEncoding.
  1289                 encoding:externalEncoding.
  1286             aStream close.
  1290             aStream close.
  1287             contentsWasSaved := true
  1291             contentsWasSaved := true
  1288         ]
  1292         ]
  1289     ]
  1293     ]
  1290 
  1294 
  1291     "Modified: 5.1.1997 / 02:14:46 / cg"
  1295     "Modified: 13.10.1997 / 12:22:39 / cg"
  1292 !
  1296 !
  1293 
  1297 
  1294 search
  1298 search
  1295     "search for a string - show a box to enter searchpattern 
  1299     "search for a string - show a box to enter searchpattern 
  1296      - currently no regular expressions are handled."
  1300      - currently no regular expressions are handled."
  2789 ! !
  2793 ! !
  2790 
  2794 
  2791 !TextView class methodsFor:'documentation'!
  2795 !TextView class methodsFor:'documentation'!
  2792 
  2796 
  2793 version
  2797 version
  2794     ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.107 1997-10-07 14:21:45 cg Exp $'
  2798     ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.108 1997-10-15 11:28:03 cg Exp $'
  2795 ! !
  2799 ! !