ETxtView.st
changeset 1390 99674e1d9c85
parent 1355 6725ab9cc6f5
child 1415 f75eeebc0d1d
equal deleted inserted replaced
1389:82a672130741 1390:99674e1d9c85
     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 20-oct-1997 at 2:09:41 pm'                  !
       
    14 
    12 
    15 TextView subclass:#EditTextView
    13 TextView subclass:#EditTextView
    16 	instanceVariableNames:'cursorLine cursorVisibleLine cursorCol cursorShown
    14 	instanceVariableNames:'cursorLine cursorVisibleLine cursorCol cursorShown
    17 		prevCursorState readOnly modifiedChannel fixedSize exceptionBlock
    15 		prevCursorState readOnly modifiedChannel fixedSize exceptionBlock
    18 		cursorFgColor cursorBgColor cursorNoFocusFgColor cursorType
    16 		cursorFgColor cursorBgColor cursorNoFocusFgColor cursorType
   336 !EditTextView class methodsFor:'defaults'!
   334 !EditTextView class methodsFor:'defaults'!
   337 
   335 
   338 updateStyleCache
   336 updateStyleCache
   339     "extract values from the styleSheet and cache them in class variables"
   337     "extract values from the styleSheet and cache them in class variables"
   340 
   338 
   341     <resource: #style (#'textCursor.foregroundColor' #'textCursorBackgroundColor'
   339     <resource: #style (#'textCursor.foregroundColor' #'textCursor.backgroundColor'
   342                        #'textCursor.noFocusForegroundColor' 
   340                        #'textCursor.noFocusForegroundColor' 
   343                        #'textCursor.type' )>
   341                        #'textCursor.type' )>
   344 
   342 
   345     DefaultCursorForegroundColor := StyleSheet colorAt:'textCursor.foregroundColor'.
   343     DefaultCursorForegroundColor := StyleSheet colorAt:'textCursor.foregroundColor'.
   346     DefaultCursorBackgroundColor := StyleSheet colorAt:'textCursor.backgroundColor'.
   344     DefaultCursorBackgroundColor := StyleSheet colorAt:'textCursor.backgroundColor'.
   347     DefaultCursorNoFocusForegroundColor := StyleSheet colorAt:'textCursor.noFocusForegroundColor'.
   345     DefaultCursorNoFocusForegroundColor := StyleSheet colorAt:'textCursor.noFocusForegroundColor'.
   348     DefaultCursorType := StyleSheet at:'textCursor.type' default:#block.
   346     DefaultCursorType := StyleSheet at:'textCursor.type' default:#block.
   349 
   347 
   350     ST80Mode := false.
   348     ST80Mode := false.
   351 
   349 
   352     "Modified: 20.10.1997 / 13:54:30 / cg"
   350     "Modified: / 31.10.1997 / 13:13:51 / cg"
   353 ! !
   351 ! !
   354 
   352 
   355 !EditTextView methodsFor:'ST-80 compatibility editing'!
   353 !EditTextView methodsFor:'ST-80 compatibility editing'!
       
   354 
       
   355 cutSelection
       
   356     self cut
       
   357 
       
   358     "Created: / 31.10.1997 / 03:29:50 / cg"
       
   359 !
   356 
   360 
   357 insert:aString at:aCharacterPosition
   361 insert:aString at:aCharacterPosition
   358     "insert a string at aCharacterPosition."
   362     "insert a string at aCharacterPosition."
   359 
   363 
   360     |line col|
   364     |line col|
   391 
   395 
   392      v := EditTextView new openAndWait.
   396      v := EditTextView new openAndWait.
   393      v contents:'1234567890\1234567890\1234567890\' withCRs.
   397      v contents:'1234567890\1234567890\1234567890\' withCRs.
   394      v insertAndSelect:'<- hello there' at:5.
   398      v insertAndSelect:'<- hello there' at:5.
   395     "
   399     "
       
   400 !
       
   401 
       
   402 pasteSelection
       
   403     self paste
       
   404 
       
   405     "Created: / 31.10.1997 / 03:28:53 / cg"
   396 ! !
   406 ! !
   397 
   407 
   398 !EditTextView methodsFor:'accessing-behavior'!
   408 !EditTextView methodsFor:'accessing-behavior'!
   399 
   409 
   400 acceptAction
   410 acceptAction
  3523 ! !
  3533 ! !
  3524 
  3534 
  3525 !EditTextView methodsFor:'queries'!
  3535 !EditTextView methodsFor:'queries'!
  3526 
  3536 
  3527 specClass
  3537 specClass
       
  3538     "redefined, since the name of my specClass is nonStandard (i.e. not EditTextSpec)"
       
  3539 
  3528     self class == EditTextView ifTrue:[^ TextEditorSpec].
  3540     self class == EditTextView ifTrue:[^ TextEditorSpec].
  3529     ^ super specClass
  3541     ^ super specClass
  3530 
  3542 
  3531     "Modified: 25.2.1997 / 14:54:16 / cg"
  3543     "Modified: / 31.10.1997 / 19:48:19 / cg"
  3532 !
  3544 !
  3533 
  3545 
  3534 tabMeansNextField
  3546 tabMeansNextField
  3535     "return true, if a Tab character should shift focus."
  3547     "return true, if a Tab character should shift focus."
  3536 
  3548 
  4081 ! !
  4093 ! !
  4082 
  4094 
  4083 !EditTextView class methodsFor:'documentation'!
  4095 !EditTextView class methodsFor:'documentation'!
  4084 
  4096 
  4085 version
  4097 version
  4086     ^ '$Header: /cvs/stx/stx/libwidg/Attic/ETxtView.st,v 1.139 1997-10-21 18:28:05 cg Exp $'
  4098     ^ '$Header: /cvs/stx/stx/libwidg/Attic/ETxtView.st,v 1.140 1997-11-03 15:32:10 cg Exp $'
  4087 ! !
  4099 ! !