# HG changeset patch # User Claus Gittinger # Date 1402693621 -7200 # Node ID 3f5fbf5bb5d66af2a1f7a1bdc302234b208fa618 # Parent c5f5b4ae81956b5ffd21a3148fcf518456a3efaa class: View added: #assignKeyboardFocusTo: changed: #assignKeyboardFocusToFirstInputField diff -r c5f5b4ae8195 -r 3f5fbf5bb5d6 View.st --- a/View.st Wed Jun 11 15:59:15 2014 +0200 +++ b/View.st Fri Jun 13 23:07:01 2014 +0200 @@ -736,6 +736,19 @@ !View methodsFor:'initialization & release'! +assignKeyboardFocusTo:aConsumer + |wg| + + wg := self windowGroup . + self graphicsDevice isWindowsPlatform ifTrue:[ + wg focusView:aConsumer byTab:true. + ] ifFalse:[ + aConsumer requestFocus. + "/ consumer requestFocus. - could be denied; but we force it here + wg focusView:aConsumer byTab:false. + ]. +! + assignKeyboardFocusToFirstInputField "assign the keyboard focus to the first first keyboardConsumer. (in older versions, this used to favour inputfields over editFields; @@ -759,13 +772,7 @@ ]. consumer := (consumer ? firstConsumer ? firstCursorConsumer). consumer notNil ifTrue:[ - self graphicsDevice isWindowsPlatform ifTrue:[ - self windowGroup focusView:consumer byTab:true. - ] ifFalse:[ - consumer requestFocus. - "/ consumer requestFocus. - could be denied; but we force it here - self windowGroup focusView:consumer byTab:false. - ]. + self assignKeyboardFocusTo:consumer ]. "Modified: / 29-08-2006 / 14:32:30 / cg" @@ -814,6 +821,6 @@ !View class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libview/View.st,v 1.84 2014-04-03 14:34:55 cg Exp $' + ^ '$Header: /cvs/stx/stx/libview/View.st,v 1.85 2014-06-13 21:07:01 cg Exp $' ! !