EditTextView.st
changeset 4661 c029273f7660
parent 4649 1b1db54a3d29
child 4664 f09d5587253f
equal deleted inserted replaced
4660:6ad643669cc1 4661:c029273f7660
  3435      after the last line"
  3435      after the last line"
  3436 
  3436 
  3437     |line col nLines wasOn|
  3437     |line col nLines wasOn|
  3438 
  3438 
  3439     lines notNil ifTrue:[
  3439     lines notNil ifTrue:[
  3440 	wasOn := self hideCursor.
  3440         wasOn := self hideCursor.
  3441 	nLines := lines size.
  3441         nLines := lines size.
  3442 	line := cursorLine.
  3442         line := cursorLine.
  3443 	col := cursorCol.
  3443         col := cursorCol.
  3444 	lines keysAndValuesDo:[:i :l |
  3444         lines keysAndValuesDo:[:i :l |
  3445 	    self replaceString:l atLine:line col:col.
  3445             self replaceString:(l ? '') atLine:line col:col.
  3446 	    (i ~~ nLines or:[withCr]) ifTrue:[
  3446             (i ~~ nLines or:[withCr]) ifTrue:[
  3447 		line := line + 1.
  3447                 line := line + 1.
  3448 		col := 1.
  3448                 col := 1.
  3449 	    ] ifFalse:[
  3449             ] ifFalse:[
  3450 		col := col + (l size).
  3450                 col := col + (l size).
  3451 	    ]
  3451             ]
  3452 	].
  3452         ].
  3453 	self cursorLine:line col:col.
  3453         self cursorLine:line col:col.
  3454 	self makeCursorVisibleAndShowCursor:wasOn.
  3454         self makeCursorVisibleAndShowCursor:wasOn.
  3455 	"/ wasOn ifTrue:[self showCursor].
  3455         "/ wasOn ifTrue:[self showCursor].
  3456     ]
  3456     ]
  3457 
  3457 
  3458     "Created: / 18.5.1996 / 15:32:06 / cg"
  3458     "Created: / 18-05-1996 / 15:32:06 / cg"
  3459     "Modified: / 12.6.1998 / 22:05:51 / cg"
  3459     "Modified: / 25-07-2013 / 17:00:53 / cg"
  3460 !
  3460 !
  3461 
  3461 
  3462 replaceSelectionBy:something
  3462 replaceSelectionBy:something
  3463     "delete the selection (if any) and insert something, a character or string;
  3463     "delete the selection (if any) and insert something, a character or string;
  3464      leave cursor after insertion"
  3464      leave cursor after insertion"
  8193 ! !
  8193 ! !
  8194 
  8194 
  8195 !EditTextView class methodsFor:'documentation'!
  8195 !EditTextView class methodsFor:'documentation'!
  8196 
  8196 
  8197 version
  8197 version
  8198     ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.557 2013-07-08 13:43:20 cg Exp $'
  8198     ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.558 2013-07-25 19:32:21 cg Exp $'
  8199 !
  8199 !
  8200 
  8200 
  8201 version_CVS
  8201 version_CVS
  8202     ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.557 2013-07-08 13:43:20 cg Exp $'
  8202     ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.558 2013-07-25 19:32:21 cg Exp $'
  8203 ! !
  8203 ! !
  8204 
  8204