diff -r 84e9a47980e3 -r 7d8b66d3c846 EditField.st --- a/EditField.st Sun Apr 13 22:24:04 2014 +0200 +++ b/EditField.st Sun Apr 13 23:00:32 2014 +0200 @@ -1345,7 +1345,7 @@ |l oldWidth| l := someText. - l size > 1 ifTrue:[ + l notEmptyOrNil ifTrue:[ l := OrderedCollection with:(l at:1) ]. oldWidth := self widthOfContents. @@ -1620,7 +1620,7 @@ #DeleteLine #GotoLine #EndOfLine #EndOfText #CursorDown #CursorUp)> - |leave oldContents newContents doAccept keyAction didAccept numArgs| + |leave oldContents newContents doAccept keyAction numArgs| enabled ifFalse:[ ^ self @@ -1680,7 +1680,6 @@ doAccept == true ifTrue:[ self accept. - didAccept := true. ]. keyAction notNil ifTrue:[ @@ -1886,15 +1885,10 @@ "return true, if I want the focus when the mouse pointer enters" - (UserPreferences current focusFollowsMouse ~~ false - and:[(styleSheet at:#'editField.requestFocusOnPointerEnter' default:true) - and:[self enabled - and:[self isReadOnly not]]] - ) ifTrue:[ - ^ true - ]. - - ^ false + ^ UserPreferences current focusFollowsMouse ~~ false + and:[(styleSheet at:#'editField.requestFocusOnPointerEnter' default:true) + and:[self enabled + and:[self isReadOnly not]]] ! ! !EditField methodsFor:'initialization & release'! @@ -2008,7 +2002,7 @@ ]. ]. - isReadOnly not ifTrue:[ + isReadOnly ifFalse:[ items := items , #( ('-' ) @@ -2189,8 +2183,7 @@ hasSelectionForCopy "return true, if there is a selection which can be copied." - passwordCharacter notNil ifTrue:[ ^ false ]. - ^ self hasSelection + ^ passwordCharacter isNil and:[self hasSelection] ! isInputField @@ -2335,7 +2328,7 @@ ] ifFalse:[ len := (self listAt:1) size. len ~~ 0 ifTrue:[ - super selectFromLine:1 col:1 toLine:1 col:len. + self selectFromLine:1 col:1 toLine:1 col:len. ]. typeOfSelection := nil ] @@ -2372,10 +2365,10 @@ !EditField class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.234 2014-04-13 20:24:04 stefan Exp $' + ^ '$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.235 2014-04-13 21:00:32 stefan Exp $' ! version_CVS - ^ '$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.234 2014-04-13 20:24:04 stefan Exp $' + ^ '$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.235 2014-04-13 21:00:32 stefan Exp $' ! !