TextView.st
changeset 1303 6e2aa19c1aed
parent 1288 19eee9e48131
child 1308 61d944600e3f
equal deleted inserted replaced
1302:ed8d5b631f93 1303:6e2aa19c1aed
   395 ! !
   395 ! !
   396 
   396 
   397 !TextView methodsFor:'accessing'!
   397 !TextView methodsFor:'accessing'!
   398 
   398 
   399 characterPositionOfSelection
   399 characterPositionOfSelection
   400     "return the character index of the first character in the selection"
   400     "return the character index of the first character in the selection.
   401 
   401      Returns 0 if there is no selection."
   402     selectionStartLine isNil ifTrue:[^ 1].
   402 
       
   403     selectionStartLine isNil ifTrue:[^ 0].
   403     ^ self characterPositionOfLine:selectionStartLine
   404     ^ self characterPositionOfLine:selectionStartLine
   404 			       col:selectionStartCol
   405                                col:selectionStartCol
       
   406 
       
   407     "Modified: 14.8.1997 / 16:35:37 / cg"
       
   408 !
       
   409 
       
   410 characterPositionOfSelectionEnd
       
   411     "return the character index of the last character in the selection.
       
   412      Returns 0 if there is no selection."
       
   413 
       
   414     selectionStartLine isNil ifTrue:[^ 0].
       
   415     ^ self characterPositionOfLine:selectionEndLine
       
   416                                col:selectionEndCol
       
   417 
       
   418     "Created: 14.8.1997 / 16:35:24 / cg"
       
   419     "Modified: 14.8.1997 / 16:35:45 / cg"
   405 !
   420 !
   406 
   421 
   407 contentsWasSaved
   422 contentsWasSaved
   408     "return true, if the contents was saved (by a save action),
   423     "return true, if the contents was saved (by a save action),
   409      false if not (or was modified again after the last save)."
   424      false if not (or was modified again after the last save)."
  2492 ! !
  2507 ! !
  2493 
  2508 
  2494 !TextView class methodsFor:'documentation'!
  2509 !TextView class methodsFor:'documentation'!
  2495 
  2510 
  2496 version
  2511 version
  2497     ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.99 1997-07-31 17:16:42 cg Exp $'
  2512     ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.100 1997-08-14 15:12:10 cg Exp $'
  2498 ! !
  2513 ! !