EditTextView.st
branchjv
changeset 5648 83d019d51deb
parent 5596 c5f3ebcef742
parent 5643 921578f80870
child 5692 2fb164455e7c
equal deleted inserted replaced
5647:a072d911671f 5648:83d019d51deb
  1548     "set both cursor foreground and cursor background colors"
  1548     "set both cursor foreground and cursor background colors"
  1549 
  1549 
  1550     |wasOn|
  1550     |wasOn|
  1551 
  1551 
  1552     wasOn := self hideCursor.
  1552     wasOn := self hideCursor.
  1553     cursorFgColor := color1 onDevice:self graphicsDevice.
  1553     cursorFgColor := color1 onDevice:device.
  1554     cursorBgColor := color2 onDevice:self graphicsDevice.
  1554     cursorBgColor := color2 onDevice:device.
  1555     wasOn ifTrue:[self showCursor]
  1555     wasOn ifTrue:[self showCursor]
  1556 !
  1556 !
  1557 
  1557 
  1558 cursorType
  1558 cursorType
  1559     "return the style of the text cursor.
  1559     "return the style of the text cursor.
  4732     ].
  4732     ].
  4733 
  4733 
  4734     "On X11, be nice and paste PRIMARY when middle click. 
  4734     "On X11, be nice and paste PRIMARY when middle click. 
  4735      Note, that middle button on X11 is translated to button
  4735      Note, that middle button on X11 is translated to button
  4736      128 in Smalltalk/X - see XWorkstation class>>initializeConstants"
  4736      128 in Smalltalk/X - see XWorkstation class>>initializeConstants"
  4737     (button == #paste and:[self graphicsDevice platformName == #X11]) ifTrue:[
  4737     (button == #paste and:[device platformName == #X11]) ifTrue:[
  4738         self undoableDo:[
  4738         self undoableDo:[
  4739             self paste: (self getClipboardText:#selection).
  4739             self paste: (self getClipboardText:#selection).
  4740         ].
  4740         ].
  4741         ^self.
  4741         ^self.
  4742     ].
  4742     ].
  5067         completionSupport stopCompletionProcess.
  5067         completionSupport stopCompletionProcess.
  5068         (completionSupport handleKeyPress:key x:x y:y) ifTrue:["eaten" ^ self].
  5068         (completionSupport handleKeyPress:key x:x y:y) ifTrue:["eaten" ^ self].
  5069     ].
  5069     ].
  5070 
  5070 
  5071     key isSymbol ifTrue:[
  5071     key isSymbol ifTrue:[
  5072         (self graphicsDevice modifierKeys includes:key) ifFalse:[
  5072         (device modifierKeys includes:key) ifFalse:[
  5073             lastReplacementInfo stillCollectingInput:false.
  5073             lastReplacementInfo stillCollectingInput:false.
  5074         ]
  5074         ]
  5075     ].
  5075     ].
  5076     (key == #LearnKeyboardMacro) ifTrue:[
  5076     (key == #LearnKeyboardMacro) ifTrue:[
  5077         lastReplacementInfo stillCollectingInput:false.
  5077         lastReplacementInfo stillCollectingInput:false.
  6028 fetchDeviceResources
  6028 fetchDeviceResources
  6029     "fetch device colors, to avoid reallocation at redraw time"
  6029     "fetch device colors, to avoid reallocation at redraw time"
  6030 
  6030 
  6031     super fetchDeviceResources.
  6031     super fetchDeviceResources.
  6032 
  6032 
  6033     cursorFgColor notNil ifTrue:[cursorFgColor := cursorFgColor onDevice:self graphicsDevice].
  6033     cursorFgColor notNil ifTrue:[cursorFgColor := cursorFgColor onDevice:device].
  6034     cursorBgColor notNil ifTrue:[cursorBgColor := cursorBgColor onDevice:self graphicsDevice].
  6034     cursorBgColor notNil ifTrue:[cursorBgColor := cursorBgColor onDevice:device].
  6035     cursorNoFocusFgColor notNil ifTrue:[cursorNoFocusFgColor := cursorNoFocusFgColor onDevice:self graphicsDevice].
  6035     cursorNoFocusFgColor notNil ifTrue:[cursorNoFocusFgColor := cursorNoFocusFgColor onDevice:device].
  6036 
  6036 
  6037     "Created: 14.1.1997 / 00:15:24 / cg"
  6037     "Created: 14.1.1997 / 00:15:24 / cg"
  6038     "Modified: 18.2.1997 / 15:02:46 / cg"
  6038     "Modified: 18.2.1997 / 15:02:46 / cg"
  6039 !
  6039 !
  6040 
  6040 
  6567 !
  6567 !
  6568 
  6568 
  6569 getTextSelectionFromHistory
  6569 getTextSelectionFromHistory
  6570     |sel list box history|
  6570     |sel list box history|
  6571 
  6571 
  6572     history := self graphicsDevice getCopyBufferHistory copy.
  6572     history := device getCopyBufferHistory copy.
  6573     list := history collect:[:entry |
  6573     list := history collect:[:entry |
  6574                 |text shown|
  6574                 |text shown|
  6575 
  6575 
  6576                 text := entry asString string asCollectionOfLines.
  6576                 text := entry asString string asCollectionOfLines.
  6577                 shown := text detect:[:line| line notEmptyOrNil] ifNone:['      '].
  6577                 shown := text detect:[:line| line notEmptyOrNil] ifNone:['      '].
  7654      line (and possibly see the cursor behind the line)"
  7654      line (and possibly see the cursor behind the line)"
  7655 
  7655 
  7656     |w dev|
  7656     |w dev|
  7657 
  7657 
  7658     w := super widthOfContents.
  7658     w := super widthOfContents.
  7659     (dev := self graphicsDevice ) isNil ifTrue:[
  7659     (dev := device ) isNil ifTrue:[
  7660         "/ really don't know ...
  7660         "/ really don't know ...
  7661         dev := Screen current
  7661         dev := Screen current
  7662     ].
  7662     ].
  7663     ^ w + (gc font widthOn:dev)
  7663     ^ w + (gc font widthOn:dev)
  7664 
  7664 
  7671     "make the view visible - scroll to make the cursor visible."
  7671     "make the view visible - scroll to make the cursor visible."
  7672 
  7672 
  7673     super realize.
  7673     super realize.
  7674 
  7674 
  7675     self makeCursorVisible.
  7675     self makeCursorVisible.
  7676     cursorFgColor := cursorFgColor onDevice:self graphicsDevice.
  7676     cursorFgColor := cursorFgColor onDevice:device.
  7677     cursorBgColor := cursorBgColor onDevice:self graphicsDevice.
  7677     cursorBgColor := cursorBgColor onDevice:device.
  7678 
  7678 
  7679     "Modified: 20.12.1996 / 14:16:05 / cg"
  7679     "Modified: 20.12.1996 / 14:16:05 / cg"
  7680     "Created: 24.7.1997 / 18:24:12 / cg"
  7680     "Created: 24.7.1997 / 18:24:12 / cg"
  7681 ! !
  7681 ! !
  7682 
  7682