KeyboardProcessor.st
changeset 2249 150a384a74a6
parent 2008 bc367a4d7d6a
child 2337 1ed848a70875
equal deleted inserted replaced
2248:bb624c6d4709 2249:150a384a74a6
     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 
       
    14 
       
    15 
       
    16 
       
    17 "{ Package: 'stx:libview2' }"
    12 "{ Package: 'stx:libview2' }"
    18 
    13 
    19 Object subclass:#KeyboardProcessor
    14 Object subclass:#KeyboardProcessor
    20 	instanceVariableNames:'returnIsOKInDialog escapeIsCancelInDialog menuBar
    15 	instanceVariableNames:'returnIsOKInDialog escapeIsCancelInDialog menuBar
    21 		autoAcceptListeners globalAccelerators componentWithInitialFocus'
    16 		autoAcceptListeners globalAccelerators componentWithInitialFocus'
   308      "about to close the window via return ok accept.
   303      "about to close the window via return ok accept.
   309       Ask all acceptListeners to accept their value and return true, if all of those fields
   304       Ask all acceptListeners to accept their value and return true, if all of those fields
   310       did."
   305       did."
   311 
   306 
   312     autoAcceptListeners notNil ifTrue:[
   307     autoAcceptListeners notNil ifTrue:[
   313         autoAcceptListeners do:[:aListener |
   308         ^ autoAcceptListeners conform:[:aListener | (aListener requestAutoAccept)]
   314             (aListener requestAutoAccept) ifFalse:[^ false].
       
   315         ].
       
   316         ^ true
       
   317     ].
   309     ].
   318     "/ if no input field (or comparable widget) is present ...
   310     "/ if no input field (or comparable widget) is present ...
   319 "/    ^ false     <- wrong.
   311 "/    ^ false     <- wrong.
   320     ^ true.
   312     ^ true.
       
   313 
       
   314     "Modified: / 13-10-2006 / 12:56:02 / cg"
   321 ! !
   315 ! !
   322 
   316 
   323 !KeyboardProcessor methodsFor:'setup'!
   317 !KeyboardProcessor methodsFor:'setup'!
   324 
   318 
   325 addAutoAcceptListener:aListener
   319 addAutoAcceptListener:aListener
   335 ! !
   329 ! !
   336 
   330 
   337 !KeyboardProcessor class methodsFor:'documentation'!
   331 !KeyboardProcessor class methodsFor:'documentation'!
   338 
   332 
   339 version
   333 version
   340     ^ '$Header: /cvs/stx/stx/libview2/KeyboardProcessor.st,v 1.36 2004-08-19 10:10:10 cg Exp $'
   334     ^ '$Header: /cvs/stx/stx/libview2/KeyboardProcessor.st,v 1.37 2006-10-13 11:03:39 cg Exp $'
   341 ! !
   335 ! !