--- a/EditField.st Mon Mar 20 12:52:08 1995 +0100
+++ b/EditField.st Sat Mar 25 23:21:46 1995 +0100
@@ -15,8 +15,8 @@
EditTextView subclass:#EditField
instanceVariableNames:'leaveAction enabled enableAction'
classVariableNames:'DefaultForegroundColor DefaultBackgroundColor
- DefaultSelectionForegroundColor DefaultSelectionBackgroundColor
- DefaultFont'
+ DefaultSelectionForegroundColor DefaultSelectionBackgroundColor
+ DefaultFont'
poolDictionaries:''
category:'Views-Text'
!
@@ -25,7 +25,7 @@
COPYRIGHT (c) 1990 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.14 1995-03-18 05:14:20 claus Exp $
+$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.15 1995-03-25 22:19:58 claus Exp $
'!
!EditField class methodsFor:'documentation'!
@@ -46,7 +46,7 @@
version
"
-$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.14 1995-03-18 05:14:20 claus Exp $
+$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.15 1995-03-25 22:19:58 claus Exp $
"
!
@@ -309,13 +309,13 @@
return was pressed."
enabled ifTrue:[
- leaveAction notNil ifTrue:[
- leaveAction value:#Return
- ].
- "model-view behavior"
- (model notNil and:[changeSymbol notNil]) ifTrue:[
- model perform:changeSymbol with:(self contents).
- ].
+ leaveAction notNil ifTrue:[
+ leaveAction value:#Return
+ ].
+ "model-view behavior"
+ (model notNil and:[changeSymbol notNil]) ifTrue:[
+ model perform:changeSymbol with:(self contents).
+ ].
].
!
@@ -340,20 +340,20 @@
|leave xCol newOffset oldWidth newWidth|
enabled ifFalse:[
- (keyboardHandler notNil
- and:[keyboardHandler canHandle:key]) ifTrue:[
- (keyboardHandler == self) ifTrue:[
- self error:'invalid keyhandler'.
- ^ self
- ].
- keyboardHandler keyPress:key x:x y:y
- ].
- ^ self
+ (keyboardHandler notNil
+ and:[keyboardHandler canHandle:key]) ifTrue:[
+ (keyboardHandler == self) ifTrue:[
+ self error:'invalid keyhandler'.
+ ^ self
+ ].
+ keyboardHandler keyPress:key x:x y:y
+ ].
+ ^ self
].
(key == #DeleteLine) ifTrue:[
- Smalltalk at:#CopyBuffer put:(self contents).
- self contents:''. ^ self
+ Smalltalk at:#CopyBuffer put:(self contents).
+ self contents:''. ^ self
].
leave := false.
@@ -362,12 +362,20 @@
((key == #CursorDown) or:[key == #Next]) ifTrue:[leave := true].
((key == #CursorUp) or:[key == #Prior]) ifTrue:[leave := true].
+ "
+ ignore some ...
+ "
+ (key == #Find) ifTrue:[^self].
+ (key == #FindNext) ifTrue:[^self].
+ (key == #FindPrev) ifTrue:[^self].
+ (key == #GotoLine) ifTrue:[^self].
+
leave ifTrue:[
- self accept.
- (superView canHandle:key) ifTrue:[
- superView keyPress:key x:x y:y.
- ].
- ^ self
+ self accept.
+ (superView canHandle:key) ifTrue:[
+ superView keyPress:key x:x y:y.
+ ].
+ ^ self
].
oldWidth := self widthOfContents.
@@ -379,11 +387,11 @@
"
xCol := (self xOfCol:cursorCol inVisibleLine:cursorLine) - leftOffset.
(xCol > (width * (5/6))) ifTrue:[
- self changed:#preferedExtent
+ self changed:#preferedExtent
] ifFalse:[
- newWidth < (width * (1/6)) ifTrue:[
- self changed:#preferedExtent
- ]
+ newWidth < (width * (1/6)) ifTrue:[
+ self changed:#preferedExtent
+ ]
].
"
@@ -392,18 +400,18 @@
"
xCol := (self xOfCol:cursorCol inVisibleLine:cursorLine) - leftOffset.
(xCol > (width * (5/6))) ifTrue:[
- newOffset := leftOffset + (width // 2).
+ newOffset := leftOffset + (width // 2).
] ifFalse:[
- (xCol < (width * (1/6))) ifTrue:[
- newOffset := 0 max: leftOffset - (width // 2).
- ] ifFalse:[
- newOffset := leftOffset
- ]
+ (xCol < (width * (1/6))) ifTrue:[
+ newOffset := 0 max: leftOffset - (width // 2).
+ ] ifFalse:[
+ newOffset := leftOffset
+ ]
].
newOffset ~~ leftOffset ifTrue:[
- leftOffset := newOffset.
- self clear.
- self redraw
+ leftOffset := newOffset.
+ self clear.
+ self redraw
]
!